When a client registers with the EC-Simulator stack the client has to determine a generic notification callback function. The stack calls this function every time an event (for example an error event or operational state change event) occurs about which the client has to be informed.
A further important rule exists due to the fact that this callback function is usually called in the context of the EC-Simulator stack timer thread. As the whole EtherCAT operation is blocked while calling this function the notification handler must not use much CPU time or even call operating system functions that may block. Time consuming operations should be executed in separate application threads.
Data structure filled with detailed information about the according notification.
[in] Client depending caller data parameter. This pointer is one of the parameters when the client registers
- EC_T_VOID *pCallerData
EC_T_DWORD esNotifyApp(EC_T_DWORD dwInstanceID, EC_T_DWORD dwCode, EC_T_NOTIFYPARMS *pParms)
By calling this function the generic notification callback function setup by emRegisterClient() is called. The maximum value for dwCode is defined by EC_NOTIFY_APP_MAX_CODE.
dwInstanceID – [in] Instance ID (Multiple EtherCAT Network Support)
dwCode – [in] Application specific notification code
pParms – [in] Parameters for application notification.
EC_E_NOERROR or error code