Function
Read the general input. Supports multi-processing.
Format
Ret = CntInputDIByte ( Id , Reserved , bData )
Parameters
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the device ID retrieved from CntInit.
Reserved
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify 0.
bData
[ VB.NET: Byte ] [ C, C++: BYTE * ] [ C#: out byte ] [ Python: ctypes.POINTER(ctypes.c_ubyte)
]
Specify the address of the variable that stores the general-purpose input
data.
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_MODE |
10100 |
Invalid mode setting. |
CNT_ERR_DLL_BUFF_ADDRESS |
10101 |
Invalid data buffer address. |
CNT_ERR_SYS_BOARD_EXECUTING |
20002 |
Cannot use while by another device works. |
The others: (See also: Details of Error Code)
Initial Value
None
Remarks
Read the general input.
This function can retrieve
the general-purpose input of all channels on the device.
The status function CntReadStatus can all
retrieve the general-purpose input, but this function can conveniently
read out all 8-bit general input.
It is necessary to be starting the counter operation, if you want to read the general-purpose input by the device without sampling function.
You can always read the general-purpose input even if you set other than the general-purpose by CntSetInputHardwareEvent.
Example
Read the general input.
VB.NET |
Dim Ret As Integer |
C, C++ |
long Ret; |
C# |
int Ret; |
Python |
Ret = ctypes.c_long() |
See Also
CntReadStatus CntSetInputHardwareEvent