DioInpBit


Function

Inputs a bit from a input port.

Format

Ret = DioInpBit ( 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.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_BIT_NO

20102

Bit number is outside of the 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

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 DioInpBitSR function when acquiring the real time information of the slave unit.

Example

C

Ret = DioInpBit ( Id , BitNo , &Data );
 

Python

Ret = cdio.DioInpBit ( Id , BitNo , ctypes.byref(Data) )
 

See Also

DioInpByte
DioInpMultiByte
DioInpMultiBit
Logic_Bit