# 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`](#_CPPv428EC_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](api.html.md#_CPPv410EC_T_DWORD) dwNotifyErrorCode Error ID (same value as the notification code) ### [EC_T_CHAR](api.html.md#_CPPv49EC_T_CHAR) achErrorInfo[MAX_ERRINFO_STRLEN] Additional error string (may be empty) ### union \_EC_T_ERROR_NOTIFICATION_PARM ### Public Members ### [EC_T_WKCERR_DESC](#_CPPv416EC_T_WKCERR_DESC) WkcErrDesc WKC error descriptor ### [EC_T_FRAME_RSPERR_DESC](#_CPPv422EC_T_FRAME_RSPERR_DESC) FrameRspErrDesc Frame response error descriptor ### EC_T_INITCMD_ERR_DESC InitCmdErrDesc Master/Slave init command error descriptor ### [EC_T_SLAVE_ERROR_INFO_DESC](#_CPPv426EC_T_SLAVE_ERROR_INFO_DESC) SlaveErrInfoDesc Slave Error Info Descriptor ### EC_T_SLAVES_ERROR_DESC SlavesErrDesc Slaves Error Descriptor ### EC_T_MBOX_SDO_ABORT_DESC SdoAbortDesc SDO Abort ### EC_T_RED_CHANGE_DESC RedChangeDesc Redundancy Descriptor ### [EC_T_MBOX_FOE_ABORT_DESC](api_mbx_foe.html.md#_CPPv424EC_T_MBOX_FOE_ABORT_DESC) FoeErrorDesc FoE error code and string ### EC_T_MBXRCV_INVALID_DATA_DESC MbxRcvInvalidDataDesc Invalid mailbox data received descriptor ### [EC_T_PDIWATCHDOG_DESC](#_CPPv421EC_T_PDIWATCHDOG_DESC) PdiWatchdogDesc PDI watchdog expired ### EC_T_SLAVE_NOTSUPPORTED_DESC SlaveNotSupportedDesc Slave not supported ### EC_T_SLAVE_UNEXPECTED_STATE_DESC SlaveUnexpectedStateDesc Slave in unexpected state ### EC_T_SLAVES_UNEXPECTED_STATE_DESC SlavesUnexpectedStateDesc Slaves in unexpected state ### EC_T_EEPROM_CHECKSUM_ERROR_DESC EEPROMChecksumErrorDesc EEPROM checksum error ### EC_T_JUNCTION_RED_CHANGE_DESC JunctionRedChangeDesc Junction redundancy change descriptor ### EC_T_FRAMELOSS_AFTER_SLAVE_NTFY_DESC FramelossAfterSlaveDesc Frameloss after Slave descriptor ### EC_T_S2SMBX_ERROR_DESC S2SMbxErrorDesc S2S Mailbox Error descriptor ### EC_T_BAD_CONNECTION_NTFY_DESC BadConnectionDesc Bad connection descriptor ### [EC_T_COMMUNICATION_TIMEOUT_NTFY_DESC](#_CPPv436EC_T_COMMUNICATION_TIMEOUT_NTFY_DESC) CommunicationTimeoutDesc Communication timeout descriptor ### [EC_T_TAP_LINK_STATUS_NTFY_DESC](#_CPPv430EC_T_TAP_LINK_STATUS_NTFY_DESC) TapLinkStatusDesc Tap link status 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. ## 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. ## 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](#emonnotify-ec-notify-not-all-devices-operational) and all the SubDevices are back in OPERATIONAL state. ## emonNotify - EC_NOTIFY_CLIENTREGISTRATION_DROPPED This notification will be indicated if the client registration was dropped because [`emonConfigureNetwork()`](api_general.html.md#_CPPv420emonConfigureNetwork10EC_T_DWORD13EC_T_CNF_TYPE10EC_T_PBYTE10EC_T_DWORD) was called by another thread. ```cpp EC_T_DWORD dwDeinitForConfiguration; /* 0 = terminating MainDevice, 1 = restarting MainDevice */ ``` ## 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`](#_CPPv416EC_T_WKCERR_DESC) of [`EC_T_ERROR_NOTIFICATION_DESC`](#_CPPv428EC_T_ERROR_NOTIFICATION_DESC). ### struct EC_T_WKCERR_DESC ### Public Members ### [EC_T_SLAVE_PROP](api_slave.html.md#_CPPv415EC_T_SLAVE_PROP) SlaveProp Slave properties, content is undefined in case of cyclic WKC_ERROR ### [EC_T_BYTE](api.html.md#_CPPv49EC_T_BYTE) byCmd EtherCAT command type ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwAddr Logical address or physical address (ADP/ADO) ### [EC_T_WORD](api.html.md#_CPPv49EC_T_WORD) wWkcSet Working counter set value ### [EC_T_WORD](api.html.md#_CPPv49EC_T_WORD) wWkcAct Working counter actual value ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwTaskId Cyclic Task ID (ENI: Cyclic/TaskId) ### [EC_T_WORD](api.html.md#_CPPv49EC_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) ### struct [EC_T_SLAVE_PROP](api_slave.html.md#_CPPv415EC_T_SLAVE_PROP) ### [EC_T_WORD](api.html.md#_CPPv49EC_T_WORD) [wStationAddress](api_slave.html.md#_CPPv4N15EC_T_SLAVE_PROP15wStationAddressE) ### [EC_T_WORD](api.html.md#_CPPv49EC_T_WORD) [wAutoIncAddr](api_slave.html.md#_CPPv4N15EC_T_SLAVE_PROP12wAutoIncAddrE) ### [EC_T_CHAR](api.html.md#_CPPv49EC_T_CHAR) [achName](api_slave.html.md#_CPPv4N15EC_T_SLAVE_PROP7achNameE)[MAX_STD_STRLEN] ## 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](api.html.md#_CPPv49EC_T_BOOL) bIsCyclicFrame Indicates whether the lost frame was a cyclic frame ### [EC_T_FRAME_RSPERR_TYPE](#_CPPv422EC_T_FRAME_RSPERR_TYPE) EErrorType Frame response error type ### [EC_T_BYTE](api.html.md#_CPPv49EC_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](api.html.md#_CPPv49EC_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](api.html.md#_CPPv49EC_T_WORD) wCycFrameNum Number of the lost cyclic frame from the ENI ### [EC_T_DWORD](api.html.md#_CPPv410EC_T_DWORD) dwTaskId Cyclic Task ID (ENI: Cyclic/TaskId). Only valid if bIsCyclicFrame is set ### enum EC_T_FRAME_RSPERR_TYPE *Values:* ### enumerator eRspErr_UNDEFINED Undefined ### enumerator eRspErr_NO_RESPONSE No Ethernet frame received (timeout, frame loss) ### enumerator eRspErr_WRONG_IDX Wrong IDX value in acyclic frame ### enumerator eRspErr_UNEXPECTED Unexpected frame was received ### enumerator eRspErr_FRAME_RETRY Ethernet frame will be re-sent (timeout, frame loss) ### enumerator eRspErr_RETRY_FAIL All retry mechanism fails to re-sent acyclic frames ### enumerator eRspErr_FOREIGN_SRC_MAC Frame with MAC from other Master received ### enumerator eRspErr_NON_ECAT_FRAME Non EtherCAT frame received ### enumerator eRspErr_CRC Ethernet frame with CRC error received ### enumerator eRspErr_ETHERNET_PAUSE_FRAME Ethernet pause frame (flow control) received ## 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](#emonnotify-ec-notify-slave-error-status-info) with more precise error information is triggered. ## 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`](#_CPPv426EC_T_SLAVE_ERROR_INFO_DESC) of [`EC_T_ERROR_NOTIFICATION_DESC`](#_CPPv428EC_T_ERROR_NOTIFICATION_DESC). ### struct EC_T_SLAVE_ERROR_INFO_DESC ### Public Members ### [EC_T_SLAVE_PROP](api_slave.html.md#_CPPv415EC_T_SLAVE_PROP) SlaveProp Slave properties ### [EC_T_WORD](api.html.md#_CPPv49EC_T_WORD) wStatus Slave Status (AL Status) ### [EC_T_WORD](api.html.md#_CPPv49EC_T_WORD) wStatusCode Error status code (AL STATUS CODE) ## 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`](#_CPPv421EC_T_PDIWATCHDOG_DESC) of [`EC_T_ERROR_NOTIFICATION_DESC`](#_CPPv428EC_T_ERROR_NOTIFICATION_DESC). ### struct EC_T_PDIWATCHDOG_DESC ### Public Members ### [EC_T_SLAVE_PROP](api_slave.html.md#_CPPv415EC_T_SLAVE_PROP) SlaveProp Slave properties ## 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. ### struct EC_T_COMMUNICATION_TIMEOUT_NTFY_DESC ### Public Members ### [EC_T_BOOL](api.html.md#_CPPv49EC_T_BOOL) bMainTapPortIn EC_TRUE: Timeout occurred at the input port of the Ethernet TAP for the EtherCAT main line ### [EC_T_BOOL](api.html.md#_CPPv49EC_T_BOOL) bMainTapPortOut EC_TRUE: Timeout occurred at the output port of the Ethernet TAP for the EtherCAT main line #### SEE ALSO [`EC_T_MONITOR_INIT_PARMS::dwCommunicationTimeoutMsec`](api_general.html.md#_CPPv4N23EC_T_MONITOR_INIT_PARMS26dwCommunicationTimeoutMsecE) ## 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](api.html.md#_CPPv49EC_T_BOOL) bLinkConnected Link status of EC-Monitor - Ethernet Tap connection