Sets I/O direction of I/O ports.
Ret = DioSetIoDirection ( Id , Dir )
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the device ID retrieved from DioInit.
Dir [
VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long
]
The I/O direction is specified in port units. *1
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
|
|
|
|
|
Port2 |
Port1 |
Port0 |
|
|
|
|
|
|
|
0: Input |
|
|
|
|
|
|
|
1: Output |
Available range: 0 <= Dir <= (the number of ports supported by a device) power 2 - 1
Bit = 0: Input
Bit = 1: Output
*1 In principle, one port is 8 bits, but devices with less than 8 bits treat all bits as port 0.
Ret [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
Definition |
Value [Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal completed. |
DIO_ERR_SYS_RECOVERED_FROM_STANDBY |
7 |
Execute DioResetDevice function because the device has recovered from standby mode. |
DIO_ERR_DLL_INVALID_ID |
10001 |
Invalid ID specified. |
DIO_ERR_SYS_NOT_SUPPORTED |
20001 |
This board couldn't use this function. |
DIO_ERR_SYS_IODIRECTION |
20500 |
Direction value is out of range. |
The others (See also: Details of Error Code)
Please use the DioSet8255Mode function for the board with 8255.
Port 0 is used as output.
VB.NET |
Dim Ret As Integer |
C, C++ |
long Ret; |
C# |
int Ret; |
Python |
Ret = ctypes.c_long() |