CntGetChannelSignal


Function

Retrieves the external signal source (TTL/Photocoupler/Differential). Supports multi-processing.

Format

Ret = CntGetChannelSignal ( Id , ChNo , SigType )

Parameters

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

ChNo [ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short ]
Specify the channel number for retrieving.

SigType [ VB.NET: Short ] [ C, C++: short * ] [ C#: out short ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specify the address of the variable that stores the retrieved external signal source. External signal source is returned in the following Definition Value.

Definition

Value

Description

CNT_SIGTYPE_ISOLATE

0

Photocoupler

CNT_SIGTYPE_TTL

1

TTL

CNT_SIGTYPE_LINERECEIVER

2

Differential

In the case of CNT-3204IN-USB, CNT_SIGTYPE_ISOLATE (photocoupler isolation) is returned regardless of the value selected by CntSelectChannelSignal.

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_DLL_BUFF_ADDRESS

10101

Invalid data buffer address.

CNT_ERR_SYS_BOARD_EXECUTING

20002

Cannot use while by another device works.

CNT_ERR_SYS_CH_NO

20201

Channel number is out of range.

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

Initial Value

USB device, CPSN-CNT-3201I: Photocoupler
Other device :TTL

Remarks

Retrieves the external signal source of specified channel.

Example

Retrieves the external signal source of channel 0.

VB.NET

Dim Ret As Integer
Dim SigType As Short
Ret = CntGetChannelSignal ( Id , 0 , SigType )
 

C, C++

long Ret;
short SigType;
Ret = CntGetChannelSignal ( Id , 0 , &SigType );
 

C#

int Ret;
short SigType;
Ret = cnt.GetChannelSignal ( Id , 0 , out SigType );
 

Python

Ret = ctypes.c_long()
SigType = ctypes.c_short()
Ret.value = ccnt.CntGetChannelSignal ( Id , 0 , ctypes.byref(SigType) )
 

See Also

CntSelectChannelSignal