Please enable JavaScript to view this site.

Introduction

EtherCAT (Ethernet for Control Automation Technology) is a deterministic industrial Ethernet technology originally developed by Beckhoff Automation. The EtherCAT protocol, published in the IEC61158 standard, meets hard and soft real-time requirements in automation, test and measurement systems, and many other applications.

In an EtherCAT network, information is exchanged via Ethernet frames, each in turn consisting of one or more datagrams. Regardless of the physical topology (line, cascade, star, ...), all frames are sent from the master through all slaves and return to the master after completing the loop. The data carried by the frames are processed by the slaves 'on-the-fly'. The delay incurred by the frame is equal only to the physical traversal time of the slave. (See official EtherCAT website for more information.)

This technology is managed by Robox through its own controllers, whose Ethernet channels can handle an EtherCAT line with CoE (CANopen over Ethernet) and SoE (Servodrive over Ethernet) protocol in Sync mode or Distributed Clock (DC) as master.

Up to 1024 terminals can be managed.

Bookmarks

Related arguments

Configuration

In order to communicate via EtherCAT, the Robox control needs two files, configurable from the RDE project, which must be present in the compact flash (or SD) and which contain all the specifications regarding the line:

The ECATn.CFGX file: This file contains the configuration of an EtherCAT network channel. "n" represents the channel number, so ECAT1.CFGX contains the configuration of the first Ethernet channel. This is an XML file that is assumed by RTE only when the control is turned on and is used both to parameterize the network and to learn about the data packets exchanged with each device present

The FB.CFG file: This file contains the association between the data exchanged in the EtherCAT network, described in the ETHn.CFGX file, and the Robox variables. It is an Ascii file that is assumed by RTE only when the control is turned on. This file is generated by RDE based on the defined global variables, remote devices, and configured axes

NOTE: Since RTE 34.28.2, the optional auxiliary file FB2.CFG has also been added.

Generation of such files is handled by RDE project:

Open RTE Project--> Properties--> Configuration--> Fieldbus, make sure generation of fb.cfg file (under General) and EtherCAT configuration (under EtherCAT) is enabled.

ecat_config

EtherCat Network (File ECATn.CFGX)

From the workspace press File--> New File... (or give quick command Ctrl+N), enter the name and give it as an extension .fbc (Fieldbus Configuration Files). Then create it under the project folder.

Once the file is created, the appropriate RFBCED configurator window (Robox fieldbus configurator Editor) will automatically open, from which you can add devices connected to the EtherCAT line.

rfbced_file

NOTE: Configuring control as an EtherCAT slave node is available from RTE 34.30.0 only for RP-2 control AS1018.012.

NOTE: From RTE 34.5.1, it is possible to configure all devices and then report those that are not connected using the keyword ECAT_SLAVE_OFF.

After entering all devices, save and then close the window.

Open the RTE project--> Configuration--> double-click on "EtherCAT"--> check "Enable configuration of EtherCAT networks"--> double-click on ecat1--> select the newly created .fbc file under "Configuration files".

ecat_config_file

NOTE: With RDE < 3.50 you must link the CFGX output file obtained from the external configurator.

Once given confirmation, from project configurator press the right mouse button and select Generate -> EtherCAT configuration only (or generate all). At this point, the file ECATn.CFGX has been created under the project folder and at the next Make or Rebuild it will be loaded into the folder corresponding to the alias ECAT_DIR.

Data exchanged in EtherCat (File FB.CFG)

As mentioned earlier, the contents of this file depend on the use of global variables, the remote devices connected via EtherCAT, and the axes, also connected via EtherCAT, in the project.

The FB.CFG file must be located in the FB_DIR folder alias.

FB2.CFG

Since RTE 34.28.2, the optional FB2.CFG file, auxiliary to FB.CFG, has been added. This file is not related to ECAT2.CFGX and can contain any mapping (such as FB.CFG).

FB2.CFG is only loaded if FB.CFG is also present (it can also be an empty file) and the latter does not have an error in it.

The FB2.CFG file must be in the FB_DIR folder alias.

Remote Device Management

