Function
Sets 1 bit of data to the input bit of the demo device.
Format
Ret = DioSetDemoBit ( Id , BitNo , Data )
Parameters
Id
[ C: short ] [ Python: ctypes.c_short ]
Specifies the device ID retrieved from DioInit.
BitNo [
C: short ] [ Python: ctypes.c_short ]
Specifies the logical input bit number.
The logical input bit number is a number, which is assigned from the first
input bit of the device as 0 to the last one serially.
Data
[ C: unsigned char ] [ Python: ctypes.c_ubyte ]
Specifies the input data as 0 or 1.
Return Value
Ret [ C: long ] [ Python: ctypes.c_long ]
Definition |
Value [Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal completed. |
DIO_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
DIO_ERR_DLL_CALL_DRIVER |
10002 |
Driver cannot be called (failed in ioctl). |
DIO_ERR_SYS_NOT_SUPPORTED |
20001 |
This function cannot be used for this device. |
DIO_ERR_SYS_BIT_NO |
20102 |
Bit number is outside of the available range. |
DIO_ERR_SYS_BIT_DATA |
20104 |
Bit data is neither 0 nor 1. |
The others (See also: Details of Error Code)
Initial Value
This is dedicated function for demo device.
The initial value of the input data is 0, after the device was reset.
Please call DioInpBit function when you want to confirm Digital Input Value.
Remarks
Sets 1 bit of data to the input bit. Specifies the input data as 0 or 1.
Example
Sets the input data 1 to bit 0.
C |
Ret = DioSetDemoBit
( Id , 0 , 1 ); |
Python |
Ret = cdio.DioSetDemoBit
( Id , 0 , 1 ) |
See Also