105
19.02.2009 1 New Automation Technology EtherCAT Training

TwinCAT EC Diag Eng 21

Embed Size (px)

DESCRIPTION

TwinCat EtherCat diagnostics

Citation preview

Page 1: TwinCAT EC Diag Eng 21

19.02.2009 1

New Automation Technology

EtherCAT Training

Page 2: TwinCAT EC Diag Eng 21

Agenda

TwinCAT & EtherCAT

§ EtherCAT Theory§ EtherCAT Features

§ Sync Units§ Hot Connect§ Distributed Clocks

§ TwinCAT Integration§ EtherCAT Setup§ EtherCAT Diagnosis

Dr. Josef PapenfortTwinCAT Product Management

[email protected]

19.02.2009 2

EtherCAT Training

Page 3: TwinCAT EC Diag Eng 21

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)

EtherCAT Theory: Addresses

19.02.2009 5

EtherCAT Training

Page 4: TwinCAT EC Diag Eng 21

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 6

EtherCAT Training

Page 5: TwinCAT EC Diag Eng 21

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

EtherCAT Theory: Working Counter

19.02.2009 7

EtherCAT Training

Page 6: TwinCAT EC Diag Eng 21

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 forupdating 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 Countererror.

19.02.2009 8

EtherCAT Training

Page 7: TwinCAT EC Diag Eng 21

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 9

EtherCAT Training

Page 8: TwinCAT EC Diag Eng 21

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

Page 9: TwinCAT EC Diag Eng 21

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

Page 10: TwinCAT EC Diag Eng 21

EtherCAT Theory: CRC

Frames

frequency of occurrenceon Port A of

Slaveà

Possible Error detected!

19.02.2009 12

EtherCAT Training

Page 11: TwinCAT EC Diag Eng 21

EtherCAT Features

EtherCAT Features – Sync Units

§ for independent modules: a module defines a set of process datawhich is consistent and synchronized

§ combination of data from different slaves: validity of data isimportant

§ cyclic process data diagnosis for each sync unit

§ if process data in one sync unit is invalid: separate reaction ofcontrol application can be defined

§ for Multi-Task-Operation: each Task has own Sync-Unit/Frame(read/write process data in different task cycles) à reduces busload!

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

Page 12: TwinCAT EC Diag Eng 21

EtherCAT Sync UnitsBus Diagnostic

Process data-diagnostic (1 Bit)

Per datagram

Task 0

Task 1

M

EtherCAT I/O EtherCAT DrivesM

Mod

ular

Con

trol

Stru

ctur

eD

ata

Exch

ange

Phys

ical

Bus

sta

tions

Datagram 0

t

Sync Unit 1Sync Unit 2Sync Unit 3

M

Datagrams Datagram 0

Frame

19.02.2009 19

EtherCAT Training

Page 13: TwinCAT EC Diag Eng 21

EtherCAT Sync Units

§ Useful for applications with machine parts which can be out of order (planned orunplanned) and the rest of the machine should work. àSync Units help to structurethese applications

§ granularity depends on EtherCAT Slaves

§ Each EtherCAT Slave defines one or more process data areas which can beexchanged synchron and consistent

§ The number of independent process data areas depends on the implementationand resources of the EtherCAT Slave Controller (Sync Manager and FMMUchannels)

19.02.2009 20

EtherCAT Training

Page 14: TwinCAT EC Diag Eng 21

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

Page 15: TwinCAT EC Diag Eng 21

EtherCAT Sync Units in TwinCAT System Manager

PLC TaskStandard

NC Task

PLC TaskFast

User definedSync Unit

19.02.2009 22

EtherCAT Training

Page 16: TwinCAT EC Diag Eng 21

EtherCAT Sync Units in TwinCAT System Manager

Datagrams for user defined SyncUnit

19.02.2009 23

EtherCAT Training

Page 17: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Master Settings

§ Master Configuration§ Online: Scan Devices§ Select EtherCAT Device

§ Offline: Insert EtherCAT Master Device§ Select and configure network adapter

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 38

EtherCAT Training

Page 18: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Master Settings - Adapter

Experts only:

Use Device NameInstead of GUID

Search for Not Intel-based Network Adapter

XP: GUID

CE: fixed name

19.02.2009 39

