日本語 English

ECAT diagnostic and statistical information dashboard with Metabase

This article creates a dashboard in Metabase that visualizes the error counts of EtherCAT slaves.
It shows the error trend and latest state for each node and can be used to monitor network faults.

Try Creating a Dashboard for ECAT Diagnostic and Statistical Information

The dashboard we want

Show the latest error counts of the four ports for each node, and their past trends, in graphs Finished dashboard

Steps to create the dashboard

  1. Step 1: Create a trend graph for node 1
  2. Step 2: Show the latest data for node 1
  3. Step 3: Edit the dashboard layout
  4. Step 4: Nodes 2 to 4
  5. Done

Step 1: Create a Trend Graph for Node 1

New question

  1. Click [+ New], then [Question]

    New question

  2. Select the database containing the diagnostic and statistical information (testSQLServer here)

    Select DB

  3. Select the table containing the slave information (SlaveStat here)

    Select table


    After selecting, the screen looks like this
    After selecting the table

  4. Select NodeAdr in the filter

    Filter settings


    Enter 1 to target node 1 only
    Select node 1


    It looks like this
    After selecting the filter

  5. In Summarize, select four metrics, the maximum of ErrCnt0 to ErrCnt3, for the Y axis and RecDT for the X axis

    In [Pick the metric you want to see], select [Max of ...]
    Select maximum


    Select [ErrCnt0]
    Select ErrCnt


    Click [+] and select 1 to 3 in the same way
    Select 1 to 3


    In [Pick a column to group by], select [RecDT]
    Select RecDT

  6. The settings look like this

    Settings

  7. Click [Visualize] to show the graph

    Visualize
    Select [Minute] for the X-axis span


    Select minute


    It changes to a per-minute view
    Minute view

  8. Click [Save] and save it as 'Node1'

    Save


    Add it to a dashboard
    Add to dashboard


    Click [Create a new dashboard] to create a new dashboard
    New dashboard


    Create it with the name "ECAT diagnostic and statistical information"
    Create a name


    Click [Save] to save the created dashboard for now
    Save for now


    To view the saved data, click [Browse all data >] under Analytics
    Browse all data


    The created dashboard and the Node1 graph are under Analytics
    Dashboard after creation

Step 2: Show the Latest Data for Node 1

SQL query

  1. Click [+ New], then [SQL query]

    SQL query

  2. Select the database containing the diagnostic and statistical information (testSQLServer here)

    Select DB

  3. Write the following SQL andSQL run buttonpress
    select top(1) ErrCnt0, ErrCnt1, ErrCnt2, ErrCnt3 from SlaveStat where NodeAdr=1 order by RecDT DESC

    Result


    The result is shown at the bottom
    Result


  4. Click [Save] and save it with the name 'Node1 latest'

    Save


    Add it to the dashboard and save the dashboard as well

    Save the dashboard too

Step 3: Edit the Dashboard Layout

Dashboard

  1. To view the saved data, click [Browse all data >] under Analytics

    Browse

  2. The ECAT diagnostic and statistical information dashboard, the Node1 graph and the Node1 latest data are there, so click [ECAT diagnostic and statistical information] to open it

    Open

  3. The created graph and data should be arranged on the dashboard like this

    Initial layout

  4. Click the pencil at the top right to put the dashboard in edit mode

    Edit mode

  5. Graphs and other parts can be dragged and resized, so arrange them freely

    Rearranged layout

  6. Finally, [Save]

Step 4: Nodes 2 to 4

Likewise...

Create nodes 2 to 4 in the same way and add them to the dashboard
For the graphs, change the NodeAdr filter to 2
Node 2
and change NodeAdr=1 to 2 in the SQL for the latest data

select top(1) ErrCnt0, ErrCnt1, ErrCnt2, ErrCnt3 from SlaveStat where NodeAdr=2 order by RecDT DESC

SQL statement

Done

Finished dashboard
Done

Finally

I created a dashboard from the ECAT diagnostic and statistical data, but this is just one example, so try various aggregation methods

Comments