DioGetIoDirection


Function

Retrieves I/O direction of I/O ports.

Format

Ret = DioGetIoDirection ( Id , Dir )

Parameters

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#: out int ] [ Python: ctypes.POINTER(ctypes.c_long) ]
Specify the address of the variable to store the I/O direction.

Bit = 0: Input
Bit = 1: Output

Return Value

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

20500

Direction value is out of range.

The others (See also: Details of Error Code)

Remarks

Please use the DioGet8255Mode function for the board with 8255.

Example

Retrieves the I/O direction being set.

VB.NET

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

C, C++

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

C#

int Ret;
int Dir;
Ret = dio.GetIoDirection ( Id , out Dir );
 

Python

Ret = ctypes.c_long()
Dir = ctypes.c_long()
Ret.value = cdio.DioGetIoDirection ( Id , ctypes.byref(Dir) )
 

See Also

DioSetIoDirection