Professional Documents
Culture Documents
EtherCAT Training
19.02.2009
EtherCAT Training
Agenda
TwinCAT & EtherCAT
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 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) Bus diagnosis: CRC shows if frame is correct or not CRC for one frame (with one or more datagrams)
19.02.2009
EtherCAT Training
19.02.2009
EtherCAT Training
19.02.2009
EtherCAT Training
SyncUnit = one datagram = one WKC = one special cyclic diagnosis information
19.02.2009
EtherCAT Training
Task with I/O = one Ethernet frame = one to 15 datagrams (one Ethernet frames transports up to 1480 bytes) - If more than 15 datagrams necessary new frame with same timing - If more than 1480 bytes new frame with same timing Default: up to 4 tasks with own I/O - 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
Every Ethernet frame has a Frame Check Sequence (FCS) FCS has a 16bit CRC frames can be destroyed or damaged while running through the network EtherCAT Master sums CRC errors in master and in every slave CRC errors result from - cabling errors - contact problems - loose contacts - not fixed connectors
19.02.2009
11
EtherCAT Training
19.02.2009
12
EtherCAT Training
EtherCAT Features
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
18
EtherCAT Training
Data Exchange
Datagram 0
Datagrams
Datagram 0
EtherCAT Drives
19.02.2009
19
EtherCAT Training
19.02.2009
20
EtherCAT Training
TwinCAT&EtherCAT: Overview
Sync Units
Automatically assigned Sync Units EL67xx Automatically assigned Sync Units Hot Connect groups User defined Sync Units collection of EtherCAT slave i.e. for one part of the machine or for a hot connected part of the network
19.02.2009
21
EtherCAT Training
19.02.2009
22
EtherCAT Training
EtherCAT Training
TwinCAT&EtherCAT: Setup
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
Master Settings
Master Configuration Online: Scan Devices Select EtherCAT Device Offline: Insert EtherCAT Master Device Select and configure network adapter
19.02.2009
38
EtherCAT Training
TwinCAT&EtherCAT: Setup
Master Settings - Adapter
XP: GUID
Experts only:
19.02.2009
39
EtherCAT Training
TwinCAT&EtherCAT: Setup
Master Settings
List of adapters
19.02.2009
40
EtherCAT Training
19.02.2009
41
EtherCAT Training
TwinCAT&EtherCAT: Setup
Master Settings - EtherCAT
Tasks
19.02.2009 42
EtherCAT Training
TwinCAT&EtherCAT: Setup
Master Settings - EtherCAT
Utilization
Commands
Tasks
Topology
19.02.2009 43
EtherCAT Training
TwinCAT&EtherCAT: Setup
19.02.2009
44
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis InfoData Configuration
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis InfoData Configuration
Slave Checks
19.02.2009 46
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009
47
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
19.02.2009
48
EtherCAT Training
TwinCAT&EtherCAT: Setup
States
Masterstate
Slaves
Frame Statistic
19.02.2009
49
EtherCAT Training
TwinCAT&EtherCAT: Setup
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
Slave Settings
Slave Configuration Slaves Configuration Startup Data CANopen over EtherCAT File over EtherCAT Firmware Update (Bootstrap)
19.02.2009
50
EtherCAT Training
TwinCAT&EtherCAT: Setup
Slave Settings EL3102
19.02.2009
51
EtherCAT Training
TwinCAT&EtherCAT: Setup
Slave Settings EL3102 - EtherCAT Autoincrement address
Link to web
19.02.2009 52
EtherCAT Training
TwinCAT&EtherCAT: Setup
Slave Settings EL3102 EtherCAT Advanced Settings
19.02.2009
53
EtherCAT Training
TwinCAT&EtherCAT: Setup
Slave Settings EL3102 Startup List
19.02.2009
54
EtherCAT Training
TwinCAT&EtherCAT: Setup
Slave Settings EL3102 CoE Online
Accessrights
Readable Parameters
Index/Subindex
19.02.2009 55
EtherCAT Training
TwinCAT&EtherCAT: Setup
19.02.2009
56
EtherCAT Training
TwinCAT&EtherCAT: Setup
CoE: CanOverEtherCAT (System Manager)
exemple baudrate EL6001, 9600 Bauds
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 Settings EL3102 Online
Slave state
Link state
19.02.2009
58
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
EtherCAT Diagnosis
General Overview Diagnosis with TwinCAT System Manager Diagnosis with TwinCAT Topology View Diagnosis with ADS Diagnosis with PLC Library Advanced Diagnosis with Network Monitor
19.02.2009
59
EtherCAT Training
ADS = Automation Device Specification EtherCAT Master Port 0xFFFF EtherCAT Slave Port=EC Address EtherCAT Slave Port=EC Address EtherCAT Slave Port=EC Address
19.02.2009 60
EtherCAT Training
TwinCAT&EtherCAT: Overview
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
Slavestatus
Masterstatus Framestatistic
19.02.2009
61
EtherCAT Training
19.02.2009
62
EtherCAT Training
19.02.2009
63
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Process Images
Process images
(Number depends on number of tasks/frames)
19.02.2009
64
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs
Frame State Frame Working Counter State Slave Count For each Frame: FrmXState FrmXWcState X=Frame Number
19.02.2009 65
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis States
One Framestate/Frame
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Commands
Meaning APRD NPRD LRD BRD APWR NPWR LWR BWR LRW ARMW Auto Increment Physical Read Node-Addressed Physical Read Logical Read Broadcast Read Auto Increment Physical Write Node-Addressed Physical Write Logical Write Broadcast Write Logical Read Write Auto Increment Physical Read Multiple Write
19.02.2009 67
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs - FrmXState
Bit 0 (0x0001) 1 (0x0002) 2 (0x0004) .. 14 (0x4000) 15 (0x8000) 15. EtherCAT command not sent complete frame not sent Meaning 1. EtherCAT command not sent 2. EtherCAT command not sent 3. EtherCAT command not sent
19.02.2009
68
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs - FrmXWcState
Bit 0 (0x0001) 1 (0x0002) 2 (0x0004) 14 (0x4000) 15 (0x8000) wrong working counter of 15. EtherCAT command received complete frame missing
19.02.2009 69
Meaning wrong working counter of 1. EtherCAT command received wrong working counter of 2. EtherCAT command received wrong working counter of 3. EtherCAT command received
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs - WcState
19.02.2009
70
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs - WcState
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
Master Diagnosis Inputs - DevState
19.02.2009
72
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs DevState (1/4)
Meaning Link error detected. I/O locked after link error (I/O reset required) Link error (redundancy adapter) Missing one frame (redundancy mode)
19.02.2009
73
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs DevState (2/4)
Meaning Out of send resources (I/O reset required) Watchdog triggered Ethernet driver (miniport) not found I/O reset active
19.02.2009
74
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs DevState (3/4)
Meaning At least one device in 'INIT' state At least one device in 'PRE-OP' state At least one device in 'SAFE-OP' state At least one device indicates an error state
19.02.2009
75
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs DevState (4/4)
Bit 12 (0x1000)
19.02.2009
76
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Diagnosis InfoData
InfoData process images are not updated in every cycle Update on event/change Mappable variables i.e. map NetIds instead of using them directly!
19.02.2009
77
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Cyclic frames (depends on cycletime) Acyclic frames (Mailbox)
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Object Directory: Master Identity
Identity List of conf. Slaves List of Slave States Access via CoE ADS
Configured Slaves
Slave States
19.02.2009 79
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Settings Emergency Scan
Only in Emergency Cases: Only in Config Mode available! Checks Network and looks for Slaves Scans the network slave by slave! Flat List of found Slave (no topology) frame statistic (tests with 10,1000 and more frames) Includes Link Information
19.02.2009
80
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Settings Emergency Scan
Close Ports Slave with error Detected!
Slave 1
Slave 2
1. 2. 3. 4. 5.
Close Ports of Slave x Send Frame Get slave Identity for Slave x x=x+1 Goto 1
Slave n
Slave 3
Slave 4
19.02.2009
81
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
Slave State
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Diagnosis EL3102 + Firmware Update
Firmware Update
Only in Bootstrap State! WcState (1 bit)
19.02.2009 83
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Diagnosis EL3102
State Machine
Slave State
19.02.2009
84
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Diagnosis - State
Meaning Slave in 'INIT' state Slave in 'PREOP' state Slave in 'BOOT' state Slave in 'SAFEOP' state Slave in 'OP' state
19.02.2009
85
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Diagnosis - State
19.02.2009
86
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Diagnosis - State
Meaning Slave not present Slave signals link error Slave signals missing link Slave signals unexpected link
19.02.2009
87
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Diagnosis - State
Bit 0x1000 0x2000 0x4000 0x8000 Meaning Communication port A Communication port B Communication port C Communication port D 2
Port A
1
Port B
2
Port A
1 3
Port B
1 2 4 3
19.02.2009 88
Port C
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Diagnosis - State Slave State: 0x A B C D
Link
Link
Error
State
not present Slave Error Link error Wrong IDs Missing link unexpected link
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
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
Graphical EtherCAT Diagnosis
19.02.2009
92
EtherCAT Training
TwinCAT&EtherCAT: Setup
System Manager: Online Slave Ansicht
19.02.2009
93
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Topology View: Found versus Configured Slaves
Missing Slaves
Slave Details
19.02.2009 94
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Topology View ActiveX Control - Integrated in TwinCAT System Manager
19.02.2009
95
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Topology View ActiveX Control - Integrated in your HMI as ActiveX Control
19.02.2009
96
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
EtherCAT Master Net Id + Port (0xFFFF for Master, Slave Address for Slave) + Index Group + Index Offset = Complete Access
19.02.2009
97
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Net Id
19.02.2009
98
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Interface
ADS Port 65535 (0xFFFF) 0x1 - 0xFFFE (fixed address of a slave device)
Meaning General Ads services handled by the master directly. This is an ADS service directed at an individual slave device. The port number is the same as the EtherCAT address of the slave device.
19.02.2009
99
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Master Interface - Example
Index Group 0x00000003 0x00000006 Index Offset 0x00000100 0x00000000 Meaning Returns current state of master. Returns the number of projected slaves.
19.02.2009
100
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Interface CANopen over EtherCAT
Index Group
Index Offset
Meaning SDO Upload/Download Request. The object is selected with the index offset.
0x0000F302 Index and Subindex of an SDO (coded see InfoSystem!) Example: 0x1c120001: index = 0x1c12 subindex = 1
19.02.2009
101
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Slave Interface Servo Drive over EtherCAT
Index Group
Index Offset
0x0000F420 IDN = LOWORD(0x0000yy yy) HIWORD for special attributes! (coded see InfoSystem!)
19.02.2009
102
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
PLC Functionblocks Overview
Name FB_EcCoeSdoRead Meaning SDO(Service Data Object)-Access Read data from an EtherCAT Slave object directory (Mailbox communication necessary!) SDO-Download Write to EtherCAT Slave object directory
FB_EcCoeSdoWrite
19.02.2009
104
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Overview
Name FB_EcSoeRead Meaning Read Parameter via "Servo Drive Profile over EtherCAT (SoE) (Mailbox communication necessary!) Write Parameter via "Servo Drive Profile over EtherCAT (SoE)
FB_EcSoeWrite
19.02.2009
105
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Overview
Name FB_EcGetAllCrcErrors FB_EcGetAllSlaveAddr FB_EcGetAllSlaveStates Meaning Read CRC-Error Counter from all Slaves Read EtherCAT Addresses from all Slaves Read State and Link State from all Slaves
19.02.2009
106
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Overview
Name FB_EcGetMasterState FB_EcGetSlaveCount Meaning Get State from Master Get Number of Slaves from Master
FB_EcGetSlaveCrcError
Get CRC-Error Counter from one single Slave (for all single Ports A, B, C)
FB_EcGetSlaveIdentity
19.02.2009
107
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Overview
Name FB_EcGetSlaveState FB_EcReqSlaveState Meaning Get EtherCAT State and Link State from one single Slave Request a new EtherCAT State for one single Slave
19.02.2009
108
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Overview
Name FB_EcGetConfSlave Meaning Get list of all configured EtherCAT Slaves
19.02.2009
109
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Overview
Name FB_EcFoeOpen FB_EcFoeAccess FB_EcFoeClose FB_EcFoeLoad Meaning Opens a FileOverEtherCAT (FoE) connection Gives access to FoE connection Closes a FoE connection Loads a file over a FoE connection
19.02.2009
110
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Drive as EtherCAT Slave TcDrive.lib Drive as NC PTP axis TcNcDrive.lib In: CPU Net Id NC Axis Struct
In:
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Example
19.02.2009
112
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Example
19.02.2009
113
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Example
Topology View TcEtherCAT.Lib
Same functionality
Get List of Configured Slaves and get List of Scanned (real existing) Slaves Possible with PLC code!
19.02.2009
114
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
PLC Functionblocks Example
19.02.2009
115
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
130
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with System Manager
19.02.2009
131
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with System Manager
19.02.2009
132
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with System Manager
Check Slave States and CRC Counter Slave in INIT State With wrong VendorID/ProductID/ RevisionNo/SerialNo Slave in INIT State With Comm Error
19.02.2009 133
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with System Manager Check State of one single Slave Slave Error? Link Error?
19.02.2009
134
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with PLC Program
19.02.2009
135
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with PLC Program
Master Problem? wrong State? Link Error? min. one Slave with wrong State?
19.02.2009
136
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with PLC Program
Working Counter Problem? What was the reason for this problem? Check States of all Slaves!
One Struct for each single Slave with Device State and Link State
19.02.2009
137
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with PLC Program
Number of Slaves
Iteration over all Slaves Example: to get the Identity of every Slave
19.02.2009
138
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis
Diagnosis Step-by-Step with PLC Program
Get Identity from a Slave
EL3142-0000-0000
19.02.2009
139
EtherCAT Training
Summary
EtherCAT Theory EtherCAT Features - Redundancy - Sync Units - 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
TwinCAT EtherCAT Master means Easy configuration Powerful diagnosis ADS interface (= TcEtherCAT.lib)
19.02.2009
140