DioGetIoDirection


Function

Retrieves I/O direction of I/O ports.

Format

Ret = DioGetIoDirection ( Id , Dir )

Parameters

Id [ C: short ] [ Python: ctypes.c_short ]
Specify the device ID retrieved from DioInit.

Dir [ C: long * ] [ Python: ctypes.POINTER(ctypes.c_long) ]
Specify the address of the variable to store the I/O direction.

D7

D6

D5

D4

D3

D2

D1

D0

-

-

-

-

-

Port2

Port1

Port0

0: Input
1: Output

Return Value

Ret [ C: long ] [ Python: ctypes.c_long ]

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal complete

DIO_ERR_DLL_CALL_DRIVER

10001

Driver cannot be called (failed in ioctl).

DIO_ERR_DLL_INVALID_ID

10002

Invalid ID is specified.

DIO_ERR_SYS_NOT_SUPPORTED

20001

This function cannot be used for this device.

The other errors: (See also: Error code details)

Remarks

Please use the DioGet8255Mode function for the board with 8255.

Example

C

Ret = DioGetIoDirection ( Id , &Data );
 

Python

Ret = cdio.DioGetIoDirection ( Id , ctypes.byref(Data) )
 

See Also

DioSetIoDirection