AioGetDioDirection


Function

Retrieves I/O direction of digital I/O ports.

Format

Ret = AioGetDioDirection ( Id , Dir )

Parameters

Id [ VB.NET : Short ] [ C, C++ : short ] [ C# : short ] [ Python : ctypes.c_short ]
Specifies the device ID retrieved from AioInit.

Dir [ VB.NET : Integer ] [ C, C++ : long * ] [ C# : out int ] [ Python : ctypes.POINTER(ctypes.c_long) ]
Specifies the address of the variable to store the I/O direction.

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 value

Ret [ VB.NET : Integer ] [ C, C++ : long ] [ C# : int ] [ 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
Use the Id retrieved from AioInit to specify the Id in this function.

10002

AIO driver can't be called
At first, perform AioInit function.

14051

Pointer to Dir is NULL.

20001

This function can't be used by this device

Remarks

The set I/O status of each port can be retrieved.

Specifications based on devices

AIO-163202G-PE
AIO-163202UG-PE
AIO-123202G-PE
AIO-123202UG-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].

AIO-121602LN-USB
AIO-120802LN-USB

Initial value is Dir = 0 (Port0 and Port1 are both Input)

Devices other than the above

This function cannot be executed.

Example

Retrieves the digital I/O direction being set.

VB.NET

Dim Ret As Integer
Dim Dir As Integer
Ret = AioGetDioDirection ( Id , Dir )
 

C, C++

long Ret;
long Dir;
Ret = AioGetDioDirection ( Id , &Dir );
 

C#

int Ret;
int Dir;
Ret = aio.AioGetDioDirection ( Id , out Dir );
 

Python

Ret = ctypes.c_long()
Dir = ctypes.c_long()
Ret.value = caio.AioGetDioDirection ( Id , ctypes.byref(Dir) )
 

See also

AioSetDioDirection