From RTE project--> Configuration press the right mouse button and select New--> Remote Device. Then select the type of remote device to be used.

To connect the remote device to the EtherCAT line, select the related link under Links to Resources section.

remote_device

Then set all other parameters related to the remote device.

Axis management

From RTE project--> Configuration press the right mouse button and select New--> Axis.

To link the axis to the EtherCAT line, select Fieldbus--> Device--> check "Associate the axis to a remote device"--> select the Robox ID--> link the axis related device, status word and control word. Under Fieldbus--> Links link the additional information contained in the PDOs to the axis variables.

ecat_axis

Then set all other axis-related parameters (general, transducer, actuator...).

WARNING: Until RTE 3.52, there was no "Field Bus" window, and all the information in it was instead entered by creating a remote device (Drive CAN402), which was then associated with the axis. This method can still be used today.

Global variables

From RTE Project -> Configuration, select "Global Variables" to associate the variables contained in the PDOs with the axis control variables (global variables).

global_variables

Once the global variables, axes, and remote devices have been configured, generate the configuration from RTE project in order to update the FB.CFG file and then load it into flash through a make or rebuild operation.

NOTE: From RTE 34.27.5, the number of definable variables connected to ethercat has increased from 3000 to 6000 for arm-a9 cpu only.

Status Variables

The following status variables are available for each EtherCAT network created:

DevState: bit mask describing the state of the device

0x0001 = Link error at primary port

0x0002 = I/O blocked as a result of link error (I/O reset requested)

0x0004 = Link error at redundant port (redundancy mode)

0x0008 = Missing frame (redundancy mode)

0x0010 = Out of send resources (I/O reset required)

0x0020 = Watchdog triggered

0x0040 = Ethernet driver (miniport) not found

0x0080 = I/O reset active

0x0100 = At least one device in the INIT state

0x0200 = At least one device in the PRE-OP state

0x0400 = At least one device in the SAFE-OP state

0x0800 = At least one device indicates an error state

0x1000 = Distributed Clock not in sync

Frm0WcState

0x0001 = wrong working counter by 1

0x0002 = wrong working counter by 2

0x0004 = wrong working counter of 3

...

0x4000 = wrong working counter by 15

0x8000 = completely missing frame

SlaveCount: actual number of EtherCAT slaves detected on the network

status_variables_ecat

To be able to map them to a Robox resource follow this procedure: from RTE project--> Variables--> Global variables--> Right click and select New variable (Ins) (figure 1)--> enter at least the "Type" field--> click on the magnifying glass on the "Source" field line--> ETHn--> Status (figure 2).

Figure 1:

Find_status_variable_ecat_2

Figure 2:

Find_status_variable_ecat

Functions/Instructions

co_statusword()

Function that returns the contents of the statusword of the indicated ws

co_controlword_state()

Function that writes the bits of the control_word (object 6040H)

co_controlword_om()

Function to impose status on the drives (operation mode specific, halt , manufacturer specific)

co_rerr()

Function to read the last emergency message generated by the indicated ws

co_par_download()

Instruction to upload to a device connected via can the parameters contained in a file in the flash of the Robox control

co_par_upload()

Instruction to update in the flash of the Robox control a parameter file by reading values from the device connected via can

co_rnmt()

Function that returns the NMT state of the indicated ws

co_wnmt()

Function that imposes NMT state on the indicated ws

co_robj()

Function to read objects from fieldbus

co_wobj()

Function to write objects from fieldbus

coe_robj()

Function to read objects from fieldbus

coe_woj()

Function to write objects from fieldbus

co_send_sdo()

Writing SDO

co_asw_sdo()

Read SDO

ecat_dev_on_off()

Enables/disables a device on EtherCAT line

ecat_get_state()

Reads the status of the EtherCAT line

ecat_probe()

Reads the information of a device on EtherCAT line

ecat_set_state()

Imposes the state of the EtherCAT line

Keywords

FB_STSW

Status of the status word (object 6041H)

FB_CRTLW

Status of the control word (object 6040H)

TRD_AL_INFO

Displays information about the transducer

COE_EMCY_AK

