EtherCAT Slave Module Tutorial

Publish Date: Apr 03, 2018 | 0 Ratings | 0.00 out of 5 | Print | Submit your review

Overview

The cRIO ECAT S is a C Series module that enables a CompactRIO chassis to act as an EtherCAT slave. This module can be used to create a network of communications with an NI EtherCAT master (enabled using the NI-Industrial Communications for EtherCAT driver) or a compliant 3rd party EtherCAT master. This tutorial will walk you through setting up the computer and module for use.

Table of Contents

  1. Installing Software Requirements
  2. Configuring PDO Data
  3. Downloading to Module
  4. Programming in LabVIEW
  5. Configuring the EtherCAT master
  6. Finding More Help

1. Installing Software Requirements

Before installing the cRIO ECAT module specific packages, ensure your system has:

  1. LabVIEW 2017 or higher
  2. LabVIEW FPGA module 2017 or higher
  3. LabVIEW Real-Time module 2017 or higher [optional; but recommended]
  4. NI CompactRIO Device Drivers May 2017 or higher
  5. NI Industrial Communications for EtherCAT 2017 [required if using an NI EtherCAT Master]

After you have installed the base packages listed above, install the latest versions of the KUNBUS EtherCAT software from the JKI VI Package Manager (VIPM):

Figure 1. Search “KUNBUS” to quickly discover the cRIO ECAT S packages (highlighted)

Install both the “cRIO EtherCAT Slave” and “PDO Configurator” packages to your computer. The description of the packages in VI Package Manager will list LabVIEW and Operating System compatibility.

 

Back to Top

2. Configuring PDO Data

In EtherCAT, data is sent as Service Data Objects (SDOs) or Process Data Objects (PDOs). SDOs are used for non-cyclic communication, which is typically configuration. PDOs are used for cyclically transferred data, such as I/O samples. The cRIO ECAT S module can automatically receive some SDO data, which is handled by the module’s onboard logic and is not user-configurable. Primary communication between the module and the EtherCAT network takes place using PDOs.

The cRIO ECAT module provides a wide degree of flexibility surrounding PDOs. The PDO-Configurator, a standalone utility, allows you to set the data type, name, and direction of each PDO.

The PDO-Configurator can output two necessary files: the ESI and PDO file. The ESI file (EtherCAT Slave Information) is a standard file that each EtherCAT slave provides to identify itself and its communication structure. This file is saved in the XML format and is sometimes referred to as “the XML file”. The PDO file is a custom binary file that contains information that needs to be sent to the cRIO ECAT S module to align it with the desired PDO configuration.

Launching the PDO-Configurator

The PDO-Configurator can be started using Start » Kunbus GmbH » cRIO ECAT Slave » Tools » PDO-Configurator, or LabVIEW » Tools » KUNBUS GmbH » PDO-Configurator.

Creating PDO(s)

The labels “RX” and “TX” represent Receive and Transmit and are from the perspective of the module. For example, a TXPDO is a PDO that the cRIO ECAT sends out onto the EtherCAT network. Determining if you need both RXPDOs and TXPDOs will require knowledge of your objectives for this EtherCAT device as a part of the larger network – what will the master send it? What will it send to the master? These are core questions to determining the type and number of PDOs to create.

To create a PDO, go to PDOs » Add RxPDO or Add TxPDO based on which you would like to create.

Figure 2. Creating a TxPDO in the PDO-Configurator

Once you’ve create a PDO, you’ll need to populate it with variables. For an RXPDO, these need to match the data being sent to this EtherCAT device (both in order and datatype). You can add variables by going to Variables » Add Var. Then, set the Variable Name, Data Type, and Number of Elements as desired. The Index of each variable will be important later when you wish to access PDO data in your LabVIEW application.

Figure 3. Setting the data type of a RxPDO variable in the PDO-Configurator

Exporting Data

After creating your desired PDOs and filling them with variables, it’s time to export this data. Go to File » Export ESI & PDO file as to save the ESI file and compile the PDO file that will be used to configure the C Series EtherCAT Slave module.

 

Back to Top

3. Downloading to Module

To apply the PDO configuration file to the cRIO ECAT S, there is a download project. This download project can be found in LabVIEW » Tools » KUNBUS GmbH » PDO Configuration Download. This project contains an FPGA VI that will need to be compiled for a specific target before use. For more information on how to migrate this to your FPGA target, go to ni.com/info and enter Info Code “fpgaex”. Use the PDO-ConfigurationDownload(Host).vi to send the configuration file to the module. For more information on this process, see page 13 of the Getting Started PDF at LabVIEW » Help » KUNBUS GmbH » cRIO ECAT Slave.

 

Back to Top

4. Programming in LabVIEW

The module is accessed and programmed through an FPGA VI. There are three main methods: Update, Read, and Write.

To see these methods in action, you can open one of the examples. These examples can be found in the Example Finder via LabVIEW » Help » Find Examples. Choose the directory Toolkits and Modules » Third-Party Add-Ons » KUNBUS GmbH » EtherCAT.

 

Back to Top

5. Configuring the EtherCAT master

You can use the module with either an NI device acting as EtherCAT master, or a third party master.

To use an NI device as a master, you’ll first need to install NI-Industrial Communications for EtherCAT to both the development PC and the Real-Time controller. After this, you can add the slave to a LabVIEW project as outlined in Adding Third-Party EtherCAT® Slaves in LabVIEW.

Since the manufacturer and module of the cRIO ECAT S slave does not change between each ESI file that’s created in the PDO Configurator, we recommend cleaning out the previous cRIO ECAT S ESI files in the folder C:\Program Files(x86)\National Instruments\Shared\IndComECAT\DD. Otherwise, it can be difficult to import load the desired I/O items into the LabVIEW project.

If working with a third party master, consult their documentation on how to add a slave to the network. Many master software programs require the ESI file for the slave, which you created in “Configuring PDO Data”.

 

Back to Top

6. Finding More Help

In addition to this tutorial, there are two documents that ship with the driver. The Module Specification and the Getting Started manual can be found in LabVIEW » Help » KUNBUS GmbH » cRIO ECAT Slave. For support, you can call NI Support or post a question on the Industrial Communications forum page.

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit