Documentation

SimulinkRealTime.etherCAT.filterNotifications

Display EtherCAT notifications in human-readable format

Syntax

SimulinkRealTime.etherCAT.filterNotifications()
SimulinkRealTime.etherCAT.filterNotifications(tlog, olog, suppress)
filtered_values = SimulinkRealTime.etherCAT.filterNotifications(tlog, olog, suppress)
[filtered_values suppressed_values] = SimulinkRealTime.etherCAT.filterNotifications(tlog, olog, suppress)

Description

example

SimulinkRealTime.etherCAT.filterNotifications() without arguments prints the valid notification values and their text descriptions.

example

SimulinkRealTime.etherCAT.filterNotifications(tlog, olog, suppress) extracts from olog the notification values that come 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 code 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 = SimulinkRealTime.etherCAT.filterNotifications(tlog, olog, suppress) returns a structure vector containing the filtered values.

example

[filtered_values suppressed_values] = SimulinkRealTime.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

SimulinkRealTime.etherCAT.filterNotifications
SimulinkRealTime.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

Print the notifications that appear during normal operation.

In this example, the output signals from the EtherCAT Get Notifications block are at signal indexes 1:21. Pass in an empty suppress vector.

tlog = tg.TimeLog;
olog = tg.OutputLog(:, 1:21);
SimulinkRealTime.etherCAT.filterNotifications(tlog, olog, [])
 Time        Notification
0.010750 (     3) Scanbus Finished
0.012750 (     1) State Change
0.022500 (     1) State Change
0.590500 (     5) DC Slave Synchronization deviation received
0.591000 (     4) Distributed clocks initialized
0.715500 (     1) State Change
1.216250 (     1) State Change
         ( 65569) All slave devices are in operational state

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

In this example, the output signals from the EtherCAT Get Notifications block are at signal indexes 1:21.

tlog = tg.TimeLog;
olog = tg.OutputLog(:, 1:21);
SimulinkRealTime.etherCAT.filterNotifications( tlog, olog, [1]);
 Time        Notification
0.010750 (     3) Scanbus Finished
0.590500 (     5) DC Slave Synchronization deviation received
0.591000 (     4) Distributed clocks initialized
         ( 65569) All slave devices are in operational state

1: 4 times [0.012750 : 1.216250]
State Change

Return as a vector the notifications that appear during normal operation.

In this example, the output signals from the EtherCAT Get Notifications block are at signal indexes 1–21. Pass in an empty suppress vector.

tlog = tg.TimeLog;
olog = tg.OutputLog(:, 1:21);
filtered_values = ...
    SimulinkRealTime.etherCAT.filterNotifications(tlog, olog, [])
filtered)values = 
  1×7 struct array with fields:
    time
    code
    notifystring

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

In this example, the output signals from the EtherCAT Get Notifications block are at signal indexes 1:21.

tlog = tg.TimeLog;
olog = tg.OutputLog(:, 1:21);
[filtered_values suppressed_values] = ...
    SimulinkRealTime.etherCAT.filterNotifications(tlog, olog, [1])
filtered_values = 
  1×3 struct array with fields:
    time
    code
    notifystring

suppressed_values = 
  struct with fields:

      val: 1
    first: 0.013000000000000
     last: 1.216500000000000
    count: 4

Input Arguments

collapse all

Read tg.TimeLog from the target computer.

Example: tg.TimeLog

Data Types: double

Read tg.OutputLog from the target computer.

Example: tg.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

  • To retrieve the notifications, in the Command Window, read tg.OutputLog and tg.TimeLog from the target computer.

  • Determine which tg.OutputLog columns to pass into SimulinkRealTime.etherCAT.filterNotifications.

    • If you connected the EtherCAT Get Notifications block to the first Outport block, the 21 notification signals appear in columns 1:21 of the tg.OutputLog matrix.

    • To determine which columns of tg.OutputLog come from the EtherCAT Get Notifications block, set tg.ShowSignals to 'on'. From the resulting information, determine the relevant columns.

  • 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.

  • The EtherCAT Get Notifications block can quickly increase the size of the output log. In the Simulink Real-Time Options pane, if the value of Signal logging data buffer size in doubles is too small, the log wraps and overwrites the oldest data, which can contain important diagnostic information.

Introduced in R2017a

Was this topic helpful?