Function
Retrieves I/O direction of the specified device.
Format
Ret = DioDmGetDirection ( Id , Direction )
Parameters
Id
[C: short] [Python: ctypes.c_short]
Specify the device ID retrieved from DioInit.
Direction
[C: unsigned long *] [Python: ctypes.POINTER(ctypes.c_ulong)]
Specify the address of the variable to store the I/O direction.
Definition |
Value [Dec] |
Description |
PI_32 |
1 |
32-bit input |
PO_32 |
2 |
32-bit output |
PIO_1616 |
3 |
16-bit input,16-bit output |
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_SYS_NOT_SUPPORTED |
20001 |
This function cannot be used for this device. |
The other errors: (See also: Error code details)
Initial Value
Initial value of I/O direction is PI_32.
Example
C |
Ret = DioDmGetDirection( Id , &Direction ); |
Python |
Ret = cdio.DioDmGetDirection( Id , ctypes.byref(Direction) ) |
See Also