Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
EtherCAT Training
19.02.2009 1
EtherCAT Training
Agenda
EtherCAT Theory
EtherCAT Features
Sync Units
Hot Connect
Distributed Clocks
TwinCAT Integration
EtherCAT Setup
EtherCAT Diagnosis
Dr. Josef Papenfort
TwinCAT Product Management
j.papenfort@beckhoff.com
19.02.2009 2
EtherCAT Training
EtherCAT Theory: Addresses
Adresses in EtherCAT
Auto Inc Addr: The Auto Increment Address of the EtherCAT slave device.
Auto-increment addressing can be used to address each slave device via its
physical position in the communication ring. Auto-increment addressing is used
during the start-up phase, during which the master assigns the EtherCAT
Address to the slaves. The first slave in the ring has an address of 0 and for
each following the addresses is decremented (0xFFFF(-1),0xFFFE(-2) etc.).
EtherCAT Addr: The fixed Address of the EtherCAT slave device. This address
is set by the master during the start-up phase. To change the default value you
have to check the box left to the address.
(EtherCAT specification)
19.02.2009 5
EtherCAT Training
EtherCAT Theory
EtherCAT Diagnosis
separation from process data and bus diagnosis (helpful to make modular
control architectures)
Process data:
Working Counter shows if process data exchange is valid or not
Working Counter for one datagram (subframe, command)
19.02.2009 6
EtherCAT Training
EtherCAT Theory: Working Counter
EtherCAT Diagnosis
19.02.2009 7
EtherCAT Training
EtherCAT Theory: Working Counter
WcState
An invalid Working Counter State means that one EtherCAT Command for
updating the Inputs and Outputs has an incorrect Working Counter
With this EtherCAT Command more than one Slave can be addressed
(every Slave in this command has the same Working Counter 1).
Check the Slave State to see which Slave is responsible for the Working Counter
error.
19.02.2009 8
EtherCAT Training
EtherCAT Theory: Working Counter
WorkingCounter
19.02.2009 9
EtherCAT Training
EtherCAT Theory: Frames
Frames
- If more than 4 frames necessary all low prio I/Os in one (or more)
frames with the timing of the low prio task
19.02.2009 10
EtherCAT Training
EtherCAT Theory: CRC
Frames
19.02.2009 11
EtherCAT Training
EtherCAT Theory: CRC
Frames
frequency of occurrence
on Port A of
Slave
Possible Error detected!
19.02.2009 12
EtherCAT Training
EtherCAT Features
EtherCAT Theory
EtherCAT Features Sync Units
EtherCAT Features
- Redundancy for independent modules: a module defines a set of process data
- Sync Units
- Hot Connect
which is consistent and synchronized
- Distributed Clocks
EtherCAT Setup
combination of data from different slaves: validity of data is
- Master Setup important
- Slave Setup
EtherCAT Diagnosis cyclic process data diagnosis for each sync unit
- System Manager
- Ec Topology View
- ADS Interface if process data in one sync unit is invalid: separate reaction of
- PLC Library
- Network Monitor
control application can be defined
Step-by-Step Diagnosis
for Multi-Task-Operation: each Task has own Sync-Unit/Frame
Summary (read/write process data in different task cycles) reduces bus
load!
19.02.2009 18
EtherCAT Training
EtherCAT Sync Units
Bus Diagnostic
Modular Control
Structure
Data Exchange
Process data-
Datagram 0 Datagrams diagnostic (1 Bit) Datagram 0
Per datagram
t
Frame
Physical Bus stations
Sync Unit 1
19.02.2009 19
EtherCAT Training
EtherCAT Sync Units
Useful for applications with machine parts which can be out of order (planned or
unplanned) and the rest of the machine should work. Sync Units help to structure
these applications
Each EtherCAT Slave defines one or more process data areas which can be
exchanged synchron and consistent
19.02.2009 20
EtherCAT Training
TwinCAT&EtherCAT: Overview
Sync Units
19.02.2009 21
EtherCAT Training
EtherCAT Sync Units in TwinCAT System Manager
PLC Task
Standard
NC Task
PLC Task
Fast
User defined
Sync Unit
19.02.2009 22
EtherCAT Training
EtherCAT Sync Units in TwinCAT System Manager
EtherCAT Theory
Master Settings
EtherCAT Features
- Redundancy
Master Configuration
- Sync Units Online: Scan Devices
- Hot Connect
- Distributed Clocks
Select EtherCAT Device
Offline: Insert EtherCAT Master Device
EtherCAT Setup
- Master Setup
Select and configure network adapter
- Slave Setup
EtherCAT Diagnosis
- System Manager
- Ec Topology View
- ADS Interface
- PLC Library
- Network Monitor
Step-by-Step Diagnosis
Summary
19.02.2009 38
EtherCAT Training
TwinCAT&EtherCAT: Setup
XP: GUID
Experts only:
19.02.2009 39
EtherCAT Training
TwinCAT&EtherCAT: Setup
Master Settings
List of adapters
19.02.2009 40
EtherCAT Training
EtherCAT, driver installation
19.02.2009 41
EtherCAT Training
TwinCAT&EtherCAT: Setup
Frames and
Tasks
Datagrams
19.02.2009 42
EtherCAT Training
TwinCAT&EtherCAT: Setup
Utilization
For
Advanced users only!
19.02.2009 44
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Configuration
of Info Data
Master Startup
Behavior
19.02.2009 45
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave State
Machine
Configuration
of SlaveInfo Data Slave Checks
19.02.2009 46
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Sync Task
Configuration
(max. 4 Tasks)
Repeated
Frames
(only with
some Slaves!)
Actual Tasks
19.02.2009 47
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Supplement
Setting for Ethernet
Later on
over EtherCAT (EoE)
19.02.2009 48
EtherCAT Training
TwinCAT&EtherCAT: Setup
States
Masterstate
19.02.2009 49
EtherCAT Training
TwinCAT&EtherCAT: Setup
EtherCAT Theory
Slave Settings
EtherCAT Features
- Redundancy
Slave Configuration
- Sync Units Slaves Configuration
- Hot Connect
- Distributed Clocks
Startup Data
CANopen over EtherCAT
EtherCAT Setup
- Master Setup
File over EtherCAT
- Slave Setup Firmware Update (Bootstrap)
EtherCAT Diagnosis
- System Manager
- Ec Topology View
- ADS Interface
- PLC Library
- Network Monitor
Step-by-Step Diagnosis
Summary
19.02.2009 50
EtherCAT Training
TwinCAT&EtherCAT: Setup
19.02.2009 51
EtherCAT Training
TwinCAT&EtherCAT: Setup
Slave address
Link to web
19.02.2009 52
EtherCAT Training
TwinCAT&EtherCAT: Setup
19.02.2009 53
EtherCAT Training
TwinCAT&EtherCAT: Setup
19.02.2009 54
EtherCAT Training
TwinCAT&EtherCAT: Setup
Accessrights
Readable
Parameters
Index/Subindex
19.02.2009 55
EtherCAT Training
TwinCAT&EtherCAT: Setup
Updated list
Select parameter
19.02.2009 56
EtherCAT Training
TwinCAT&EtherCAT: Setup
In the start-up tab you can configure the object. The terminal will be
reconfigured automatically when a replacement occurs, more reliable for the
machine (like Register Communication and KLs terminal).
19.02.2009 57
EtherCAT Training
TwinCAT&EtherCAT: Setup
Slave state
Link state
19.02.2009 58
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Diagnosis
EtherCAT Theory
EtherCAT Features
- Redundancy
General Overview
- Sync Units Diagnosis with TwinCAT System Manager
- Hot Connect
- Distributed Clocks
Diagnosis with TwinCAT Topology View
Diagnosis with ADS
EtherCAT Setup
- Master Setup
Diagnosis with PLC Library
- Slave Setup Advanced Diagnosis with Network Monitor
EtherCAT Diagnosis
- System Manager
- Ec Topology View
- ADS Interface
- PLC Library
- Network Monitor
Step-by-Step Diagnosis
Summary
19.02.2009 59
EtherCAT Training
EtherCAT Diagnosis inside TwinCAT
EtherCAT Theory
System Manager: online overview Slavestatus
EtherCAT Features
- Redundancy
- Sync Units
- Hot Connect Slave-CRC
- Distributed Clocks
EtherCAT Diagnosis
- System Manager
- Ec Topology View
- ADS Interface
- PLC Library
- Network Monitor
Masterstatus
Step-by-Step Diagnosis
Summary Framestatistic
19.02.2009 61
EtherCAT Training
EtherCAT Master/Slave States in TwinCAT System Manager
Experts only:
Additional Debug Info
19.02.2009 62
EtherCAT Training
E-Bus Current Consumption
19.02.2009 63
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Info
process image
Diagnosis Info
Process images
(Number depends on
number of tasks/frames)
19.02.2009 64
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Frame State
Frame
Working Counter
State
Slave Count
X=Frame Number
19.02.2009 65
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Commands
Meaning
APRD Auto Increment Physical Read
NPRD Node-Addressed Physical Read
LRD Logical Read
BRD Broadcast Read
APWR Auto Increment Physical Write
NPWR Node-Addressed Physical Write
LWR Logical Write
BWR Broadcast Write
LRW Logical Read Write
ARMW Auto Increment Physical Read Multiple Write
19.02.2009 67
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
..
19.02.2009 68
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
19.02.2009 69
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 70
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
No difference in information!
Use global information in FrmXWcState or
Use local information direct on the slave!
19.02.2009 71
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Device State
Master
19.02.2009 72
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
19.02.2009 73
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
19.02.2009 74
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
19.02.2009 75
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
19.02.2009 76
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT
Master AmsNetId
19.02.2009 77
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Total
Flow in 1/s
Lost frames
Clear Clear
CRC Counter Frame Statistic
19.02.2009 78
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Object
Directory:
Master Identity
Identity
List of conf. Slaves
List of Slave States
Slave States
19.02.2009 79
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 80
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave 2
Slave n
Slave 3
Slave 4
19.02.2009 81
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Setup
- Master Setup
- Slave Setup
EtherCAT Diagnosis
- System Manager
- Ec Topology View Slave State
- ADS Interface
- PLC Library
- Network Monitor
Step-by-Step Diagnosis
Summary
19.02.2009 82
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Firmware Update
Only in Bootstrap State!
WcState (1 bit)
19.02.2009 83
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
State Machine
Slave State
19.02.2009 84
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
19.02.2009 85
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
19.02.2009 86
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Bit Meaning
19.02.2009 87
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave State: 0x A B C D
19.02.2009 89
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Theory
EtherCAT Topology View
EtherCAT Features
- Redundancy
graphically view to all slaves in right topology
- Sync Units all diagnosistic information directy in one view
- Hot Connect
- Distributed Clocks
uses ADS Interface
detailled information on click
EtherCAT Setup
- Master Setup
ActiveX control: can also be used in your application
- Slave Setup
EtherCAT Diagnosis
- System Manager
- Ec Topology View
- ADS Interface
- PLC Library
- Network Monitor
Step-by-Step Diagnosis
Summary
19.02.2009 90
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Configuration of EtherCAT
TwinCAT System Manager
for offline and online configuration of EtherCAT
19.02.2009 91
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 92
EtherCAT Training
TwinCAT&EtherCAT: Setup
19.02.2009 93
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Missing Slaves
Slave Details
19.02.2009 94
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 95
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 96
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Features
- Redundancy
Communication Interface for EtherCAT Devices
- Sync Units
- Hot Connect
- Distributed Clocks
EtherCAT Master Net Id +
EtherCAT Setup
- Master Setup
Port (0xFFFF for Master, Slave Address for Slave) +
- Slave Setup Index Group +
EtherCAT Diagnosis
Index Offset =
- System Manager
- Ec Topology View
- ADS Interface
Complete Access
- PLC Library
- Network Monitor
Step-by-Step Diagnosis
Summary
19.02.2009 97
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Net Id
19.02.2009 98
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Interface
19.02.2009 99
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 100
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Example:
0x1c120001:
index = 0x1c12
subindex = 1
19.02.2009 101
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 102
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Features
- Redundancy
Uses ADS Interfaces
- Sync Units Same Look-and-Feel for all Functionblocks
- Hot Connect
- Distributed Clocks
EtherCAT Setup
- Master Setup
- Slave Setup
EtherCAT Diagnosis
- System Manager
- Ec Topology View
- ADS Interface
- PLC Library
- Network Monitor
Step-by-Step Diagnosis
Summary
19.02.2009 103
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Name Meaning
19.02.2009 104
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Name Meaning
19.02.2009 105
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Name Meaning
FB_EcGetAllCrcErrors Read CRC-Error Counter from all Slaves
19.02.2009 106
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Name Meaning
FB_EcGetSlaveCrcError Get CRC-Error Counter from one single Slave (for all
single Ports A, B, C)
19.02.2009 107
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Name Meaning
FB_EcGetSlaveState Get EtherCAT State and Link State from one single
Slave
FB_EcReqSlaveState Request a new EtherCAT State for one single Slave
19.02.2009 108
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Name Meaning
19.02.2009 109
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Name Meaning
19.02.2009 110
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Drive as EtherCAT Slave Drive as NC PTP axis
TcDrive.lib TcNcDrive.lib
TcEtherCAT.lib
EtherCAT Master Net Id
EtherCAT Slave Address
Drive Number/Type
19.02.2009 111
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 112
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 113
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Same functionality
19.02.2009 114
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 115
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Theory
Diagnosis Step by Step
EtherCAT Features
- Redundancy
Check FrmXWcState for all Frames (X = 1..n)
- Sync Units Check Master State
- Hot Connect
- Distributed Clocks
If FrmXWcState for Frame X <> 0 then
EtherCAT Setup
- Master Setup
detailed examination necessary
- Slave Setup Check Slave State for all Slave
EtherCAT Diagnosis
reason:
- System Manager Slave Error
- Ec Topology View
- ADS Interface
check Slave
- PLC Library Link Error
- Network Monitor
check cables
Step by Step Diagnosis
Summary
19.02.2009 130
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 131
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 132
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 134
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 135
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Problem?
wrong State?
Link Error?
min. one Slave with wrong State?
19.02.2009 136
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009 137
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Number of Slaves
19.02.2009 138
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EL3142-0000-0000
19.02.2009 139
EtherCAT Training
Summary
EtherCAT Theory
TwinCAT EtherCAT Master means
EtherCAT Features
Easy configuration
- Redundancy
- Sync Units
Powerful diagnosis
- Hot Connect
- Distributed Clocks ADS interface (= TcEtherCAT.lib)
EtherCAT Setup
- Master Setup
- Slave Setup
EtherCAT Diagnosis
- System Manager TwinCAT + EtherCAT = eXtreme Fast Control!
- Ec Topology View
- ADS Interface
- PLC Library
- Network Monitor
Step-by-Step Diagnosis
Summary
19.02.2009 140