Function
Retrieves the information of device.
Format
Ret = DioGetDeviceInfo ( Device , InfoType , Param1 , Param2 , Param3 )
Parameters
Device
[C:char*] [Python: ctypes.c_char_p]
Specifies the device name. (For example: PIO-32/32L(PCI)H)
InfoType
[C:short] [Python: ctypes.c_short]
Specifies the type of retrieved information. Select the type of information
as the following define value.
Definition |
Value [Dec] |
Description |
Parameter |
IDIO_DEVICE_TYPE |
0 |
Device type |
Param1(short) |
IDIO_NUMBER_OF_8255 |
1 |
Number of 8255 chips |
Param1(int) |
IDIO_IS_8255_BOARD |
2 |
8255 chip present/absent |
Param1(int) |
IDIO_NUMBER_OF_DI_BIT |
3 |
Number of input bits |
Param1(short) |
IDIO_NUMBER_OF_DO_BIT |
4 |
Number of output bits |
Param1(short) |
IDIO_NUMBER_OF_DI_PORT |
5 |
Number of input ports |
Param1(short) |
IDIO_NUMBER_OF_DO_PORT |
6 |
Number of output ports |
Param1(short) |
IDIO_IS_POSITIVE_LOGIC |
7 |
Is it positive logic |
Param1(int) |
IDIO_IS_ECHO_BACK |
8 |
Echo back is available |
Param1(int) |
IDIO_IS_DIRECTION |
9 |
DioSetIoDirection function can be used |
Param1(int) |
IDIO_IS_FILTER |
10 |
Digital filter can be used |
Param1(int) |
IDIO_NUMBER_OF_INT_BIT |
11 |
The number of available interrupt bits |
Param1(short) |
Param1, Param2, Param3 [C:void *] [Python: ctypes.c_void_p]
Specifies parameters that match with the type of information in address.
Please specify NULL for those unnecessary item.
Return Value
Ret [C:long] [Python: ctypes.c_long]
Definition |
Value [Dec] |
Description |
DIO_ERR_SUCCESS |
0 |
Normal complete |
DIO_ERR_INFO_INVALID_DEVICE |
10050 |
Specified device name isn't found. |
DIO_ERR_INFO_NOT_FIND_DEVICE |
10051 |
The usable device isn't found. |
DIO_ERR_INFO_INVALID_INFOTYPE |
10052 |
The specified device information type is outside the range. |
The other errors: (See also: Error code details)
Initial Value
None
Remarks
Retrieve the information of device.
Example
C |
Ret = DioGetDeviceInfo(
"PIO-32/32L(PCI)H", IDIO_NUMBER_OF_DI_PORT, &InpPortNum,
NULL, NULL ); |
Python |
Ret = cdio.DioGetDeviceInfo(
"PIO-32/32L(PCI)H", cdio.IDIO_NUMBER_OF_DI_PORT, ctypes.byref(InpPortNum),
0, 0 ) |
See Also
None