Function
This function retrieves the communication status of an Ethernet device. Supports multi-processing.
Format
Ret = DioGetNetCommunicationInfo ( Id , InfoType , InfoData )
Parameters
Id
[ C: short ] [ Python: ctypes.c_short ]
Specifies the device ID retrieved from DioInit.
InfoType
[ C: short ] [ Python: ctypes.c_short ]
Specify the type of the information to be retrieved. The information type
is one of the following defined values.
Definition |
Value [Dec] |
Description |
IDIO_NET_TYPE_REGISTER_PROCESS |
0 |
Process registration status |
InfoData
[ C: long * ] [ Python: ctypes.POINTER(ctypes.c_long) ]
Specify the address of the variable that stores the retrieved information.
Return Value
Ret [ C: long ] [ Python: ctypes.c_long ]
Definition |
Value |
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_INFO_INVALID_INFOTYPE |
10052 |
Information type is invalid. |
DIO_ERR_SYS_NOT_SUPPORTED |
20001 |
This function can't be used by this device. |
The other errors: (See also: Details of Error Code)
Remarks
This function retrieves the communication
status of an Ethernet device.
The information that can be retrieved based on the specified information
type is listed below.
Process registration status
You can check whether the process that executed the function is registered on the device as an event notification destination.
Definition |
Value [Dec] |
Description |
DIO_IVALUE_PROCESS_UNREGISTERED |
0 |
Unregistered |
DIO_IVALUE_PROCESS_REGISTERED |
1 |
Registered |
If the process is unregistered, the event
will no longer be notified.
If you want to perform event notification again, please run the event notification
settings again.
Example
C |
Ret
= DioGetNetCommunicationInfo(Id, IDIO_NET_TYPE_REGISTER_PROCESS,
&InfoData); |
Python |
Ret
= cdio.DioGetNetCommunicationInfo(Id, cdio.IDIO_NET_TYPE_REGISTER_PROCESS,
ctypes.byref(InfoData)) |
See Also
DioSetInterruptEvent DioSetTrgEvent