Allows you to specify how to extrapolate the sub-device number from the emergency message

DEF_AX

Number of references defined

DEF_TRD

Number of transducers defined

ECAT_CH_LOST_NODE

Masks EtherCAT networks with fewer nodes than desired

ECAT_DIAG_SLAVE_STATE

Operational status of nodes

ECAT_DIAG_SLAVE_PRES

Number of nodes actually present

ECAT_DIAG_SLAVE_COUNT

Number of nodes configured

ECAT_DIAG_SLAVE_DISCON

Number of nodes expected to be disconnected

ECAT_DIAG_SLAVE_MUST_BE_PRES

Number of nodes expected to be present

ECAT_DIAG_MASTER_STATE

Operational state of the master

ECAT_DIAG_MASTER_MISS_CYC_FR

Number of synchronous frames lost

ECAT_READ_NODE_STATUS

Mask EtherCAT networks to force state reading

FB_FLAG

Diagnostic fieldbus alarm mask

FB_MASTER_CFG

Mask of configured fieldbus master channels

FB_REF_MASK

Mask of axes that have the defined fieldbus type reference

MAX_LOST_FRAME_ECAT

Parameter to configure the maximum number of EtherCAT frames that can be lost consecutively before the system generates an 8x ECAT xx No Communic alarm.

NUM_LOST_FRAME_ECAT

Parameter to know the number of consecutive EtherCAT frames that currently result as lost

SYS_CFG_2.21

Sets all EtherCAT slaves to SAFE-OP mode when the operating mode is changed to loading

For other EtherCAT Slave keywords see EtherCAT Slave Configuration.

SHELL commands

CO_EMCYINFO

Displays the emergency messages information

CO_REMCY

Displays the emergency messages of the specified station

CO_RNMT

Displays the NMT status of the specified station

CO_ROBJ

Displays the value of the specified object

CO_STATE_MAC

Displays the CAN402 machine status of the specified station

CO_WNMT

Displays the NMT status of the specified station

CO_WOBJ

Writing the specified object

CO_WSDIAGNO

Displays the diagnostic of the specified station

Device commands

CO_SDO

Allows SDO (service data object) messages to be sent to workstations on the network

COE_ROBJ

Allows reading objects on CoE fieldbus

COE_WOBJ

Allows writing objects on CoE fieldbus

CPT_2

Permits to enable/disable immoderate timeout on waiting for response on CoE object management via mailbox (e.g., drive response on object change for transducer type selection)

D_EMCY

Displays the current error message present on the specified workstation

D_NMT

Displays the current NMT status of the specified workstation

D_CO_WSDIAGNO

Displays status code of the specified workstation

EMCY_AL

Disables issue of Emergency messages

S_NMT

Command to impose NMT command on the specified station

ECAT_APRD

Performs reading of internal registers of an ethercat device using incremental address

ECAT_APWR

Performs writing of the internal registers of an ethercat device using incremental address

ECAT_FPRD

Performs reading of the internal registers of an ethercat device using absolute address

ECAT_FPWR

Performs writing of the internal registers of an ethercat device using absolute address

ECAT_GET_STATE

Displays the NMT status of the EtherCAT line

ECAT_PROBE

Performs device discovery on an ethercat line

ECAT_SET_STATE

Sets the NMT state of the EtherCAT line

ECAT_SLAVE_DISCON

Sets the number of nodes that can be disconnected from an EtherCAT line without generating alarms

ECAT_SLAVE_DISCON_TIME

Sets a filter time for alarms after the ECAT_SLAVE_DISCON=0 command.

ECAT_SLAVE_ID_OFF

Sets presence/absence of nodes in the EtherCAT line

ECAT_SLAVE_OFF

Enables/disables nodes present on the EtherCAT line

ECAT_SLAVE_S_NMT

Sets the status of a node in the EtherCAT line

DVFB

Displays the value of the specified FIELDBUS variable

INFO TRD

Displays the type of transducer configured for the axes

INFO PREF

Displays the type of position reference configured for the axes

INFO SREF

Displays the speed reference type configured for the axes

INFO TREF

Displays the type of torque reference configured for the axes

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC