Sets I/O direction of digital I/O ports.
Ret = AioSetDioDirection ( Id , Dir )
Id [ C, C++ : short ] [ Python : ctypes.c_short ]
Specifies the ID retrieved from AioInit.
Dir [ C, C++: long ] [ Python: ctypes.c_long ]
Specifies the I/O direction of each port.
Dir |
Port1 (DIO08 to DIO15) |
Port0 (DIO00 to DIO07) |
0x00 |
Digital Input |
Digital Input |
0x01 |
Digital Input |
Digital Output |
0x02 |
Digital Output |
Digital Input |
0x03 |
Digital Output |
Digital Output |
Return values
Ret [ C, C++ : long ] [ Python: ctypes.c_long ]
Return values |
Content |
0 |
Normality completion |
7 |
Execute AioResetDevice function because the device has recovered from standby mode |
10001 |
Invalid Id was specified |
10002 |
AIO driver can't be called |
14040 |
The value of Dir is outside the designated range of the function |
20001 |
This function can't be used by this device |
24060 |
The value of Dir is outside the designated range of the device being used |
Each port can be set to digital input or digital output.
Before switching the digital I/O direction, make sure that there are no problems with the cable connections.
For example, switching to a digital output while a cable is still connected to the output device can cause voltage level differences and damage.
AIO-163202G-PE |
Initial value is Dir = 0 (Port0 and Port1 are both Input)
* This function cannot be executed if the [E-series settings] jumper on the device is [Use as E-series compatible]. DIO00 - DIO07 are fixed as Input, and DIO08-DIO15 are fixed as output. |
AIO-121602LN-USB |
Initial value is Dir = 0 (Port0 and Port1 are both Input) |
Devices other than the above |
This function cannot be executed. |
Port 0 is used as output.
C, C++ |
long Ret; |
Python |
Ret = ctypes.c_long() |