DioGetMaxPorts


Function

Retrieves the number of a device's input and output ports.

Format

Ret = DioGetMaxPorts ( Id , &InPortNum , &OutPortNum )

Parameters

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

InPortNum [ C, C++: short *] [Python: ctypes.POINTER(ctypes.c_short)]
Specifies address of variable to store the number of input ports.

OutPortNum [ C, C++: short *] [Python: ctypes.POINTER(ctypes.c_short)]
Specifies address of variable to store the number of output ports.

Return Value

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

Definition

Value

[Dec]

Description

DIO_ERR_SUCCESS

0

Normal complete

DIO_ERR_DLL_INVALID_ID

10001

Invalid ID is specified.

DIO_ERR_DLL_CALL_DRIVER

10002

Driver cannot be called (failed in ioctl).

DIO_ERR_DLL_BUFF_ADDRESS

10100

Invalid data buffer address.

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

Initial Value

None

Remarks

Retrieves the number of a device's input ports and output ports.

Example

Retrieves the number of a device's I/O ports.

C, C++

long Ret;

short InPortNum;
short OutPortNum;

Ret = DioGetMaxPorts(Id, &InPortNum, &OutPortNum);
 

Python

Ret = ctypes.c_long()
InPortNum = ctypes.c_short()
OutPortNum = ctypes.c_short()

Ret.value = cdio.DioGetMaxPorts(Id, ctypes.byref(InPortNum), ctypes.byref(OutPortNum))
 

See Also

None