EtherCAT Training

Page 19: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Master Settings

List of adapters

19.02.2009 40

EtherCAT Training

Page 20: TwinCAT EC Diag Eng 21

EtherCAT, driver installation

EtherCAT driver installationim System Manager Compatible device but not installed

Compatible device and installed

19.02.2009 41

EtherCAT Training

Page 21: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Master Settings - EtherCAT

TasksFrames and Datagrams

19.02.2009 42

EtherCAT Training

Page 22: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Master Settings - EtherCAT

Tasks TopologyLength of frame andWorking counter

Utilization

Commands

19.02.2009 43

EtherCAT Training

Page 23: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

For Advanced users only!

19.02.2009 44

EtherCAT Training

Page 24: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Diagnosis – InfoData Configuration

Configuration of Info Data

Master StartupBehavior

19.02.2009 45

EtherCAT Training

Page 25: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Diagnosis – InfoData Configuration

Configuration of SlaveInfo Data Slave Checks

Slave StateMachine

Slave Configurations for all slaves in network!

19.02.2009 46

EtherCAT Training

Page 26: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Actual Tasks

Sync Task Configuration

(max. 4 Tasks)

RepeatedFrames

(only with some Slaves!)

19.02.2009 47

EtherCAT Training

Page 27: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Setting for Ethernet over EtherCAT (EoE)

Supplement

Later on

19.02.2009 48

EtherCAT Training

Page 28: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Slaves

States

Masterstate

Frame Statistic

19.02.2009 49

EtherCAT Training

Page 29: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Slave Settings

§ Slave Configuration§ Slaves Configuration§ Startup Data§ CANopen over EtherCAT§ File over EtherCAT§ Firmware Update (Bootstrap)

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 50

EtherCAT Training

Page 30: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Slave Settings – EL3102

19.02.2009 51

EtherCAT Training

Page 31: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Slave Settings – EL3102 - EtherCATAutoincrement

address

Slave address

To fix the address

Link to web

19.02.2009 52

EtherCAT Training

Page 32: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Slave Settings – EL3102 – EtherCAT – Advanced Settings

Rev Number compared to configured slave

19.02.2009 53

EtherCAT Training

Page 33: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Slave Settings – EL3102 – Startup List

Add new Startup Parameter

19.02.2009 54

EtherCAT Training

Page 34: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Slave Settings – EL3102 – CoE Online

Index/Subindex

Accessrights

Readable Parameters

19.02.2009 55

EtherCAT Training

Page 35: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Select parameter

Updated list

19.02.2009 56

EtherCAT Training

Page 36: TwinCAT EC Diag Eng 21

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

TwinCAT&EtherCAT: Setup

19.02.2009 57

EtherCAT Training

Page 37: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Setup

Slave Settings – EL3102 – Online

Slave state

Link state

19.02.2009 58

EtherCAT Training

Page 38: TwinCAT EC Diag Eng 21

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

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 59

EtherCAT Training

TwinCAT&EtherCAT: Diagnosis

Page 39: TwinCAT EC Diag Eng 21

EtherCAT Diagnosis inside TwinCAT

EtherCAT MasterPort 0xFFFF

EtherCAT SlavePort=EC Address

EtherCAT SlavePort=EC Address

EtherCAT SlavePort=EC Address

ADS = Automation Device Specification

TwinCAT System Manager EtherCAT Topology View TwinCAT TcEtherCAT.lib

19.02.2009 60

EtherCAT Training

Page 40: TwinCAT EC Diag Eng 21

System Manager: online overview Slavestatus

Slave-CRC

Port A, B, C, (D)

Masterstatus

Framestatistic

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

19.02.2009 61

EtherCAT Training

Page 41: TwinCAT EC Diag Eng 21

EtherCAT Master/Slave States in TwinCAT System Manager

Experts only: Additional Debug Info

19.02.2009 62

EtherCAT Training

Page 42: TwinCAT EC Diag Eng 21

E-Bus Current Consumption

19.02.2009 63

EtherCAT Training

Page 43: TwinCAT EC Diag Eng 21

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

Page 44: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Diagnosis – Inputs

For each Frame:§ FrmXState§ FrmXWcState

X=Frame Number

Frame State

Frame Working Counter

State

