10.5. Error notifications
For each error an error ID (error code) will be defined. This error ID will be used as the notification code when emonNotify() is called. In addition to this notification code the second parameter given to emonNotify() contains a pointer to an error notification descriptor of type EC_T_ERROR_NOTIFICATION_DESC. This error notification descriptor contains detailed information about the error.
-
struct EC_T_ERROR_NOTIFICATION_DESC
Public Members
-
EC_T_DWORD dwNotifyErrorCode
Error ID (same value as the notification code)
-
EC_T_CHAR achErrorInfo[MAX_ERRINFO_STRLEN]
Additional error string (may be empty)
-
union _EC_T_ERROR_NOTIFICATION_PARM
Public Members
-
EC_T_WKCERR_DESC WkcErrDesc
WKC error descriptor
-
EC_T_FRAME_RSPERR_DESC FrameRspErrDesc
Frame response error descriptor
-
EC_T_SLAVE_ERROR_INFO_DESC SlaveErrInfoDesc
Slave Error Info Descriptor
-
EC_T_MBOX_FOE_ABORT_DESC FoeErrorDesc
FoE error code and string
-
EC_T_PDIWATCHDOG_DESC PdiWatchdogDesc
PDI watchdog expired
-
EC_T_COMMUNICATION_TIMEOUT_NTFY_DESC CommunicationTimeoutDesc
Communication timeout descriptor
-
EC_T_TAP_LINK_STATUS_NTFY_DESC TapLinkStatusDesc
Tap link status
-
EC_T_WKCERR_DESC WkcErrDesc
-
EC_T_DWORD dwNotifyErrorCode
If the pointer to this descriptor exists the detailed error information (e.g. information about the SubDevice) is stored in the appropriate structure of a union. These error information structures are described in the following sections.
10.5.1. emonNotify - EC_NOTIFY_NOT_ALL_DEVICES_OPERATIONAL
When processing cyclic frames the EtherCAT® MainDevice checks whether all SubDevices are still in OPERATIONAL state. If at least one SubDevice is not OPERATIONAL this error will be indicated.
10.5.2. emonNotify - EC_NOTIFY_ALL_DEVICES_OPERATIONAL
When processing cyclic frames the EtherCAT® MainDevice checks whether all SubDevices are still in OPERATIONAL state. This will be notified after emonNotify - EC_NOTIFY_NOT_ALL_DEVICES_OPERATIONAL and all the SubDevices are back in OPERATIONAL state.
10.5.3. emonNotify - EC_NOTIFY_CLIENTREGISTRATION_DROPPED
This notification will be indicated if the client registration was dropped because emonConfigureNetwork() was called by another thread.
EC_T_DWORD dwDeinitForConfiguration; /* 0 = terminating MainDevice, 1 = restarting MainDevice */
10.5.4. emonNotify - EC_NOTIFY_CYCCMD_WKC_ERROR
To update the process data some EtherCAT® commands will be sent cyclically by the external MainDevice. These commands will address one or multiple SubDevices. These EtherCAT® commands contain a working counter which has to be incremented by each SubDevice that is addressed. The working counter will be checked after the EtherCAT® command is received by the monitor.
If the expected working counter will not match the working counter of the received command the error EC_NOTIFY_CYCCMD_WKC_ERROR will be indicated. The working counter value expected by the monitor is determined by the EtherCAT® configuration (XML) file for each cyclic EtherCAT® command (section Config/Cyclic/Frame/Cmd/Cnt).
Detailed error information are stored in structure EC_T_WKCERR_DESC of EC_T_ERROR_NOTIFICATION_DESC.
-
struct EC_T_WKCERR_DESC
Public Members
-
EC_T_SLAVE_PROP SlaveProp
Slave properties, content is undefined in case of cyclic WKC_ERROR
-
EC_T_BYTE byCmd
EtherCAT command type
-
EC_T_DWORD dwAddr
Logical address or physical address (ADP/ADO)
-
EC_T_WORD wWkcSet
Working counter set value
-
EC_T_WORD wWkcAct
Working counter actual value
-
EC_T_DWORD dwTaskId
Cyclic Task ID (ENI: Cyclic/TaskId)
-
EC_T_WORD wMsuId
Master Sync Unit ID (ENI: Slave/ProcessData/RxPdo[1..4]@Su, Slave/ProcessData/TxPdo[1..4]@Su, comment at Cyclic/Frame/Cmd)
-
EC_T_SLAVE_PROP SlaveProp
-
struct EC_T_SLAVE_PROP
-
EC_T_WORD wStationAddress
-
EC_T_WORD wAutoIncAddr
-
EC_T_CHAR achName[MAX_STD_STRLEN]
-
EC_T_WORD wStationAddress
10.5.5. emonNotify - EC_NOTIFY_FRAME_RESPONSE_ERROR
This notification will be indicated if the actually received Ethernet frame does not match the expected frame or if an expected frame was not received.
-
struct EC_T_FRAME_RSPERR_DESC
Public Members
-
EC_T_BOOL bIsCyclicFrame
Indicates whether the lost frame was a cyclic frame
-
EC_T_FRAME_RSPERR_TYPE EErrorType
Frame response error type
-
EC_T_BYTE byEcCmdHeaderIdxSet
Expected IDX value, this value is valid only for acyclic frames in case EErrorType is not equal to eRspErr_UNEXPECTED
-
EC_T_BYTE byEcCmdHeaderIdxAct
Actually received IDX value, this value is only valid for acyclic frames in case of EErrorType is equal to: eRspErr_WRONG_IDX and eRspErr_UNEXPECTED
-
EC_T_WORD wCycFrameNum
Number of the lost cyclic frame from the ENI
-
EC_T_DWORD dwTaskId
Cyclic Task ID (ENI: Cyclic/TaskId). Only valid if bIsCyclicFrame is set
-
EC_T_BOOL bIsCyclicFrame
10.5.6. emonNotify - EC_NOTIFY_STATUS_SLAVE_ERROR
When processing cyclic frames, the EC-Monitor checks whether the ERROR bit in the AL-STATUS register is set for at least one SubDevice. In this case, this notification is triggered. If the EtherCAT® MainDevice determines the error information of the SubDevice(s) signal an error, another notification emonNotify - EC_NOTIFY_SLAVE_ERROR_STATUS_INFO with more precise error information is triggered.
10.5.7. emonNotify - EC_NOTIFY_SLAVE_ERROR_STATUS_INFO
This notification will be indicated if the EtherCAT® MainDevice reads the AL-STATUS and AL-STATUS-CODE registers and the SubDevice signals an error in them. Detailed error information is stored in structure EC_T_SLAVE_ERROR_INFO_DESC of EC_T_ERROR_NOTIFICATION_DESC.
-
struct EC_T_SLAVE_ERROR_INFO_DESC
Public Members
-
EC_T_SLAVE_PROP SlaveProp
Slave properties
-
EC_T_WORD wStatus
Slave Status (AL Status)
-
EC_T_WORD wStatusCode
Error status code (AL STATUS CODE)
-
EC_T_SLAVE_PROP SlaveProp
10.5.8. emonNotify - EC_NOTIFY_PDIWATCHDOG
This notification will be indicated every time a PDI watchdog error is detected. Detailed error information is stored in structure EC_T_PDIWATCHDOG_DESC of EC_T_ERROR_NOTIFICATION_DESC.
-
struct EC_T_PDIWATCHDOG_DESC
Public Members
-
EC_T_SLAVE_PROP SlaveProp
Slave properties
-
EC_T_SLAVE_PROP SlaveProp
10.5.9. emonNotify - EC_NOTIFY_COMMUNICATION_TIMEOUT
This notification will be indicated if the EC-Monitor does not detect any EtherCAT® communication on the Ethernet tap for a parameterizable timeout. The descriptor of the notification contains information on which port of the Ethernet tap the timeout occurred.
10.5.10. emonNotify - EC_NOTIFY_TAP_LINK_STATUS
This notification will be indicated if the link status between EC-Monitor and Ethernet TAP device has changed.
-
struct EC_T_TAP_LINK_STATUS_NTFY_DESC
Public Members
-
EC_T_BOOL bLinkConnected
Link status of EC-Monitor - Ethernet Tap connection
-
EC_T_BOOL bLinkConnected