Function
Sets I/O direction of the specified device.
Format
Ret = DioDmSetDirection ( Id , Direction )
Parameters
Id
[C: short] [Python: ctypes.c_short]
Specify the device ID retrieved from DioInit.
Direction
[C: unsigned long] [Python: ctypes.c_ulong]
Specify 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. |
DIO_ERR_SYS_DIRECTION |
50000 |
I/O direction is outside of the setting range. |
The other errors: (See also: Error code details)
Initial Value
Initial value of I/O direction is PI_32.
Remarks
It is necessary to use this function to make the application operation regular.
Example
C |
Ret = DioDmSetDirection(
Id , PI_32 ); |
Python |
Ret = cdio.DioDmSetDirection(
Id , cdio.PI_32 ) |
See Also