Main Content

slrealtime.EtherCAT.filterNotifications

Display EtherCAT notifications in human-readable format

Description

example

slrealtime.EtherCAT.filterNotifications() prints the valid notification values and their text descriptions.

example

slrealtime.EtherCAT.filterNotifications(tlog, olog, suppress) extracts from olog the notification values from the EtherCAT Get Notifications block, and from tlog, the times at which these values occurred.

If the suppress vector is nonempty, the function removes from the output list the notification values that appear in the vector. For each notification listed in the suppress vector, the function prints the total number of occurrences and the time range over which they occurred.

When you are debugging EtherCAT® issues, use this function. You must have advanced knowledge about EtherCAT functionality.

example

filtered_values = slrealtime.EtherCAT.filterNotifications(tlog, olog, suppress) returns a structure vector containing the filtered values.

example

[filtered_values suppressed_values] = slrealtime.EtherCAT.filterNotifications(tlog, olog, suppress) returns a structure vector containing the filtered values and a structure containing a summary of the suppressed values.

Examples

collapse all

Print the valid notification values and their text descriptions

slrealtime.EtherCAT.filterNotifications
slrealtime.EtherCAT.filterNotifications
(     1): State changed
(     2): Cable connected
(     3): Scanbus finished
(     4): Distributed clocks initialized
(     5): DC slave synchronization deviation received
(     8): DCL initialized
(     9): DCM inSync
(    21): Successful slave state transition.
(   100): Queue raw command response notification
( 65537): Cyclic command: Working count error
( 65538): Master init command: Working count error
( 65539): Slave init command: Working count error
( 65540): EOE mbox receive: Working count error (deprecated)
( 65541): COE mbox receive: Working count error (deprecated)
( 65542): FOE mbox receive: Working count error (deprecated)
( 65543): EOE mbox send: Working count error
( 65544): COE mbox send: Working count error
( 65545): FOE mbox send: Working count error
( 65546): Frame response error: No response
( 65547): Slave init command: No response
( 65548): Master init command: No response
( 65550): Timeout when waiting for mailbox init command response
( 65551): Cyclic command: Not all slaves in op state
( 65552): Ethernet link (cable) not connected
( 65554): Redundancy: Line break detected
( 65555): Cyclic command: A slave is in error state
( 65556): Slave error status change
( 65557): Station address lost (or slave missing) - FPRD to ...
          AL_STATUS failed 
( 65558): SOE mbox receive: Working count error (deprecated)
( 65559): SOE mbox send: Working count error
( 65560): SOE mbox write responded with an error
( 65561): COE mbox SDO abort
( 65562): Client registration dropped, possibly call to ...
          ecatConfigureMaster by other thread (RAS)
( 65563): Redundancy: Line is repaired
( 65564): FOE mbox abort
( 65565): Invalid mail box data received
( 65566): PDI watchdog expired on slave, thrown by IST
( 65567): Slave not supported (if redundancy is activated and ...
          slave doesn't fully support autoclose
( 65568): Slave in unexpected state
( 65569): All slave devices are in operational state
( 65570): VOE mbox send: Working count error
( 65571): EEPROM checksum error detected
( 65572): Crossed lines detected
( 65573): Junction redundancy change
(196610): ScanBus mismatch
(196611): ScanBus mismatch. A duplicate HC group was detected
(262146): HC enhance detect all groups done
(262147): HC probe all groups done
(262148): HC topology change done
(262149): Slave disappears
(262150): Slave appears

Export time log and data log for a simulation run from the Simulation Data Inspector. Apply the slrealtime.EtherCAT.filterNotification command to the log data.

In this example, the output of the EtherCAT Get Notifications block connects to a File Log block. After the simulation run stops, Simulink Real-Time uploads the file log data to the Simulation Data Inspector. You can use the slrealtime.EtherCAT.filterNotification command on the log data.

In your model, connect the output of the EtherCAT Get Notifications block connects to a File Log block.

Build the model, and then download and run the real-time application.

Open the Simulation Data Inspector.

While the real-time application is running, the Simulation Data Inspector lists any signals that are marked for logging, for example as Run 1:<modelname>@TargetPC1. When model execution stops, the Simulation Data Inspector moves that run to the archive. Then, Simulink Real-Time uploads the signal data from the File Log block to the Simulation Data Inspector. This data appears, for example as Run 2:<modelname>@TargetPC1[FileLog][Current].

To apply use the slrealtime.EtherCAT.filterNotification command on the log data, export the whole data set as a single data set to the MATLAB workspace. These steps create a 1x1 data set that contains the variable notifications.

  1. In the Simulation Data Inspector, right-click the Run 2: line.

  2. Select Export Data …. That opens a dialog.

  3. For Export:, select Selected runs and signals.

  4. For To:, select Base workspace and provide a variable name for the export, such as notifications.

To get the timelog and the datalog use:

timelog = notifications{1}.Values.Time;
datalog = notifications{1}.Values.Data;

To print notifications from normal operations, run the filterNotifications command with this data:

slrealtime.EtherCAT.filterNotifications(timelog, datalog, [])
 Time      Code     Description
0.040000 (     3) Scanbus finished
0.045000 (     1) State changed
1.199000 (     4) Distributed clocks initialized
1.202000 (     1) State changed
4.198000 (     9) DCM inSync
4.200000 (     5) DC slave synchronization deviation received
4.350000 (     1) State changed
4.357000 (     1) State changed

Filter and return the notifications that appear during normal operation. Filter notification ( 1) State Change.

There are cases in which message filtering or suppression is useful. In certain error situations, you may see many notifications about one particular situation that can hide other significant notifications. This situation could be a large number of working count errors or frame response errors, for example, that hide other notifications that you may need to identify how to recover from the situation.

For information about creating the timelog and datalog variables, see Get Time and Data Log from EtherCAT Get Notifications Block.

[filtered_values suppressed_values] = ...
    slrealtime.EtherCAT.filterNotifications(timelog, datalog, [1])
 Time      Code     Description
0.040000 (     3) Scanbus finished
1.199000 (     4) Distributed clocks initialized
4.198000 (     9) DCM inSync
4.200000 (     5) DC slave synchronization deviation received

Suppressed notifications:

      1: 4 times [0.045000 : 4.357000]
State changed

Input Arguments

collapse all

Use exported time log data from signal data displayed in the Simulation Data Inspector. See Get Time and Data Log from EtherCAT Get Notifications Block .

Example: timelog

Data Types: double

Use exported data log data from signal data displayed in the Simulation Data Inspector. See Get Time and Data Log from EtherCAT Get Notifications Block .

Example: outputlog

Data Types: double

For each code, the function reports the total number of occurrences and the time range over which they occurred. If you do not want to suppress notification codes, pass in an empty vector ([]).

Example: 65546

Example: []

Data Types: double

Output Arguments

collapse all

Each element of filtered_values is a structure containing:

  • time (double) — Timestamp of notify code

  • code (double) — Notify code

  • notifystring (character vector) — Text description

Each element of suppressed_values is a structure containing:

  • val (double) — Notify code

  • first (double) — Timestamp of first occurrence

  • last (double) — Timestamp of last occurrence

  • count (double) — Number of instances found

Tips

  • Common error conditions, such as an unplugged Ethernet cable, can cause thousands of unwanted notifications that hide useful notifications. To filter unwanted notifications, use the suppress vector.

Introduced in R2020b