CntSetSamplingStartTrigger


Function

Sets the sampling start conditions.

Format

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

Parameters

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

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

8

Count Match Channel 4 Compare Register 0

CNTS_START_CNTMATCH_CH5_REG0

9

Count Match Channel 5 Compare Register 0

CNTS_START_CNTMATCH_CH6_REG0

10

Count Match Channel 6 Compare Register 0

CNTS_START_CNTMATCH_CH7_REG0

11

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

CNTS_START_CNTMATCH_CH4_REG1

16

Count Match Channel 4 Compare Register 1

CNTS_START_CNTMATCH_CH5_REG1

17

Count Match Channel 5 Compare Register 1

CNTS_START_CNTMATCH_CH6_REG1

18

Count Match Channel 6 Compare Register 1

CNTS_START_CNTMATCH_CH7_REG1

19

Count Match Channel 7 Compare Register 1

CNTS_START_EXTSIG_1

20

Synchronous Connector EXTSIG1

CNTS_START_EXTSIG_2

21

Synchronous Connector EXTSIG2

CNTS_START_EXTSIG_3

22

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.

CountStartMode [ VB.NET: Short ] [ C, C++: short ] [ 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 [ 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 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 [ 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_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 others: (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

Starts sampling of channel 0 and 1 by Software Start. Counter starts at same time.

VB.NET

Dim Ret As Integer
Ret = CntSetSamplingStartTrigger ( Id , CNTS_START_SOFT , CNTS_START_CNT_WITH_SAMP , 2 )
 

C, C++

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

C#

int Ret;
Ret = cnt.SetSamplingStartTrigger ( Id , (short)CcntConst.CNTS_START_SOFT , (short)CcntConst.CNTS_START_CNT_WITH_SAMP , 2 );
 

Python

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

See Also

CntSetSamplingClockTrigger CntSetSamplingStopTrigger