1. 1
Copyright: 2017 OMRON Corporation. All Rights Reserved.
EtherCAT
Functional Training
Innocentio A. Loe
OEP-ID / OMCP
March 2017
2. Creating EtherCAT Network
2
Copyright: 2016 OMRON Corporation. All Rights Reserved.
1. In Sysmac Studio, under Configuration and Setup, double-click on EtherCAT
2. Add any connected slave manually from the Toolbox
3. If Sysmac Studio is working Online to the PLC, create the network automatically by right-
clicking on Master and choose Compare and Merge with Actual Network Configuration
4. E.g. we put R88D-1SN01H-ECT Servo Drive
3. Slave Node Address
Copyright: 2016 OMRON Corporation. All Rights Reserved.
Each EtherCAT Slave must have a unique Node Address. It can be set either by :
Manually set Node Address by Slave Unit Rotary Switch. Do this only when Slave Unit
is turned Off
Write Slave Node Address via Sysmac Studio. In this case do the following :
1. Set Slave Unit Rotary Switch to Zero (0)
2. Write desired Slave Node Address on EtherCAT editor window
3. While Online to PLC, right-click on the Master and select Write Slave Node Address
3
4. EtherCAT PDO Communication
Copyright: 2016 OMRON Corporation. All Rights Reserved.
PDO stands for Process Data Object
Data mapped to PDO are refreshed between Master and Slave on each communication cycle.
In Sysmac Studio, these data can be mapped to Master’s Global Variables via IO Map
e.g. Mapped
Variables
4
5. Customize PDO Mapping
Copyright: 2016 OMRON Corporation. All Rights Reserved.
Any EtherCAT Slaves in particular have customizable PDO Mapping, which means we can
change what information to be continuously refreshed between Master and Slave. To change
PDO Mapping, to the following :
1. Go to EtherCAT editor window and select a Slave Unit to be customized
2. In the right window, on PDO Map Settings, click on Edit PDO Map Settings button
3. Select possible data to be mapped, e.g. 261th Transmit PDO Mapping will enable
Velocity Actual Value to be mapped via IO Map
5
6. EtherCAT Node Location
Copyright: 2016 OMRON Corporation. All Rights Reserved.
NX/NJ CPU has internal variable which map connected EtherCAT Slaves Node Location.
To Map the internal variable, do the following :
1. Go to EtherCAT editor window and select a Slave Unit to be customized
2. Right-click on the Slave Name and choose Display Node Location Port
3. An additional variable map can be made with type of _sECAT_ID
This variable can be used in program later on to get Node Address of the connected EtherCAT
Slave.
6
7. EC_DisconnectSlave
Copyright: 2016 OMRON Corporation. All Rights Reserved.
EC_DisconnectSlave FB can be used to Disconnect an EtherCAT Slave from the network
The term Disconnect means the Slave stops communicating, but physically the Slave itself is
still exist on the Network
Usage Example :
Stops communication of a selected EtherCAT Slave.
If any slave is connected in Daisy Chain with the targeted Slave, they will be disconnected also
7
Variables Data Type Description
Execute BOOL Starts FB Execution
NodeAdr UINT Targeted EtherCAT Slave Node Address
9. EC_ConnectSlave
Copyright: 2016 OMRON Corporation. All Rights Reserved.
EC_ConnectSlave FB can be used to Connect an EtherCAT Slave from the network
The term Connect means the Slave is already physically exist on the network, but will start
communicating only after this FB is called
Usage Example :
Starts communication of a selected EtherCAT Slave
9
Variables Data Type Description
Execute BOOL Starts FB Execution
NodeAdr UINT Targeted EtherCAT Slave Node Address
11. EC_ChangeEnableSetting
Copyright: 2016 OMRON Corporation. All Rights Reserved.
EC_ChangeEnableSetting FB can be used to either Enable/Disable an EtherCAT Slave on
the network
A Slave must be physically exist on the network before it can be Enabled, and also
communicating (Connected) before it can be Disabled
Usage Example :
Able to remove targeted slave from network without triggering any EtherCAT Error
If any slave is connected in Daisy Chain with the targeted Slave, they need to be disabled
separately
11
12. EC_ChangeEnableSetting
Copyright: 2016 OMRON Corporation. All Rights Reserved. 12
Variables Data Type Description
Execute BOOL Starts FB Execution
NodeAdr UINT Targeted EtherCAT Slave Node Address
IsEnable BOOL TRUE : Enable Slave, FALSE : Disable Slave
13. EtherCAT SDO Communication
Copyright: 2016 OMRON Corporation. All Rights Reserved.
SDO stands for Service Data Object
SDO data are not refreshed between Master and Slave. Communication occur on request
SDO data are categorized by Index. An Index can either have or don’t have a SubIndex
An SDO Index which have SubIndex can have CompleteAccess property, which means the
whole SubIndex can be Read/Written in a single SDO Communication
SDO Index/SubIndex can be Read-Only, Write-Only, or
PDO data can be accessed via SDO Communication
13
14. EC_CoESDORead
Copyright: 2016 OMRON Corporation. All Rights Reserved.
EC_CoESDORead FB will poll SDO Communication, reading EtherCAT Slave data
The message send uses CoE protocol
Usage Example :
1. Reads connected Slave Name and displays it on HMI
2. Reads how many times Slave has been reset
14
Variables Data Type Description
Execute BOOL Starts FB Execution
NodeAdr UINT Targeted EtherCAT Slave Node Address
SdoObj _sSDO_ACCESS Structure to define Index & SubIndex
TimeOut TIME Communication Timeout setting
ReadData ANY Read data (typically use BYTE[256])
ReadSize UINT Number of data received in Bytes
16. EC_CoESDOWrite
Copyright: 2016 OMRON Corporation. All Rights Reserved.
EC_CoESDOWrite FB will poll SDO Communication, writing data to EtherCAT Slave
The message send uses CoE protocol
Usage Example :
1. Writes servo drive mechanical Brake Interlock state (BKIR)
2. Writes new Threshold Value to a Fiber Sensor Amplifier (E3NX-FA0) which connected
through Sensor Communication Unit (E3NW-ECT)
16
Variables Data Type Description
Execute BOOL Starts FB Execution
NodeAdr UINT Targeted EtherCAT Slave Node Address
SdoObj _sSDO_ACCESS Structure to define Index & SubIndex
TimeOut TIME Communication Timeout setting
WriteData ANY Data to be written (typically use BYTE[256])
WriteSize UINT Number of data to be written in Bytes
18. GetECError - ResetECError
Copyright: 2016 OMRON Corporation. All Rights Reserved.
GetECError function checks whether any error has occurred related to EtherCAT
ResetECError FB clears any EtherCAT related error occurred if possible
Usage Example :
GetECError first checks if any EtherCAT related error has occurred
If EtherCAT error exists, ResetECError will try to clear it
18
Variables Data Type Description
GetECError
Level UINT EtherCAT error Level (0 means no error)
Code DWORD Error code of EtherCAT error (if any)
ResetECError
Execute BOOL Starts FB Execution