Slave Count

Device State Master

19.02.2009 65

EtherCAT Training

Page 45: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Diagnosis – States

EtherCAT Working Counter

Frame withDatagrams

One Framestate/Frame

19.02.2009 66

EtherCAT Training

Page 46: TwinCAT EC Diag Eng 21

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

Page 47: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Diagnosis – Inputs - FrmXState

Bit Meaning

0 (0x0001) 1. EtherCAT command not sent

1 (0x0002) 2. EtherCAT command not sent

2 (0x0004) 3. EtherCAT command not sent

…..

14 (0x4000) 15. EtherCAT command not sent

15 (0x8000) complete frame not sent

19.02.2009 68

EtherCAT Training

Page 48: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Diagnosis – Inputs - FrmXWcState

Bit Meaning

0 (0x0001) wrong working counter of 1. EtherCAT command received

1 (0x0002) wrong working counter of 2. EtherCAT command received

2 (0x0004) wrong working counter of 3. EtherCAT command received

14 (0x4000) wrong working counter of 15. EtherCAT command received

15 (0x8000) complete frame missing

19.02.2009 69

EtherCAT Training

Page 49: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Diagnosis – Inputs - WcState

19.02.2009 70

EtherCAT Training

Page 50: TwinCAT EC Diag Eng 21

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

Page 51: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Diagnosis – Inputs - DevState

Device State Master

19.02.2009 72

EtherCAT Training

Page 52: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Bit Meaning

0 (0x0001) Link error detected.

1 (0x0002) I/O locked after link error (I/O reset required)

2 (0x0004) Link error (redundancy adapter)

3 (0x0008) Missing one frame (redundancy mode)

Master Diagnosis – Inputs – DevState (1/4)

19.02.2009 73

EtherCAT Training

Page 53: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Bit Meaning

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

5 (0x0020) Watchdog triggered

6 (0x0040) Ethernet driver (miniport) not found

7 (0x0080) I/O reset active

Master Diagnosis – Inputs – DevState (2/4)

19.02.2009 74

EtherCAT Training

Page 54: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Bit Meaning

8 (0x0100) At least one device in 'INIT' state

9 (0x0200) At least one device in 'PRE-OP' state

10 (0x0400) At least one device in 'SAFE-OP' state

11 (0x0800) At least one device indicates an error state

Master Diagnosis – Inputs – DevState (3/4)

19.02.2009 75

EtherCAT Training

Page 55: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Bit Meaning

12 (0x1000) DC not in sync (DC = distributed clocks)

Master Diagnosis – Inputs – DevState (4/4)

19.02.2009 76

EtherCAT Training

Page 56: TwinCAT EC Diag Eng 21

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

Page 57: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Clear Frame Statistic

Clear CRC Counter

Cyclic frames (depends on cycletime)

Acyclic frames (Mailbox)

Lost framesFlow in 1/sTotal

Rx / Tx, layer 0 CRC Intel Chipset

19.02.2009 78

EtherCAT Training

Page 58: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Object Directory:

§ Identity§ List of conf. Slaves§ List of Slave States

§ Access via CoEà ADS

Master Identity

Configured Slaves

Slave States

19.02.2009 79

EtherCAT Training

Page 59: TwinCAT EC Diag Eng 21

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

Page 60: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Settings – Emergency Scan

Close Ports

Slav

e 1

Slav

e 2

Slav

e 3

Slav

e 4

Slav

e n

1. Close Ports of Slave x2. Send Frame3. Get slave Identity for Slave x4. x=x+1 5. Goto 1

Slave with errorDetected!

19.02.2009 81

EtherCAT Training

Page 61: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis – EL3102 Slave Info Data

Slave State

Slave AMS Net Id

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 82

EtherCAT Training

Page 62: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis – EL3102 + Firmware Update

WcState (1 bit)

Firmware UpdateOnly in Bootstrap State!

19.02.2009 83

EtherCAT Training

Page 63: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis – EL3102

Slave State

State Machine

19.02.2009 84

EtherCAT Training

Page 64: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis - State

Bit Meaning

0x___1 Slave in 'INIT' state

0x___2 Slave in 'PREOP' state

0x___3 Slave in 'BOOT' state

0x___4 Slave in 'SAFEOP' state

