You are on page 1of 105

New Automation Technology

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 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) Bus diagnosis: CRC shows if frame is correct or not CRC for one frame (with one or more datagrams)

19.02.2009

EtherCAT Training

EtherCAT Theory: Working Counter


EtherCAT Diagnosis
In every cycle, synchronous with the cycle - Working Counter checks the reading and/or writing of process data reaction must be done in the application Asynchronous, not in every cycle, event triggered - Master State State Machine of the master Device state - Slave State State Machine Link state

19.02.2009

EtherCAT Training

EtherCAT Theory: Working Counter


WcState
Variable of Type BOOL Shows Working Counter State from one EtherCAT Slave 0 (FALSE) = valid Working Counter 1 (TRUE) = invalid Working Counter 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

EtherCAT Training

EtherCAT Theory: Working Counter


WorkingCounter

EtherCAT datagram = Sub Frame

EtherCAT datagram = Sub Frame

SyncUnit = one datagram = one WKC = one special cyclic diagnosis information

19.02.2009

EtherCAT Training

EtherCAT Theory: Frames


Frames

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

EtherCAT Theory: CRC


Frames

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

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 - 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 Features Sync Units


for independent modules: a module defines a set of process data which is consistent and synchronized combination of data from different slaves: validity of data is important cyclic process data diagnosis for each sync unit if process data in one sync unit is invalid: separate reaction of control application can be defined for Multi-Task-Operation: each Task has own Sync-Unit/Frame (read/write process data in different task cycles) reduces bus load!

19.02.2009

18

EtherCAT Training

EtherCAT Sync Units


Modular Control Structure Bus Diagnostic

Data Exchange

Datagram 0

Datagrams

Process datadiagnostic (1 Bit) Per datagram

Datagram 0

Frame Physical Bus stations


Sync Unit 1

Task 0 Task 1 M EtherCAT I/O

Sync Unit 2 Sync Unit 3

EtherCAT Drives

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 granularity depends on EtherCAT Slaves Each EtherCAT Slave defines one or more process data areas which can be exchanged synchron and consistent The number of independent process data areas depends on the implementation and resources of the EtherCAT Slave Controller (Sync Manager and FMMU channels)

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

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

Datagrams for user defined SyncUnit


19.02.2009 23

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:

Use Device Name Instead of GUID

Search for Not Intel-based Network Adapter CE: fixed name

19.02.2009

39

EtherCAT Training

TwinCAT&EtherCAT: Setup
Master Settings

List of adapters

19.02.2009

40

EtherCAT Training

EtherCAT, driver installation


EtherCAT driver installation im System Manager Compatible device but not installed

Compatible device and installed

19.02.2009

41

EtherCAT Training

TwinCAT&EtherCAT: Setup
Master Settings - EtherCAT

Frames and Datagrams

Tasks
19.02.2009 42

EtherCAT Training

TwinCAT&EtherCAT: Setup
Master Settings - EtherCAT

Utilization

Commands

Length of frame and Working counter

Tasks

Topology
19.02.2009 43

EtherCAT Training

TwinCAT&EtherCAT: Setup

For Advanced users only!

19.02.2009

44

EtherCAT Training

TwinCAT&EtherCAT: Diagnosis
Master Diagnosis InfoData Configuration

Configuration of Info Data

Master Startup Behavior


19.02.2009 45

EtherCAT Training

TwinCAT&EtherCAT: Diagnosis
Master Diagnosis InfoData Configuration

Slave State Machine

Slave Configurations for all slaves in network!

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 Later on Setting for Ethernet over EtherCAT (EoE)

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

Slave address To fix the address

Link to web
19.02.2009 52

EtherCAT Training

TwinCAT&EtherCAT: Setup
Slave Settings EL3102 EtherCAT Advanced Settings

Rev Number compared to configured slave

19.02.2009

53

EtherCAT Training

TwinCAT&EtherCAT: Setup
Slave Settings EL3102 Startup List

Add new Startup Parameter

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

Updated list Select parameter

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).

0x0006 = 9600 Bauds

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

EtherCAT Diagnosis inside TwinCAT


TwinCAT System Manager EtherCAT Topology View TwinCAT TcEtherCAT.lib

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

System Manager: online overview

Slavestatus

Slave-CRC Port A, B, C, (D)

Masterstatus 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
Master Diagnosis Process Images

Info process image Diagnosis Info

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

Device State Master

EtherCAT Training

TwinCAT&EtherCAT: Diagnosis
Master Diagnosis States

One Framestate/Frame

Frame with Datagrams

EtherCAT Working Counter


19.02.2009 66

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

Device State Master

19.02.2009

72

EtherCAT Training

TwinCAT&EtherCAT: Diagnosis
Master Diagnosis Inputs DevState (1/4)

Bit 0 (0x0001) 1 (0x0002) 2 (0x0004) 3 (0x0008)

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)

Bit 4 (0x0010) 5 (0x0020) 6 (0x0040) 7 (0x0080)

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)

Bit 8 (0x0100) 9 (0x0200) 10 (0x0400) 11 (0x0800)

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)

Meaning DC not in sync (DC = distributed clocks)

19.02.2009

76

EtherCAT Training

TwinCAT&EtherCAT: Diagnosis
Master Diagnosis InfoData

EtherCAT Master AmsNetId

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)

Total Flow in 1/s Lost frames

Rx / Tx, layer 0 CRC Intel Chipset

Clear CRC Counter

Clear 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 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 Diagnosis EL3102

Slave Info Data

Slave State

Slave AMS Net Id


19.02.2009 82

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

Bit 0x___1 0x___2 0x___3 0x___4 0x___8

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

Bit 0x0010 0x0020

Meaning Slave signals error Invalid vendorId, productCode... read

19.02.2009

86

EtherCAT Training

TwinCAT&EtherCAT: Diagnosis
Slave Diagnosis - State

Bit 0x0100 0x0200 0x0400 0x0800

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

port A port B port C port D

not present Slave Error Link error Wrong IDs Missing link unexpected link

INIT PREOP BOOT SAFEOP OP


19.02.2009 89

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 Topology View


graphically view to all slaves in right topology all diagnosistic information directy in one view uses ADS Interface detailled information on click ActiveX control: can also be used in your application

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

Online Slave State

Online CRC Count

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

ADS Interface to EtherCAT Master/Slave


Communication Interface for EtherCAT Devices

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.

Documentation of all ADS IndexGroup/IndexOffset: See Beckhoff InformationSystem

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

Meaning Upload/Download IDN

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

PLC Functionblocks for EtherCAT Master/Slave


Uses ADS Interfaces Same Look-and-Feel for all Functionblocks

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

Get CANopen Identity from one single Slave

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

FB_EcGetScannedSlaves Get list of all scanned (real existing) 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 Master Net Id EtherCAT Slave Addr Drive Number/Type

TcEtherCAT.lib EtherCAT Master Net Id EtherCAT Slave Address Drive Number/Type


19.02.2009 111

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

Diagnosis Step by Step


Check FrmXWcState for all Frames (X = 1..n) Check Master State If FrmXWcState for Frame X <> 0 then detailed examination necessary Check Slave State for all Slave reason: Slave Error check Slave Link Error check cables

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

Slave in INIT State With Error

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

Link with PLC Variables!

Link with PLC Variable!

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)

TwinCAT + EtherCAT = eXtreme Fast Control!

19.02.2009

140

You might also like