Version 1.8
Date: 2017-11-14
Application Note ET9300
(EtherCAT Slave Stack Code)
II Application Note ET9300
LEGAL NOTICE
Trademarks
Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE® and
XFC® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third
parties for their own purposes could violate the rights of the owners.
Patent Pending
The EtherCAT Technology is covered, including but not limited to the following
German patent applications and patents: DE10304637, DE102004044764,
DE102005009224, DE102007017835 with corresponding applications or
registrations in various other countries.
Disclaimer
The documentation has been prepared with care. The products described are,
however, constantly under development. For that reason the documentation is not in
every case checked for consistency with performance data, standards or other
characteristics. In the event that it contains technical or editorial errors, we retain the
right to make alterations at any time and without warning. No claims for the
modification of products that have already been supplied may be made on the basis
of the data, diagrams and descriptions in this documentation.
Copyright
© Beckhoff Automation GmbH
The reproduction, distribution and utilization of this document as well as the
communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the
event of the grant of a patent, utility model or design.
Application Note ET9300 1
DOCUMENT HISTORY
Version
Comment
1.0
Start document
1.1
Chapter 4 “Hardware access”.
Define descriptions; prototypes changed
1.2
Add chapter 5 Application
Add chapter 9 Tool
Add chapter 9 TestApplication
Enhance Hardware access (chapter 4)
update name references
Enhance EoE chapter
1.3
TestApplication; chapter9 :Update object/entry description (0x2020.1, 0x3003, 0x3004 and
0x3007)
Update “HW_GetTimer()” description
SSC Tool: Edit file information
Update SSC Structure
Add “Find Setting” dialog description
Update naming in Object chapter
1.4
SSCTool:
- Remove Wizard
- Add Configuration handling
1.5
Editorial changes
Add “Getting Started” chapter
Add description for hardware adaption
Test Application:
- Add new test description
- Enhance/update application description
- Describe mechanism to control the behaviors
Enhance Application chapter
- Add setting description
- Interface variables
- Guide to create an application
Add “Synchronization” chapter
Hardware chapter: Sync1_Isr() description added
Update SSC configuration references
Add “EEPROM Handling” chapter
- EEPORM Emulation
- EEPROM Programming
1.6
Editorial changes
Update object list of test application
Update SSC Tool description (chapter 12) according version 1.3.1
1.7
Chapter 6.4.1 : Add offline object dictionary enhancement
Add new mailbox test behaviors
Indicate obsolete hardware functions
Editorial changes
Update SSC Tool screenshots and GUI description
Add further test object in the test application
Add object design rules
Update references if TwinCAT 3 is used
Add SSC OD Tool description
Add optional EEPROM interface functions.
Add Bootloader information
1.8
Update synchronization chapter (describe the timing measurement feature)
Add an EtherCAT state machine chapter
Add EoE application interface description
Add Backup Parameter function list and function calls.
Enhance FoE description and add FoE callback functions.
Add examples how to define an application
Add application parser CoE callback infos
Update EEPROM emulation infos
Testapplication : enhance object 0x3001 to test real and 64bit datatypes
Add clause “Process Data” and “EtherCAT State Machine”
Add clause Slave Identification
Application Note ET9300 3
CONTENTS
1 References 9
2 Terms, Definition, Abbreviation 10
2.1 Abbreviation 10
3 Getting Started 11
3.1 SSC Tool 11
3.2 Default SSC files 11
4 Code Structure 13
4.1 Execution structure 14
4.2 Interrupt handling 15
4.3 Process data handling 16
5 Hardware Access 18
5.1 Interrupt Handler 22
5.2 Interface Functions/Macros 23
5.2.1 Generic 23
5.2.2 Read Access 26
5.2.3 Write Access 30
6 Application 33
6.1 SSC Functions 33
6.2 Interface Functions 35
6.2.1 Generic 35
6.2.2 EtherCAT State Machine 37
6.2.3 Process data handling 39
6.2.4 Mailbox handling 39
6.3 Interface Variables 44
6.4 Create an Application 45
6.4.1 Examples 45
7 Objects 56
7.1 Structure/Alignment Rules 56
7.2 Define local memory 57
7.3 Entry descriptions 57
7.4 Object name 58
7.5 Object description 59
7.6 Index Ranges 60
7.7 Implementation examples 61
7.7.1 Usage of Object Deftype ENUM 61
8 Mailbox 63
8.1 CoE (CAN application protocol over EtherCAT) 63
8.1.1 Backup Parameter support 63
8.2 FoE (File Transfer over EtherCAT) 65
8.2.1 Testing FoE 65