0x___8 Slave in 'OP' state

19.02.2009 85

EtherCAT Training

Page 65: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Bit Meaning

0x0010 Slave signals error

0x0020 Invalid vendorId, productCode... read

Slave Diagnosis - State

19.02.2009 86

EtherCAT Training

Page 66: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Bit Meaning

0x0100 Slave not present

0x0200 Slave signals link error

0x0400 Slave signals missing link

0x0800 Slave signals unexpected link

Slave Diagnosis - State

19.02.2009 87

EtherCAT Training

Page 67: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Bit Meaning

0x1000 Communication port A

0x2000 Communication port B

0x4000 Communication port C

0x8000 Communication port D

Slave Diagnosis - State

Port A Port B Port A Port B

Port C1 2 2

1

31

2

3

4

19.02.2009 88

EtherCAT Training

Page 68: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis - State

Slave State: 0x A B C D

State• INIT• PREOP• BOOT• SAFEOP• OP

Error• Slave Error• Wrong IDs

Link• not present• Link error• Missing link• unexpected link

Link• port A• port B• port C• port D

19.02.2009 89

EtherCAT Training

Page 69: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

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

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

Page 70: TwinCAT EC Diag Eng 21

Configuration of EtherCAT§ TwinCAT System Manager§ for offline and online configuration of EtherCAT

TwinCAT&EtherCAT: Diagnosis

19.02.2009 91

EtherCAT Training

Page 71: TwinCAT EC Diag Eng 21

Graphical EtherCAT Diagnosis

TwinCAT&EtherCAT: Diagnosis

Online Slave State

Online CRC Count

19.02.2009 92

EtherCAT Training

Page 72: TwinCAT EC Diag Eng 21

System Manager: Online Slave Ansicht

TwinCAT&EtherCAT: Setup

19.02.2009 93

EtherCAT Training

Page 73: TwinCAT EC Diag Eng 21

EtherCAT Topology View: Found versus Configured Slaves

Missing Slaves

Slave Details

TwinCAT&EtherCAT: Diagnosis

19.02.2009 94

EtherCAT Training

Page 74: TwinCAT EC Diag Eng 21

EtherCAT Topology View ActiveX Control- Integrated in TwinCAT System Manager

TwinCAT&EtherCAT: Diagnosis

19.02.2009 95

EtherCAT Training

Page 75: TwinCAT EC Diag Eng 21

EtherCAT Topology View ActiveX Control- Integrated in your HMI as ActiveX Control

TwinCAT&EtherCAT: Diagnosis

19.02.2009 96

EtherCAT Training

Page 76: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

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

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 97

EtherCAT Training

Page 77: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Net Id

19.02.2009 98

EtherCAT Training

Page 78: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Interface

ADS Port Meaning

65535 (0xFFFF) General Ads services handled by the master directly.

0x1 - 0xFFFE (fixed address of a slave device)

This is an ADS service directed at an individual slave device. The port number is the same as the EtherCATaddress of the slave device.

19.02.2009 99

EtherCAT Training

Page 79: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Master Interface - Example

IndexGroup

Index Offset

Meaning

0x00000003 0x00000100 Returns current state of master.

0x00000006 0x00000000 Returns the number of projected slaves.

Documentation of all ADS IndexGroup/IndexOffset: See Beckhoff InformationSystem

19.02.2009 100

EtherCAT Training

Page 80: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Slave Interface – CANopen over EtherCAT

IndexGroup

Index Offset

Meaning

0x0000F302 Index and Subindex of an SDO (coded see InfoSystem!)

Example:0x1c120001:index = 0x1c12

subindex = 1

SDO Upload/Download Request. The object is selected with the index offset.

19.02.2009 101

EtherCAT Training

Page 81: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Slave Interface – Servo Drive over EtherCAT

IndexGroup

Index Offset

Meaning

0x0000F420 IDN = LOWORD(0x0000yyyy)HIWORD for special attributes!

(coded see InfoSystem!)

Upload/Download IDN

19.02.2009 102

EtherCAT Training

Page 82: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks for EtherCAT Master/Slave

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

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

Page 83: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Overview

Name Meaning

FB_EcCoeSdoRead SDO(Service Data Object)-Access Read data from an EtherCAT Slave object directory (Mailbox communication necessary!)

