CntSetSamplingStartTrigger


Function

Sets the sampling start conditions.

Format

Ret = CntSetSamplingStartTrigger ( Id , StartTrg , CountStartMode , CountChNum )

Parameters

Id [ C, C++ : short] [Python: ctypes.c_short]
Specifies the device ID retrieved from CntInit.

StartTrg [ C, C++ : short] [Python: ctypes.c_short]
Specify the sampling start condition. After the CntStartSampling function is executed, sampling will start when the conditions specified here are satisfied. Software Start setting means that sampling will start as soon as the CntStartSampling function is executed.

Definition

Value

Description

CNTS_START_SOFT

1

Software Start

CNTS_START_EXT_RISE

2

External Signal Rising

CNTS_START_EXT_FALL

3

External Signal Falling

CNTS_START_CNTMATCH_CH0_REG0

4

Count Match Channel 0 Compare Register 0

CNTS_START_CNTMATCH_CH1_REG0

5

Count Match Channel 1 Compare Register 0

CNTS_START_CNTMATCH_CH2_REG0

6

Count Match Channel 2 Compare Register 0

CNTS_START_CNTMATCH_CH3_REG0

7

Count Match Channel 3 Compare Register 0

CNTS_START_CNTMATCH_CH0_REG1

12

Count Match Channel 0 Compare Register 1

CNTS_START_CNTMATCH_CH1_REG1

13

Count Match Channel 1 Compare Register 1

CNTS_START_CNTMATCH_CH2_REG1

14

Count Match Channel 2 Compare Register 1

CNTS_START_CNTMATCH_CH3_REG1

15

Count Match Channel 3 Compare Register 1

CountStartMode [ C, C++ : short] [Python: ctypes.c_short]
Specify whether to start counter when sampling starts.

Definition

Value

Description

CNTS_START_CNT_NOT_WITH_SAMP

3

Start counter regardless of sampling

CNTS_START_CNT_WITH_SAMP

4

Start counter when sampling starts

CountChNum [ C, C++ : short] [Python: ctypes.c_short]
Set the number of channels to count when sampling. This function is used to set the counter start condition for consecutive channels from channel 0 to channel (CountChNum - 1).
Allowable setting range:
1<=CountChNum<=Maximum number of channels of using device

Return Value

Ret [ C, C++ : long] [Python: ctypes.c_long]

Definition

Value

Description

CNT_ERR_SUCCESS

0

Normal Complete

CNT_ERR_DLL_INVALID_ID

10001

Invalid ID is specified.

CNT_ERR_DLL_CALL_DRIVER

10002

Driver cannot be called (failed in ioctl).

CNT_ERR_SYS_MEMORY

20000

It failed in memory allocation for the object preparation.

CNT_ERR_SYS_USING_OTHER_PROCESS

20003

Cannot use because another process is using the device.

CNT_ERR_SYS_CH_NUM

20202

Number of channels is out of range.

CNT_ERR_SYS_START_TRG

21005

The start condition is out of range.

CNT_ERR_SYS_COUNT_START_MODE

21006

The count start condition is out of range.

The other errors: (See also: Details of Error Code)

Initial Value

Uses Software Start for channel 0 and 1.

Remarks

Must set the start condition in order to make the application operation regular. The function CntStartCount must be execute, regardless of CountStartMode setting. This function should be executed in the setting stage before sampling starts.

Example

C, C++

Ret = CntSetSamplingStartTrigger (Id, CNTS_START_SOFT, CNTS_START_CNT_WITH_SAMP, 2);
 

Python

Ret = ccnt.CntSetSamplingStartTrigger (Id, ccnt.CNTS_START_SOFT, ccnt.CNTS_START_CNT_WITH_SAMP, 2)
 

See Also

CntSetSamplingClockTrigger CntSetSamplingStopTrigger