Function
Inputs a byte (8 bits) from an input port.
Format
Ret = DioInpByte ( Id , PortNo , &Data )
Parameters
Id
[C:short] [Python: ctypes.c_short]
Specifies the device ID retrieved from DioInit.
PortNo [C:short]
[Python: ctypes.c_short]
Specifies the logical input port number. The logical input port number
is a number, which is assigned from the first input port of the device
as 0 to the last one serially.
Data [C:unsigned
char *] [Python: ctypes.POINTER(ctypes.c_ubyte)]
Specifies the address of variable to store the input datum.
Return Value
Ret [C:long] [Python: ctypes.c_long]
Definition |
Value [Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal complete |
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_DLL_BUFF_ADDRESS |
10100 |
Invalid data buffer address. |
DIO_ERR_SYS_NOT_SUPPORTED |
20001 |
This function cannot be used for this device. |
DIO_ERR_SYS_PORT_NO |
20100 |
Port number is outside of the specified available range. |
The other errors: (See also: Error code details)
Initial Value
The initial value of the input datum is 0, if no external device is connected.
Remarks
Inputs a byte (8 bits) from the input port. When getting the necessary information of the bit, please use the bit operators of each language.
In the case of a wireless I/O device, it
acquires the data of the slave unit stored in the master unit.
Please note that it is not real time information of the slave unit.
Please use the DioInpByteSR function when
acquiring the real time information of the slave unit.
Example
C |
Ret = DioInpByte (
Id , PortNo , &Data ); |
Python |
Ret = cdio.DioInpByte
( Id , PortNo , ctypes.byref(Data) ) |
See Also
DioInpBit
DioInpMultiByte
DioInpMultiBit
Logic_Bit