Example Code

Programmatically Reset Ethercat Chassis After A Connection Error using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW Real-Time Module
  • LabVIEW

Code and Documents

Attachment

 

Overview

This example demonstrates how to  reset the EtherCAT chassis after experiencing a connection loss.

 

Description

This is an example EtherCAT project to show how you can reset the EtherCAT chassis after experiencing a connection error.

If you have a C-Series module anywhere in your code and you loose connection to your EtherCAT chassis it will result in your code throwing an error and aborting. With the right error handling, this can be prevented.

This code shows, using a simple state machine, and how adding error handling into your code can help you and prevent you from loosing data if your system is for example being run overnight and is not monitored.

The error will still be reported and can be seen later in the Distributed systems manager and can be seen in this image below.

 

connection error.PNG

 

 

This attached code will reset the EtherCAT chassis by changing it programmatically between active and configuration mode just like you can do by using the "Change to Configuration" button as seen in the image above.

 

Requirements

 Software

  • LabVIEW Full Development System 2012 (or compatible)
  • LabVIEW Real-Time Module 2012 (or compatible)
  • NI-CompactRIO 12.0 (or compatible)
  • NI-Industrial Communications for EtherCAT 2.4 (or compatible)

 Hardware

  • NI Real-Time cRIO
  • NI EtherCAT Slave 9144
  • any C-Series Module for the Slave, in this example is the NI-9477

Steps to Implement or Execute Code

  1. Run the VI.
  2. (Optional) Disconnect the ethernet cable from the 9144 chassis and view the execution in debugging mode.

Additional Information or References

 Reset EtherCAT Chassis after connection Loss.vi - Front Panel.png

 

Reset EtherCAT Chassis after connection Loss.vi - Block Diagram.png

 

**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text 'NIVerified'. Read here for more information about the new Example Guidelines and Community Platform.**

Nathan
Applications Engineer
National Instruments UK & Ireland

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Ajay_MV
Active Participant
Active Participant
on

Is this the only way to reset the EtherCAT chassis? 

Recently we upgraded a code from LV2009 to LV2013 and faced PXI crash.  The code used the same above mentioed technique to reset the EtherCAT and it was working good with LV2009.  In one of debugging technique we disabled this toggling code and found PXI didn't crash.  So we are thinking if there is anyother way to do the EtherCAT reset instead of above method.

--
Ajay MV