FB_EcCoeSdoWrite SDO-Download Write to EtherCAT Slave object directory

19.02.2009 104

EtherCAT Training

Page 84: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Overview

Name Meaning

FB_EcSoeRead Read Parameter via "Servo Drive Profile over EtherCAT“ (SoE)

(Mailbox communication necessary!)FB_EcSoeWrite Write Parameter via "Servo Drive Profile over

EtherCAT“ (SoE)

19.02.2009 105

EtherCAT Training

Page 85: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Overview

Name Meaning

FB_EcGetAllCrcErrors Read CRC-Error Counter from all Slaves

FB_EcGetAllSlaveAddr Read EtherCAT Addresses from all Slaves

FB_EcGetAllSlaveStates Read State and Link State from all Slaves

19.02.2009 106

EtherCAT Training

Page 86: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Overview

Name Meaning

FB_EcGetMasterState Get State from Master

FB_EcGetSlaveCount 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

Page 87: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Overview

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

Page 88: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Overview

Name Meaning

FB_EcGetConfSlave Get list of all configured EtherCAT Slaves

FB_EcGetScannedSlaves Get list of all scanned (real existing) EtherCATSlaves

19.02.2009 109

EtherCAT Training

Page 89: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Overview

Name Meaning

FB_EcFoeOpen Opens a FileOverEtherCAT (FoE) connection

FB_EcFoeAccess Gives access to FoE connection

FB_EcFoeClose Closes a FoE connection

FB_EcFoeLoad Loads a file over a FoE connection

19.02.2009 110

EtherCAT Training

Page 90: TwinCAT EC Diag Eng 21

Drive as NC PTP axisTcNcDrive.lib

Drive as EtherCAT SlaveTcDrive.lib

TcEtherCAT.lib

In: CPU Net IdNC Axis Struct

In: EtherCAT Master Net IdEtherCAT Slave AddrDrive Number/Type

EtherCAT Master Net IdEtherCAT Slave AddressDrive Number/Type

TwinCAT&EtherCAT: Diagnosis

19.02.2009 111

EtherCAT Training

Page 91: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Example

19.02.2009 112

EtherCAT Training

Page 92: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Example

19.02.2009 113

EtherCAT Training

Page 93: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Example

Get List of Configured Slaves and get List of Scanned (real existing) Slaves

à Possible with PLC code!

Topology View TcEtherCAT.Lib

Same functionality

19.02.2009 114

EtherCAT Training

Page 94: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks – Example

19.02.2009 115

EtherCAT Training

Page 95: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

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

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

Page 96: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Diagnosis Step-by-Step with System Manager

19.02.2009 131

EtherCAT Training

Page 97: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Diagnosis Step-by-Step with System Manager

19.02.2009 132

EtherCAT Training

Page 98: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Diagnosis Step-by-Step with System Manager

Check Slave States and CRC Counter

Slave in INIT StateWith Error

Slave in INIT StateWith wrong

VendorID/ProductID/ RevisionNo/SerialNo

Slave in INIT StateWith Comm Error

19.02.2009 133

EtherCAT Training

Page 99: TwinCAT EC Diag Eng 21

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

Page 100: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Diagnosis Step-by-Step with PLC Program

Link with PLC Variables!

Link with PLC Variable!

19.02.2009 135

EtherCAT Training

Page 101: TwinCAT EC Diag Eng 21

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

Page 102: TwinCAT EC Diag Eng 21

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

Page 103: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Diagnosis Step-by-Step with PLC Program

Number of Slaves

Iteration over all SlavesExample: to get the Identity of every Slave

19.02.2009 138

EtherCAT Training

Page 104: TwinCAT EC Diag Eng 21

TwinCAT&EtherCAT: Diagnosis

Diagnosis Step-by-Step with PLC ProgramGet Identity from a Slave

EL3142-0000-0000

19.02.2009 139

EtherCAT Training

Page 105: TwinCAT EC Diag Eng 21

Summary

§ TwinCAT EtherCAT Master means§ Easy configuration§ Powerful diagnosis§ ADS interface (= TcEtherCAT.lib)

§ TwinCAT + EtherCAT = eXtreme Fast Control!

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 140

EtherCAT Training