CntSetMaster


Function

Sets the master mode.

Format

Ret = CntSetMaster ( Id , ExtSig1 , ExtSig2 , ExtSig3 , MasterHalt , SlaveHalt )

Parameters

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

ExtSig1 , ExtSig2 , ExtSig3 [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the signal output to the signal line from ExtSig1 to ExtSig3.

Definition

Value

Description

CNTS_EXT_NOTUSE

0

Not used

CNTS_EXT_START_SOFT

1

Software start

CNTS_EXT_STOP_SOFT

2

Software stop

CNTS_EXT_CLOCK

3

Internal clock

CNTS_EXT_EXT_TRG

4

External clock

CNTS_EXT_START_EXT_RISE

5

External start rising

CNTS_EXT_START_EXT_FALL

6

External start falling

CNTS_EXT_STOP_EXT_RISE

7

External stop rising

CNTS_EXT_STOP_EXT_FALL

8

External stop falling

CNTS_EXT_CLOCK_ERROR

9

Sampling clock error

CNTS_EXT_TRNSNUM

10

Specified sampling times stored

CNTS_EXT_CNTMATCH_CH0_REG0

11

Count match CH0:REG0

CNTS_EXT_CNTMATCH_CH1_REG0

12

Count match CH1:REG0

CNTS_EXT_CNTMATCH_CH2_REG0

13

Count match CH2:REG0

CNTS_EXT_CNTMATCH_CH3_REG0

14

Count match CH3:REG0

CNTS_EXT_CNTMATCH_CH4_REG0

15

Count match CH4:REG0

CNTS_EXT_CNTMATCH_CH5_REG0

16

Count match CH5:REG0

CNTS_EXT_CNTMATCH_CH6_REG0

17

Count match CH6:REG0

CNTS_EXT_CNTMATCH_CH7_REG0

18

Count match CH7:REG0

CNTS_EXT_CNTMATCH_CH0_REG1

19

Count match CH0:REG1

CNTS_EXT_CNTMATCH_CH1_REG1

20

Count match CH1:REG1

CNTS_EXT_CNTMATCH_CH2_REG1

21

Count match CH2:REG1

CNTS_EXT_CNTMATCH_CH3_REG1

22

Count match CH3:REG1

CNTS_EXT_CNTMATCH_CH4_REG1

23

Count match CH4:REG1

CNTS_EXT_CNTMATCH_CH5_REG1

24

Count match CH5:REG1

CNTS_EXT_CNTMATCH_CH6_REG1

25

Count match CH6:REG1

CNTS_EXT_CNTMATCH_CH7_REG1

26

Count match CH7:REG1

* The count match of the channel that doesn't exist in the used device cannot be specified.

MasterHalt [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify 1.

SlaveHalt [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify 1.

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_SIGNAL

21003

The available signal is out of range.

The others: (See also: Details of Error Code)

Initial Value

The default is Stand-alone among Stand-alone/Master/Slave.

Remarks

Must set one of Stand-alone/Master/Slave in order to make the application operation regular. The master mode is a mode that outputs the signal to a synchronous connector (SC connector). This function should be executed in the setting stage before sampling starts.

Example

Sets the master mode.

VB.NET

Dim Ret As Integer
Ret = CntSetMaster ( Id, CNTS_EXT_CLOCK, CNTS_EXT_START_SOFT, CNTS_EXT_STOP_SOFT, 1, 1 )
 

C, C++

long Ret;
Ret = CntSetMaster ( Id, CNTS_EXT_CLOCK, CNTS_EXT_START_SOFT, CNTS_EXT_STOP_SOFT, 1, 1 );
 

C#

int Ret;
Ret = cnt.SetMaster ( Id, CNTS_EXT_CLOCK, CNTS_EXT_START_SOFT, CNTS_EXT_STOP_SOFT, 1, 1 );
 

Python

Ret = ctypes.c_long()
Ret.value = ccnt.CntSetMaster ( Id, ccnt.CNTS_EXT_CLOCK, ccnt.CNTS_EXT_START_SOFT, ccnt.CNTS_EXT_STOP_SOFT, 1, 1 )
 

See Also

CntSetStandAlone CntSetSlave