CntSetSamplingStopTrigger


Function

Sets the sampling stop conditions.

Format

Ret = CntSetSamplingStopTrigger ( Id , StopTrg , CountStopMode , CountChNum )

Parameters

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

StopTrg [C: short] [Python: ctypes.c_short]
Specify the sampling stop condition.

Definition

Value

Description

CNTS_STOP_SOFT

1

Software Stop

CNTS_STOP_EXT_RISE

2

External Signal Rising

CNTS_STOP_EXT_FALL

3

External Signal Falling

CNTS_STOP_NUM

4

Stop Transfer by Specified Times

CNTS_STOP_CNTMATCH_CH0_REG0

5

Count Match Channel 0 Compare Register 0

CNTS_STOP_CNTMATCH_CH1_REG0

6

Count Match Channel 1 Compare Register 0

CNTS_STOP_CNTMATCH_CH2_REG0

7

Count Match Channel 2 Compare Register 0

CNTS_STOP_CNTMATCH_CH3_REG0

8

Count Match Channel 3 Compare Register 0

CNTS_STOP_CNTMATCH_CH0_REG1

13

Count Match Channel 0 Compare Register 1

CNTS_STOP_CNTMATCH_CH1_REG1

14

Count Match Channel 1 Compare Register 1

CNTS_STOP_CNTMATCH_CH2_REG1

15

Count Match Channel 2 Compare Register 1

CNTS_STOP_CNTMATCH_CH3_REG1

16

Count Match Channel 3 Compare Register 1

CountStopMode [C: short] [Python: ctypes.c_short]
Specify whether to stop counter when sampling stops.

Definition

Value

Description

CNTS_STOP_CNT_NOT_WITH_SAMP

3

Stop counter regardless of sampling

CNTS_STOP_CNT_WITH_SAMP

4

Stop counter when sampling stops

CountChNum [C: short] [Python: ctypes.c_short]
Set the number of channels to count when sampling. This function is used to set the counter stop 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: 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_STOP_TRG

21008

The stop condition is out of range.

CNT_ERR_SYS_COUNT_STOP_MODE

21012

The count stop condition is out of range.

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

Initial Value

Uses Software Stop, Stop counter when sampling stops and Maximum channels

Remarks

Must set the stop condition in order to make the application operation regular. This function should be executed in the setting stage before sampling starts. The count of sampling stop is specified by function CntSetSamplingStopNumber when Stop Transfer by Specified Times is used.

Example

C

Ret = CntSetSamplingStopTrigger (Id, CNTS_STOP_SOFT, CNTS_STOP_CNT_WITH_SAMP, 2);
 

Python

ccnt.Ret = ccnt.CntSetSamplingStopTrigger (Id, ccnt.CNTS_STOP_SOFT, ccnt.CNTS_STOP_CNT_WITH_SAMP, 2)
 

See Also

CntSetSamplingStartTrigger CntSetSamplingClockTrigger CntSetSamplingStopNumber