CntSetSamplingStopTrigger


Function

Sets the sampling stop conditions.

Format

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

Parameters

Id [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from CntInit.

StopTrg [ VB.NET: Short ] [ C, C++: short ] [ 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_CH4_REG0

9

Count Match Channel 4 Compare Register 0

CNTS_STOP_CNTMATCH_CH5_REG0

10

Count Match Channel 5 Compare Register 0

CNTS_STOP_CNTMATCH_CH6_REG0

11

Count Match Channel 6 Compare Register 0

CNTS_STOP_CNTMATCH_CH7_REG0

12

Count Match Channel 7 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

CNTS_STOP_CNTMATCH_CH4_REG1

17

Count Match Channel 4 Compare Register 1

CNTS_STOP_CNTMATCH_CH5_REG1

18

Count Match Channel 5 Compare Register 1

CNTS_STOP_CNTMATCH_CH6_REG1

19

Count Match Channel 6 Compare Register 1

CNTS_STOP_CNTMATCH_CH7_REG1

20

Count Match Channel 7 Compare Register 1

CNTS_STOP_EXTSIG_1

21

Synchronous Connector EXTSIG1

CNTS_STOP_EXTSIG_2

22

Synchronous Connector EXTSIG2

CNTS_STOP_EXTSIG_3

23

Synchronous Connector EXTSIG3

* Count match cannot be specified to the channel outside the allowable setting range of using device. Synchronous connector signal cannot be specified for the device without Synchronous Connector.

CountStopMode [ VB.NET: Short ] [ C, C++: short ] [ 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 [ VB.NET: Short ] [ C, C++: short ] [ 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 [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]

Definition

Value

Description

CNT_ERR_SUCCESS

0

Normality completion

CNT_ERR_SYS_RECOVERED_FROM_STANDBY

7

Execute the function CntResetDevice to return from the standby mode.

CNT_ERR_DLL_INVALID_ID

10001

Invalid ID was specified.

CNT_ERR_DLL_CALL_DRIVER

10002

CNT driver can't be called (Failed in the device I/O control).

CNT_ERR_SYS_MEMORY

20000

It failed in memory allocation for the object preparation.

CNT_ERR_SYS_NOT_SUPPORTED

20001

This function can't be used by this device.

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 others: (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

Stops sampling of channel 0 and 1 by Software Stop, Counter stops at same time.

VB.NET

Dim Ret As Integer
Ret = CntSetSamplingStopTrigger ( Id , CNTS_STOP_SOFT , CNTS_STOP_CNT_WITH_SAMP , 2 )
 

C, C++

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

C#

int Ret;
Ret = cnt.SetSamplingStopTrigger ( Id , (short)CcntConst.CNTS_STOP_SOFT , (short)CcntConst.CNTS_STOP_CNT_WITH_SAMP , 2 );
 

Python

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

See Also

CntSetSamplingStartTrigger CntSetSamplingClockTrigger CntSetSamplingStopNumber