Function
Gets the external signal source. (TTL/Photocoupler/Differential)
Format
Ret = CntGetChannelSignal ( Id , ChNo , SigType )
Parameters
Id
[ C, C++ : short ] [ Python: ctypes.c_short ]
Specifies the device ID retrieved from CntInit.
ChNo
[ C, C++ : short ] [ Python: ctypes.c_short ]
Specifies the channel number which you want to get for.
SigType
[ C, C++ : short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
Specifies the address of the variable that stores the external signal source.
As for the external signal source, one of the following defined values
is returned.
Definition |
Value |
Description |
CNT_SIGTYPE_ISOLATE |
0 |
Photocoupler insulation |
CNT_SIGTYPE_TTL |
1 |
TTL |
CNT_SIGTYPE_LINERECEIVER |
2 |
Differential |
In the case of CNT-3204IN-USB, CNT_SIGTYPE_ISOLATE (Photocoupler insulation) is returned regardless of the value selected by CntSelectChannelSignal.
Return Value
Ret [ C, 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_CH_NO |
20201 |
Channel number is outside the range. |
The other errors: (See also: Details of Error Code)
Initial Value
CNT24-4(PCI)H : Photocoupler insulation
CNT24-4D(PCI)H : Differential
CNT-3204MT-LPE, CNT32-4MT(LPCI), CNT-3208M-PE, CNT32-8M(PCI) : TTL
CNT-3204IN-ETH, CNT-3204IN-USB : Photocoupler insulation
CPI-CNT-3201I, CPS-CNT-3202I, CPSN-CNT-3201I, CPSN-CNT-3201I2 : Photocoupler insulation
Remarks
Gets the external signal source for the specified channel.
Example
C, C++ |
Ret
= CntGetChannelSignal(Id, ChNo, &SigType); |
Python |
Ret
= ccnt.CntGetChannelSignal(Id, ChNo, ctypes.byref(SigType)) |
See Also