Sunteți pe pagina 1din 105

New Automation Technology

EtherCAT Training

19.02.2009 1
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 6
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 7
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 8
EtherCAT Training
EtherCAT Theory: Working Counter

WorkingCounter

EtherCAT datagram EtherCAT datagram


= Sub Frame = Sub Frame

SyncUnit = one datagram = one WKC =


one special cyclic diagnosis information

19.02.2009 9
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 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

Task 0 Sync Unit 2


Sync Unit 3
Task 1
M
M M
EtherCAT I/O 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
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

Master Settings - Adapter

XP: GUID

Experts only:

Use Device Name Search for


Instead of GUID 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
Tasks
Datagrams
19.02.2009 42
EtherCAT Training
TwinCAT&EtherCAT: Setup

Master Settings - EtherCAT

Utilization

Length of frame and


Commands Tasks Topology
Working counter
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
Setting for Ethernet
Later on
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
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

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

TwinCAT System Manager EtherCAT Topology View TwinCAT TcEtherCAT.lib

ADS = Automation Device Specification

EtherCAT EtherCAT Slave EtherCAT Slave EtherCAT Slave


Master Port=EC Port=EC Port=EC
Port 0xFFFF Address Address Address
19.02.2009 60
EtherCAT Training
TwinCAT&EtherCAT: Overview

EtherCAT Theory
System Manager: online overview Slavestatus
EtherCAT Features
- Redundancy
- Sync Units
- Hot Connect Slave-CRC
- Distributed Clocks

EtherCAT Setup Port A, B, C, (D)


- Master Setup
- Slave Setup

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

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: Device State


FrmXState Master
FrmXWcState

X=Frame Number
19.02.2009 65
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Master Diagnosis States

One Frame with EtherCAT


Framestate/Frame Datagrams Working Counter
19.02.2009 66
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

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

19.02.2009 73
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Master Diagnosis Inputs DevState (2/4)

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

19.02.2009 74
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Master Diagnosis Inputs DevState (3/4)

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

19.02.2009 75
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Master Diagnosis Inputs DevState (4/4)

Bit Meaning

12 (0x1000) 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 Acyclic frames


(depends on (Mailbox)
cycletime)

Total
Flow in 1/s
Lost frames

Rx / Tx, layer 0 CRC Intel


Chipset

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

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

Slave with error


Close Ports Detected!
Slave 1

Slave 2

Slave n
Slave 3

Slave 4

1. Close Ports of Slave x


2. Send Frame
3. Get slave Identity for Slave x
4. x=x+1
5. Goto 1

19.02.2009 81
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis EL3102


EtherCAT Theory Slave Info Data
EtherCAT Features
- Redundancy
- Sync Units
- Hot Connect
- Distributed Clocks

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

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 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
TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis - State

Bit Meaning

0x0010 Slave signals error

0x0020 Invalid vendorId, productCode... read

19.02.2009 86
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis - State

Bit Meaning

0x0100 Slave not present

0x0200 Slave signals link error

0x0400 Slave signals missing link

0x0800 Slave signals unexpected link

19.02.2009 87
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis - State


Bit Meaning

0x1000 Communication port A

0x2000 Communication port B

0x4000 Communication port C

0x8000 Communication port D

Port A Port B Port A Port B


1
1 4
1 2 2
3
Port C 3
19.02.2009 88
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Slave Diagnosis - State

Slave State: 0x A B C D

Link Link Error State


port A not present Slave Error INIT
port B Link error Wrong IDs PREOP
port C Missing link BOOT
port D unexpected link SAFEOP
OP

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

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

ADS Interface to EtherCAT Master/Slave


EtherCAT Theory

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

ADS Port Meaning

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

0x1 - 0xFFFE This is an ADS service directed at an individual slave


(fixed address device. The port number is the same as the EtherCAT
of a slave address of the slave device.
device)

19.02.2009 99
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Master Interface - Example

Index Index Meaning


Group Offset
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
TwinCAT&EtherCAT: Diagnosis

Slave Interface CANopen over EtherCAT

Index Index Meaning


Group Offset
0x0000F302 Index and Subindex SDO Upload/Download Request. The
of an SDO (coded object is selected with the index
see InfoSystem!) offset.

Example:
0x1c120001:
index = 0x1c12
subindex = 1

19.02.2009 101
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

Slave Interface Servo Drive over EtherCAT

Index Index Meaning


Group Offset
0x0000F420 IDN = Upload/Download IDN
LOWORD(0x0000yy
yy)
HIWORD for special
attributes!
(coded see
InfoSystem!)

19.02.2009 102
EtherCAT Training
TwinCAT&EtherCAT: Diagnosis

PLC Functionblocks for EtherCAT Master/Slave


EtherCAT Theory

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

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


Slaves

19.02.2009 109
EtherCAT Training
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
TwinCAT&EtherCAT: Diagnosis
Drive as EtherCAT Slave Drive as NC PTP axis
TcDrive.lib TcNcDrive.lib

In: EtherCAT Master Net Id In: CPU Net Id


EtherCAT Slave Addr NC Axis Struct
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
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

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

S-ar putea să vă placă și