EtherCAT Get Emergency
Collect emergency messages from the EtherCAT bus
Simulink Real-Time / EtherCAT
The EtherCAT Get Emergency block collects emergency messages from EtherCAT® devices and presents the messages as output in the model. Optionally, the block can log the condition to the Target Computer Status Monitor. The outputs in the model and the logged status include all the emergency data, so action can be taken in the model.
Add one block to call into the notification code to collect the emergency message. The EtherCAT Technology Group defines general types of emergency error codes. Specific information coding is available in the documentation from each device manufacturer.
While there can be overlap in emergency message error codes sent by a device, device manufacturers often do not implement all codes and do not use the same codes for similar emergency issues. For more information, see the device documentation from the manufacturer. For example, a search in the Elmo Gold series motor drive application manual finds a description of error codes and error register values for error situations that the drive can encounter. The table shows a subset of the information from this manual.
Elmo Gold Series Motor Drive Error Codes (subset)
CAN message lost
Queue is low.
Err Code — Error Code
Err Code output provides the primary error code
produced by the device for a class of emergency issues.
Err Reg — Error Register
Err Reg output provides specific error
information that identifies a specific emergency issue inside the class
of emergency issues that is specified by the error code.
Data — Emergency data size
Name output is a vector of 5 uint8 values that
the device can send to attach values to a specified emergency issue. At
least one of the values must be non-zero.
Name — Station address
Name output is a null terminated character
array that identifies the device that sent the emergency message. This
output is the name of the device that is in the ENI file. This name can
differ depending on the string that the TwinCAT® or EC-Engineer software uses to identify the
Log messages to statusmonitor — Enable message logging
on (default) |
Log messages to statusmonitor parameter enables
logging the message to the status monitor.
Sample time — Sample time of block
.001 (default) | numeric
Enter the base sample time or a multiple of the base sample time. Use the EtherCAT task sample time.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2023b