EtherCAT Slave V5 Protocol API 01 EN
EtherCAT Slave V5 Protocol API 01 EN
EtherCAT Slave
V5.1.0
Table of contents
1 Introduction............................................................................................................................................. 5
1.1 About this document ...................................................................................................................... 5
1.1.1 List of revisions .................................................................................................................................. 5
1.2 Functional overview ....................................................................................................................... 5
1.3 System requirements ..................................................................................................................... 5
1.4 Intended audience.......................................................................................................................... 5
1.5 Technical data ................................................................................................................................ 6
1.6 Terms, abbreviations and definitions ............................................................................................. 8
1.7 References to documents .............................................................................................................. 9
2 Getting started ...................................................................................................................................... 10
2.1 Loadable Firmware (LFW) ........................................................................................................... 10
2.2 Configuration ................................................................................................................................ 10
2.2.1 Configuration methods .................................................................................................................... 10
2.2.2 Sequence and priority of configuration evaluation ........................................................................... 10
2.2.3 Configuration parameters ................................................................................................................ 11
2.2.4 Application sets the configuration parameters ................................................................................. 12
2.2.4.1 Reconfiguration .............................................................................................................. 13
2.2.4.2 Delete configuration ........................................................................................................ 14
2.2.4.3 Configuration lock ........................................................................................................... 14
2.2.5 Configuration software..................................................................................................................... 14
2.3 Cyclic data exchange - Process data input and output ................................................................ 14
2.3.1 Bus On / Bus Off ............................................................................................................................. 14
2.4 Acyclic data exchange ................................................................................................................. 15
2.5 Object Dictionary .......................................................................................................................... 16
3 Stack structure and stack functions .................................................................................................. 17
3.1 Structure of the EtherCAT Slave stack ........................................................................................ 17
3.2 Base function ............................................................................................................................... 19
3.2.1 ESM component .............................................................................................................................. 19
3.2.1.1 EtherCAT State Machine (ESM) ..................................................................................... 19
3.2.1.2 AL Control Register and AL Status Register .................................................................. 20
3.2.1.3 Slave Information Interface (SII) ..................................................................................... 22
3.2.2 MBX (Mailbox) component .............................................................................................................. 25
3.3 CoE function ................................................................................................................................. 25
3.3.1 CoE function .................................................................................................................................... 25
3.3.1.1 CoE Emergencies........................................................................................................... 26
3.3.2 SDO component .............................................................................................................................. 26
3.3.3 ODV3 component ............................................................................................................................ 26
3.3.3.1 Access rights .................................................................................................................. 27
3.3.3.2 CoE Communication Area for EtherCAT ........................................................................ 27
3.3.3.3 Custom Object Directory based on Minimal Object Directory ......................................... 27
3.3.3.4 Description of objects of minimal object dictionary ......................................................... 28
3.3.3.5 Default Object Dictionary ................................................................................................ 30
3.3.3.6 PDO Mapping for cyclic Communication ........................................................................ 32
3.3.3.7 Complete Access............................................................................................................ 33
3.4 Behavior when receiving a Set Configuration command ............................................................. 33
3.5 Watchdogs ................................................................................................................................... 34
3.5.1 DPM watchdog ................................................................................................................................ 34
3.5.1 SM Watchdog .................................................................................................................................. 34
3.5.1 PDI Watchdog ................................................................................................................................. 34
3.6 Ethernet MAC address ................................................................................................................. 35
4 Status information ................................................................................................................................ 36
4.1 Common status ............................................................................................................................ 36
4.2 Extended status ........................................................................................................................... 36
5 Requirements to the application......................................................................................................... 37
5.1 Sequence within the host application........................................................................................... 37
5.2 General initialization sequence .................................................................................................... 38
5.3 Explicit Device Identification......................................................................................................... 39
5.3.1 Initialization sequence ..................................................................................................................... 39
5.3.2 Set Firmware Parameter ................................................................................................................. 41
5.4 Complete Access for object data hold by application .................................................................. 43
EtherCAT Slave V5 | Protocol API
DOC181005API01EN | Revision 1| English | 2019-04 | Released | Public © Hilscher, 2018-2019
Table of contents 3/127
5.5 Dynamic PDO mapping................................................................................................................ 45
5.5.1 One application registered (application successful) ........................................................................ 46
5.5.2 One application registered (application not successful) .................................................................. 48
5.5.3 Multiple applications registered (one application unsuccessful) ...................................................... 48
5.5.4 Complete Access: one application registered (application successful) ........................................... 49
5.6 Remanent data handling .............................................................................................................. 50
5.6.1 Protocol stack stores remanent data ............................................................................................... 51
5.6.2 Application stores remanent data .................................................................................................... 51
6 Application interface ............................................................................................................................ 52
6.1 General......................................................................................................................................... 52
6.1.1 Register Application service ............................................................................................................ 52
6.1.2 Unregister Application service ......................................................................................................... 53
6.1.3 Link Status Changed service ........................................................................................................... 53
6.2 Configuration ................................................................................................................................ 53
6.2.1 Set Configuration service ................................................................................................................ 53
6.2.1.1 Set Configuration request ............................................................................................... 54
6.2.1.2 Set Configuration confirmation ....................................................................................... 68
6.2.2 Set Trigger Type service ................................................................................................................. 69
6.2.3 Get Trigger Type service ................................................................................................................. 69
6.2.4 Set IO Size service .......................................................................................................................... 70
6.2.4.1 Set IO Size request ........................................................................................................ 70
6.2.4.2 Set IO Size confirmation ................................................................................................. 71
6.2.5 Set Station Alias service .................................................................................................................. 72
6.2.5.1 Set Station Alias request ................................................................................................ 72
6.2.5.2 Set Station Alias confirmation ......................................................................................... 73
6.2.6 Get Station Alias service ................................................................................................................. 74
6.2.6.1 Get Station Alias request ................................................................................................ 74
6.2.6.2 Get Station Alias confirmation ........................................................................................ 75
6.3 EtherCAT State Machine ............................................................................................................. 76
6.3.1 Register for AL Control Changed Indications service ...................................................................... 76
6.3.1.1 Register for AL Control Changed Indications request ..................................................... 77
6.3.1.2 Register For AL Control Changed Indications confirmation ............................................ 78
6.3.2 Unregister From AL Control Changed Indications service ............................................................... 79
6.3.2.1 Unregister From AL Control Changed Indications request ............................................. 79
6.3.2.2 Unregister from AL Control Changed Indications confirmation ....................................... 80
6.3.3 AL Control Changed service............................................................................................................ 81
6.3.3.1 AL Control Changed Indication ....................................................................................... 81
6.3.3.2 AL Control Changed response ....................................................................................... 84
6.3.4 AL Status Changed service ............................................................................................................. 85
6.3.4.1 AL Status Changed Indication ........................................................................................ 85
6.3.4.2 AL Status Changed response ......................................................................................... 87
6.3.5 Set AL Status service ...................................................................................................................... 88
6.3.5.1 Set AL Status request ..................................................................................................... 88
6.3.5.2 Set AL Status confirmation ............................................................................................. 89
6.3.6 Get AL Status service ...................................................................................................................... 90
6.3.6.1 Get AL Status request .................................................................................................... 90
6.3.6.2 Get AL Status confirmation ............................................................................................. 91
6.4 CoE .............................................................................................................................................. 92
6.4.1 Send CoE Emergency service......................................................................................................... 92
6.4.1.1 Send CoE Emergency request ....................................................................................... 92
6.4.1.2 Send CoE Emergency confirmation ................................................................................ 94
6.5 Packets for Object Dictionary access .......................................................................................... 95
6.6 Slave Information Interface (SII) .................................................................................................. 95
6.6.1 SII Read service .............................................................................................................................. 95
6.6.1.1 SII Read request............................................................................................................. 95
6.6.1.2 SII Read confirmation ..................................................................................................... 96
6.6.2 SII Write service .............................................................................................................................. 97
6.6.2.1 SII Write request ............................................................................................................. 97
6.6.2.2 SII Write confirmation ..................................................................................................... 97
6.6.3 Register for SII Write Indications service ......................................................................................... 99
6.6.3.1 Register for SII Write Indications request ....................................................................... 99
6.6.3.2 Register for SII Write Indications confirmation .............................................................. 100
6.6.4 Unregister from SII Write Indications service................................................................................. 101
6.6.4.1 Unregister from SII Write Indications request ............................................................... 101
6.6.4.2 Unregister from SII Write Indications confirmation........................................................ 102
6.6.5 SII Write Indication service ............................................................................................................ 103
6.6.5.1 SII Write indication........................................................................................................ 103
6.6.5.2 SII Write response ........................................................................................................ 104
EtherCAT Slave V5 | Protocol API
DOC181005API01EN | Revision 1| English | 2019-04 | Released | Public © Hilscher, 2018-2019
Table of contents 4/127
6.7 Ethernet over EtherCAT (EoE) ..................................................................................................105
6.7.1 Socket interface ............................................................................................................................. 105
6.7.2 Ethernet interface .......................................................................................................................... 105
6.8 Remanent data services ............................................................................................................105
6.8.1 Set Remenent Data ....................................................................................................................... 105
6.8.2 Store Remenent Data .................................................................................................................... 105
7 Resource and feature configuration via tag list ..............................................................................106
8 Status and error codes ......................................................................................................................107
8.1 Stack-specific error codes ..........................................................................................................107
8.1.1 General.......................................................................................................................................... 107
8.1.2 Set Configuration ........................................................................................................................... 107
8.1.3 ESM............................................................................................................................................... 108
8.1.4 MBX............................................................................................................................................... 108
8.1.5 CoE ............................................................................................................................................... 108
8.1.6 DPM .............................................................................................................................................. 110
8.1.7 EoE ............................................................................................................................................... 111
8.1.8 ODV3............................................................................................................................................. 111
8.2 EtherCAT-specific error codes ...................................................................................................112
8.2.1 AL status codes ............................................................................................................................. 112
8.2.1.1 Standard AL status codes ............................................................................................ 112
8.2.1.2 Vendor-specific AL status codes .................................................................................. 113
8.2.2 CoE Emergency codes .................................................................................................................. 114
8.2.3 Error LED status ............................................................................................................................ 115
8.2.4 SDO Abort codes .......................................................................................................................... 116
8.2.4.1 SDO Abort codes.......................................................................................................... 117
8.2.4.2 Correspondence of SDO Abort codes and status / error codes .................................... 118
9 Appendix .............................................................................................................................................120
9.1 Legal notes .................................................................................................................................120
9.2 EtherCAT summary concerning vendor ID, conformance test, membership and network logo 123
9.3 List of tables ...............................................................................................................................124
9.4 List of figures ..............................................................................................................................126
9.5 Contacts .....................................................................................................................................127
1 Introduction
1.1 About this document
This manual describes the application interface of the EtherCAT Slave protocol stack V5 and
provides information about how an application has to use the EtherCAT Slave protocol stack.
Technical data
Feature Value
Maximum number of cyclic input data 1024 bytes
Maximum number of cyclic output data 1024 bytes
Acyclic communication (CoE) SDO
SDO Master-Slave
SDO Slave-Slave (depending on master capability)
Type Complex Slave
Supported protocols SDO client and server side protocol
CoE Emergency messages (CoE)
Ethernet over EtherCAT (EoE)
File Access over EtherCAT (FoE)
Supported state machine ESM – EtherCAT state machine
Supported of synchronization modes Freerun (The application of the slave is not synchronized to EtherCAT)
Synchronous with SYNCMAN Event (Slave's application is synchronized to
the SM2/3 Event)
Synchronous with SYNC Event (Slave's application is synchronized to the
SYNC0 or SYNC1 Event)
Supported features PDI watchdog
EtherCAT mailbox handling
EtherCAT state machine handling
Master-to-slave SDO communication
Slave-to-slave SDO communication
Integrated CoE object dictionary (ODV3)
Ethernet over EtherCAT (EoE) handling
File Access over EtherCAT (FoE) server
Number of FMMU channels 8
Number of Sync Manager channels 4
Distributed Clocks (DC) Supported with 32-bit timestamps and isochronous PDI functionality
(Sync0, Sync1)
Ethernet 2 Ethernet Interfaces 100BASE-TX/FX, 1 green Link/Activity LED per
Ethernet Interface
Integrated Dual-PHY (supports Auto-Negotiation and Auto-Crossover)
Data transport layer Ethernet II, IEEE 802.3
Table 2: Technical data
Configuration
Configuration by packet to transfer configuration parameters
Diagnostic
Firmware supports common diagnostic in the dual-port-memory for loadable firmware.
Limitations
EtherCAT Slave stack
AoE application interface not available
FoE for firmware upload is supported, but application interface not available
ESC - EtherCAT Slave Controller
no DC Latch functionality
no support of bit-wise FMMU mapping (Exception: Fill Status of Transmit Mailbox)
restricted DC Sync-Signal Generation
no Single-Shot Mode support
no Acknowledge Mode support
restricted DC Control Functionality
no adjustment of Register Speed Counter Start (0x0930:0x931)
no showing of Register Speed Counter Diff (0x0932:0x933)
no MIO (PHY Management Interface) access from EtherCAT Master side
no physical Read-Write commands supported (APRW, FPRW, BRW)
2 Getting started
This chapter describes the basics of the Hilscher EtherCAT Slave stack. This includes information
about
the use case
the configuration of the EtherCAT Slave stack
principles of cyclic and acyclic data exchange
object dictionary
2.2 Configuration
2.2.1 Configuration methods
You can use one of the following methods to configure the EtherCAT Slave stack:
The application can set the configuration parameters using the Set Configuration service to
transfer the parameters within a packet to the stack.
You can use one of the following configuration software to set the configuration parameters.
You can use Communication Studio configuration software (which creates a
configuration file named CONFIG.NXD)
You only have to fill these data structures with data if they are used and evaluated. This depends
on the flags within parameter Component Initialization of the Base Configuration Parameters
described above. Each flag controls whether the data structure for a single component is evaluated
(flag set) or not (flag equals 0).
Please refer to chapter Set Configuration service on page 53 for a detailed programming
reference.
2.2.4.1 Reconfiguration
It is possible to reconfigure the stack at any time. To do so, simply send a new configuration to the
stack followed by a Channel Init request (reference [1]). Sending the new configuration without the
Channel Init request will not have an effect to the running communication. The new parameters will
be stored in the RAM only. Sending the Channel Init request will stop any communication and take
over the new parameters.
As an alternative for reconfiguration, a specific packet is available (section Set IO Size service on
page 70) which contains two parameters only: input length and output length. Thus, it is not
necessary to send a complete configuration packet twice.
Note: The packet queue has limited space and may fill up so new packets may be lost. To
avoid these data loss situations, we strongly recommend emptying the mailbox
frequently, even if the host application does not expect any packets.
Acyclic communication: EtherCAT Master to EtherCAT Slave via Service Data Objects
For acyclic data exchange between an EtherCAT Slave and an EtherCAT Master, the EtherCAT
mailbox is used. The ODV3 component manages Service Data Objects accomplishing acyclic data
exchange. For more information refer to the separate ODV3 documentation, see document
reference [3].
Overview
The main topics described in this chapter are:
Base Component
CoE function
EoE Component
The packets mentioned in this chapter are described in the programming reference within the next
chapter Application interface.
Purpose
The EtherCAT State Machine (ESM) can describe the states and state changes of the slave
application. The ESM implements the following four states that the EtherCAT specification
precisely describes (see there for reference):
Init: The EtherCAT Slave is initialized in this state. No real process data exchange happens.
Pre-Operational: Initialization of the EtherCAT Slave continues. No real process data
exchange happens. The master and the slave communicate acyclically via mailbox to set
parameters.
Safe-Operational: In this state, the EtherCAT Slave can process input data. However, the
output data are set to a ‘safe’ state.
Operational: In this state, the EtherCAT Slave is fully operational.
A fifth state called Bootstrap is also allowed by the EtherCAT specification, but not necessary.
Note: The states Operational and Safe-Operational may be prohibited in special situations.
See section Basic configuration parameters on page 11 for more information.
Closely connected to the ESM are the AL Control Register and the AL Status Register of the
EtherCAT Slave. See reference [1] for more information on these registers.
The packets mentioned above indicate that a state change has already happened. An application
has no chance to control or interrupt a transition; it just gets informed about it.
To unregister use the HIL_UNREGISTER_APP_REQ packet.
If an application additionally wants to control ESM state changes, it has to register for AL
Confirmed Services.
Registering for AL Confirmed Services may be necessary e.g. in following cases:
Servo Drive with use of Distributed Clock (Synchronization)
In Motion Control applications, it is of utmost importance that all devices work synchronized.
Therefore, drives often use a Phased Locked Loop (PLL) to synchronize their local control
loop with the bus cycle. As long as this has not happened, the status of the device may not
proceed to „Operational“(see reference [10]). Using AL Confirmed services, an application
can delay the start up process and synchronize their local control loop first. After the local
PLL has “locked in” the device may proceed to „Operational“.
Note: The stack will not send any indications when switching downwards, for instance when
switching from Operational down to Init state.
Figure 7: Sequence diagram of state change controlled by application/host with additional AL Status Changed indications
Note: The addresses mentioned in the table above relate to 16-bit words.
More detailed information about the SII structure can be obtained from the standard document IEC
61158, part 6-12, “EtherCAT Application layer protocol specification” (especially refer to section
5.4, “SII coding” in this context). Also the EtherCAT Specification Part 5 (ETG1000.5: “Application
layer service definition”) might contain additional information. These standard documents are
available from ETG.
The optional additional information area (addresses > 0x003F) is organized by different categories.
There are standard categories and vendor-specific categories allowed. All categories have a
header containing among others the length information of the rest of the data of the category.
Unknown categories may be skipped during evaluation.
For more information on the standard categories, refer to the following tables of reference [10]:
For STRINGS: see table 20.
For General: see table 21.
For FMMU: see table 22.
For SyncM: see table 23.
For TXPDO and RXPDO: see table 24.
Hilscher does not define any additional vendor-specific categories of its own.
Purpose
There are two different reasons to use CoE (CANopen over EtherCAT):
1. CoE provides acyclic communication. Use CoE to access and configure service data such as
communication parameters or device-specific parameters. These service data are stored as
service data objects (SDO) within an object dictionary (OD). The EtherCAT Slave protocol
stack V5 from Hilscher uses the Object Dictionary V3, which is described in reference [3].
2. CoE also provides an easy migration path from CANopen to EtherCAT. CoE emulates a
CAN-based environment working on EtherCAT and allows the use of CAN profiles.
In detail, the CoE functionality allows:
SDO download: Acyclic data transfer from the master to a slave
SDO upload: Acyclic data transfer from a slave to the master
SDO information service: reading SDO object properties (object dictionary) from a slave
CoE Emergency Requests
The host can initialize uploads, downloads and information services. Only slaves will generate
emergencies. The master collects the emergencies and displays them via the slave diagnosis.
In addition, CoE affects cyclic communication, as the communication parameters related to PDOs
can be configured via SDO to specific object dictionary entries. For more information, see section
PDO Mapping on page 32.
For more information, see references [9] and [10].
3.3.1 CoE function
The ECAT_COE component is the main handler of all CoE related mailbox messages and routes
them to the components associated with those inside the CoE function. In addition, the ECAT_COE
component provides a mechanism for sending CoE emergency messages.
For index values larger than 0x1100, please refer to reference [3] or to the EtherCAT specification
(references [9] and [10]).
3.3.3.3 Custom Object Directory based on Minimal Object Directory
Using the ECAT_SET_CONFIG_COEFLAGS_USE_CUSTOM_OD configuration flag, the user can
enable or disable working with a custom object dictionary.
If this configuration flag is not set, the stack will create a default object dictionary.
If this configuration flag is set, the stack will only create a minimal object dictionary.
The following contains a list of the objects contained in this minimal object dictionary. Note that
without providing additional objects by a user application an EtherCAT master will not be able to
bring the slave to Operational state.
The stack always creates these objects regardless of using a custom object dictionary or not.
Note: Each object to be used for process data transfer has to be byte aligned.
Device Type
Index 0x1000
Name Device Type
Object code VAR
Data type UNSIGNED32
Category Mandatory
Access Read only
PDO mapping No
Value Bit 0-15: contain the used device profile or the value
0x0000 if no standardized device is used
Table 12: CoE Communication Area - Device Type
Identity Object
Index 0x1018
Name Identity Object
Object code RECORD
Data type IDENTITY
Category Mandatory
Table 13: CoE Communication Area – Identity Object
Number of entries
Index 0x1018
Sub Index 0
Description Number of entries
Data type UNSIGNED8
Entry Category Mandatory
Access Read only
PDO mapping No
Value 4
Table 14: CoE Communication Area – Identity Object - Number of entries
Index 0x1018
Sub Index 1
Description Vendor ID
Data type UNSIGNED32
Entry Category Mandatory
Access Read only
PDO mapping No
Value Vendor ID assigned by the CiA organization
Table 15: CoE Communication Area – Identity Object - Vendor ID
Product Code
Index 0x1018
Sub Index 2
Description Product Code
Data type UNSIGNED32
Entry Category Mandatory
Access Read only
PDO mapping No
Value Product code of the device
Table 16: CoE Communication Area – Identity Object - Product Code
Revision Number
Index 0x1018
Sub Index 3
Description Revision Number
Data type UNSIGNED32
Entry Category Mandatory
Access Read only
PDO mapping No
Value Bit 0-15: Minor Revision Number of the device
Bit 16-31: Major Revision Number of the device
Table 17: CoE Communication Area – Identity Object - Revision Number
Serial Number
Index 0x1018
Sub Index 4
Description Serial Number
Data type UNSIGNED32
Entry Category Mandatory
Access Read only
PDO mapping No
Value Serial Number of the device
Table 18: CoE Communication Area – Identity Object - Serial Number
Figure 8: PDO Mapping explains the relationship between object dictionary (left upper part), PDO
mapping structure (right upper part) and the resulting PDO containing the application objects to be
mapped (lower part).
One entry in the PDO mapping table requires 32 bit. It consists of:
16 bit containing the index of the object dictionary entry containing the application object to
be mapped
8 bit containing the subindex of the object dictionary entry containing the application object to
be mapped
8 bit containing the length information.
The use of the mapping structure must be configured. In EtherCAT, this is done by the Sync
Manager PDO Assignment (Objects 0x1C10 – 0x1C2F)
Sometimes it is necessary to change the mapping after startup of the device (e.g. for modular
devices). For information on this topic, refer to section 5.5
3.5 Watchdogs
Three watchdogs exist in the context of the EtherCAT Slave stack.
The DPM Watchdog monitors the communication between the host application and the
stack via the dual-port memory.
The SM Watchdog monitors the process data received from the EtherCAT network.
The PDI Watchdog allows the master to monitor whether the EtherCAT Slave is still running.
3.5.1 SM Watchdog
The EtherCAT Slave uses the SyncManager Watchdog to monitor the receiving of process data.
This watchdog is only related to SyncManager 2 (master to slave). The default value is set to
100 ms, the value 0 deactivates the watchdog.
In case the EtherCAT Slave has input data only, the watchdog will not be started at all. If the
EtherCAT Slave receives no process data within the configured time, the AL Status Code
ECAT_AL_STATUS_CODE_SYNC_MANAGER_WATCHDOG is set and the slave falls back to the
SafeOP state. The AP task starts to trigger the SM Watchdog with the first reading of the buffer
and triggers again with each next reading. The master resets the watchdog with every PDO cycle.
The EtherCAT Master or a configuration tool can change the watchdog time by writing the related
registers (0x420, 0x400 = divider for both watchdogs.) in the EtherCAT Slave. LFW users (OEM
customization) can add an entry in the ESI file, see Reg0420 in reference [14].
The typical examples that lead to a watchdog timeout are unplugging the network cable or long
cycle times.
Note: For the EtherCAT Slave, no MAC address is required. However, the EtherCAT Master
can set a MAC address via the network.
Note: Other protocols require up to 4 MAC addresses and use MAC address 1–4 of the Flash
Device Label. In case you design a device and intend to use the device with other
protocols, then 4 MAC addresses are required in the Flash Device Label.
The stack uses the MAC addresses from the following sources:
Flash Device Label: The stack reads all MAC addresses from the Flash Device Label
located in the Flash memory (either integrated in netX 90 or attached to netX 4000) and uses
them. A Flash Device Label offers up to eight MAC addresses.
Application: The application can change each MAC address using the Device Data Provider
Set service before configuring the firmware. MAC addresses must be set at the latest before
setting "Bus State on".
4 Status information
The EtherCAT Slave provides status information in the dual-port memory. The status information
has a common block (protocol-independent) and an EtherCAT Slave specific block (extended
status).
Figure 10: Initialization sequence with placing of registrations and object dictionary creation
ulParameterID
ulParameterID contains the value PID_ECS_DEVICE_IDENTIFICATION (0x30009001).
ulParameterLength
ulParameterLength contains the value 4.
abParameter
Field Meaning
abParameter[0] Low Byte of Device Identification Value
abParameter[1] High Byte of Device Identification Value
abParameter[2] set to zero
abParameter[3] set to zero
Table 21: abParameter
Packet description
Structure HIL_PACKET_HEADER_T
ulDest uint32_t Destination address / handle
ulLen uint32_t 12 Packet Data Length in bytes
ulCmd uint32_t 0x2F86 HIL_SET_FW_PARAMETER_REQ
Structure HIL_SET_FW_PARAMETER_REQ_DATA_T
ulParameterID uint32_t 0x30009001 PID_ECS_DEVICE_IDENTIFICATION
ulParameterLength uint32_t 4 Length of parameter
abParameter uint8_t[4] See description of abParameter
Table 22: Request Packet HIL_SET_FW_PARAMETER_REQ_T
Packet description
Example
The following example shows how to set a value as identification value:
void FillOutFwParamDeviceIdentPacket(uint32_t ulSrc, HIL_SET_FW_PARAMETER_REQ_T* ptPkt,
uint16_t usIdentValue)
{
ptPkt->tHead.ulCmd = HIL_SET_FW_PARAMETER_REQ;
ptPkt->tHead.ulExt = 0;
ptPkt->tHead.ulSta = 0;
ptPkt->tHead.ulSrcId = 0;
ptPkt->tHead.ulSrc = ulSrc;
ptPkt->tHead.ulLen = 12;
ptPkt->tHead.ulRout = 0;
ptPkt->tHead.ulId = 0;
ptPkt->tHead.ulDestId = 0;
ptPkt->tHead.ulDest = 0x20; /* addressed communication channel */
ptPkt->tData.ulParameterID = PID_ECS_DEVICE_IDENTIFICATION;
ptPkt->tData.ulParameterLength = 4;
ptPkt->tData.abParameter[0] = usIdentValue & 0xFF;
ptPkt->tData.abParameter[1] = usIdentValue >> 8;
ptPkt->tData.abParameter[2] = 0;
ptPkt->tData.abParameter[3] = 0;
}
For more information about the dynamic PDO mapping, see chapter 10 in reference [12] and
reference [13].
Figure 13: Dynamic PDO assignment: One application registered for write indications (successful)
Figure 14: Dynamic PDO assignment: One application registered for write indications (not successful)
Until the first ODV3_WRITE_OBJECT confirmation for subindex 0, the sequence is the same as
described in section One application registered (application successful). If one of the following
write object indications fail indicated with "ulSta unequal to zero" from the application, the
application has to restore the former I/O size or has to set a default size. An example for this case
can be that a written value is out of range.
Figure 15 Dynamic PDO assignment: One application registered for write indications, successful (Complete Access)
The ODV3 component splits a single Complete Access from master into several single requests.
To get the subindices in the correct order for PDO mapping, the application has to to set the flag
ODV3_ACCESS_FLAGS_SUBINDEX_0_WRITE_0_FIRST during object creation. The application
also has to set the flag ODV3_INDICATION_FLAGS_ON_WRITE_INVALIDATED, see reference
[5].
The application has to copy the current configuration list with all its values to a second list (shadow
list). In the shadow list, the application saves the new configured data. At the end of a correct
configuration sequence, the application copies the valid subobjects of the new configuration back
to the current configuration list. In case, the Complete Access fails (ODV3_WRITE_OBJECT_CNF
ulSta is not zero), the configuration of the current list is still valid and process data length can be
restored or is unchanged.
The sequence starts with setting subindex 0 to zero. In comparison to single access, the
application does not need to send a Set IO Size request, because Set IO Size follows after the
EtherCAT Slave V5 | Protocol API
DOC181005API01EN | Revision 1| English | 2019-04 | Released | Public © Hilscher, 2018-2019
Requirements to the application 50/127
validation indication. The application receives values for the subindexes with the following write
indications. In case the object is deactivated (subindex 0 = zero and writing is allowed), the
application has to save the new values to the shadow list. If not, the application has to compare the
current value with the new value. If they match, this is an allowed request otherwise the access is
not allowed (0x06010003 = Subindex cannot be written, SI0 must be 0 for write access). The
indication for subindex zero unequal to zero is checked to match highest written subindex.
All validation indications, which are following show whether the written value is valid or wheather
an error has occurred. The validation for subindex 0 indicates the end of the configuration for the
application. In case the validation is successful, the application has to copy the valid entries to the
current configuration list. The application has to calculate the process data length and send the Set
IO Size request to the EtherCAT slave, which contains the length of input and the length of output.
One length has a new value.
Additional considerations:
The main difference of the Complete Access compared to the standard access is that all write
object validation packets are send after the last write object response that has reached the ODV3
component. The amount of validation packets coming straight after the last write object response
can be very high. As a result, the application has to take the following two points into account:
1. For LFW users: The application has to empty the mailbox frequently because otherwise the
buffers in the packet queue for the mailbox runs out of packets. Depending on the amount of
validation packets, it may be necessary for the application to poll the mailbox with a higher
frequency, while the startup parameters are downloaded. Afterwards the application can
decrease the frequency for a standard acyclic packet handling.
2. The master tries to change the EtherCAT state right after the download of the last startup
parameter has been finished. This means, the confirmation reaches the master after the last
write object. The state change request leads to a process data validation within the slave. To
avoid that the process data evaluation is done before the new data size is set, the validation
responses from application side can be neglected (they are not evaluated by the EtherCAT
Slave stack). If problems occur, it is also possible to define a timeout for the state changes in
the ESI file.
Firmware configuration
In the tag list “Remanent Data Responsibility” the tag “Remanent Data stored by Host” has to be
set to disabled in the firmware file (*.nxi). This is the default setting in a firmware.
Firmware configuration
In the tag list “Remanent Data Responsibility” the tag “Remanent Data stored by Host” has to be
set to enabled in the firmware file (*.nxi).
Configuration
The application has to use the Set Remanent Data service (HIL_SET_REMANENT_DATA_REQ) to
provide the remanent data to each protocol stack component any time the host application starts
up for the first time (e.g. when coming from power up) and before the application sends the Set
Configuration request (page 54). For a state diagram, see section General initialization sequence
on page 38.
During runtime
The stack component indicates to the application the Store Remanent Data service
(HIL_STORE_REMAMENT_DATA_IND) each time remanent data has been changed. Th stack
component provides the remanent data as a block towards the application. The application has to
store the remanent data with each indication.
6 Application interface
The following chapters define the application interface of the EtherCAT Slave stack. The
application task is named AP task in the following sections and chapters.
The AP task’s process queue is keeping track of all its incoming packets. It provides the
communication channel for the underlying EtherCAT Slave Stack. Once, the EtherCAT Slave
Stack communication is established, events received by the stack are mapped to packets that are
sent to the AP task’s process queue. On the one hand, every packet has to be evaluated in the AP
task’s context and corresponding actions be executed. On the other hand, initiator services that are
be requested by the AP task itself are sent via predefined queue macros to the underlying
EtherCAT Stack queues via packets as well.
All tasks belonging to the EtherCAT stack are grouped together according to their functionality. The
following overview shows the different tasks that are available within the EtherCAT stack.
6.1 General
Overview over the General Packets of the EtherCAT Slave Stack
Service Command code Page
Register Application service 0x2F10, 0x2F11 52
Unregister Application service 0x2F12, 0x2F13 53
Link Status Changed service 0x2F8A, 0x2F8B 53
Table 24: Overview over the general packets of the EtherCAT Slave stack
Note: It is required that the application returns all indications it receives as valid responses to
the stack. Do not change any field in the packet header except ulSta, ulCmd and
ulLen. Otherwise, the stack will not be able to assign the response successfully.
The service is described in DPM Interface Manual for netX based Products (reference [1]).
6.2 Configuration
For a complete configuration of the stack, the application can use the following packets:
Attention: As described in Dual Port Memory manual (reference [1]) it is required to send a
Channel Initialization request to the EtherCAT Slave stack after performing the Set
Configuration Request. The stack will not use the configuration until it receives the
Channel Initialization Request.
For detailed information on the packet sequence, see section Configuration on page 10.
If the stack does not receive this message, the slave will not proceed further than to Pre-
Operational state. If the master requests Safe-Operational, the slave will notify the master with
the following code in the AL status code:
#define ECAT_AL_STATUS_CODE_IO_DATA_SIZE_NOT_CONFIGURED 0x8001
For a list of available AL Status Codes, please refer to chapter AL status codes.
/* basic configuration */
typedef struct ECAT_SET_CONFIG_REQ_DATA_BASIC_Ttag
{
uint32_t ulSystemFlags;
uint32_t ulWatchdogTime;
uint32_t ulVendorId;
uint32_t ulProductCode;
uint32_t ulRevisionNumber;
uint32_t ulSerialNumber;
uint32_t ulProcessDataOutputSize;
uint32_t ulProcessDataInputSize;
uint32_t ulComponentInitialization;
uint32_t ulExtensionNumber;
} ECAT_SET_CONFIG_REQ_DATA_BASIC_T;
/* component configuration */
typedef __struct ECAT_SET_CONFIG_COE_Ttag
{
uint8_t bCoeFlags;
uint8_t bCoeDetails;
uint32_t ulOdIndicationTimeout;
uint32_t ulDeviceType;
uint16_t usReserved;
/* request packet */
typedef struct ECAT_SET_CONFIG_REQ_Ttag
{
HIL_PACKET_HEADER_T tHead;
ECAT_SET_CONFIG_REQ_DATA_T tData;
} ECAT_SET_CONFIG_REQ_T;
Packet description
Parameter ulSystemFlags
#define ECAT_SET_CONFIG_SYSTEMFLAGS_AUTOSTART 0x00000000
#define ECAT_SET_CONFIG_SYSTEMFLAGS_APP_CONTROLLED 0x00000001
This parameter is bit zero of the system flags.
The start of the device can be performed either application controlled or automatically:
Automatic (0): Network connections are opened automatically without taking care of the state of
the host application. Communication with an EtherCAT master after starting the EtherCAT Slave is
allowed without BUS_ON flag, but the communication will be stopped if the BUS_ON flag changes
state to 0.
Important: If the master sets the slave to Operational state when Automatic has been choosen,
probably the application will not be initialized completely.
Application controlled (1): The channel firmware is forced to wait for the host application to wait
for the BUS_ON flag in the communication change of state register. For further information, see
section reference [1]. Communication with EtherCAT Master is allowed only with the BUS_ON flag.
Important: If the initialization of the slave application is to be controlled by the slave application
itself, Application controlled must be chosen. The master is only able to change the
state of the slave in case of the slave application setting the BUS_ON flag.
Important: If Application controlled (1) is chosen and a watchdog error occurs, the stack will not be
able to reach the „Operational“ or the „Safe-Operational“ state. In this case, a channel
reset is required.
For more information concerning the bus startup parameter, see section Controlled or Automatic
Start of the netX DPM Interface Manual (reference [1]).
The application can be synchronized with the EtherCAT bus cycle. For information on the
handshake, see reference [1].
Note: The EtherCAT Slave supports buffered host controlled mode only.
When starting with process data exchange, the application has to do a handshake with the netX
once to receive the first process data. In order to do the first handshake toggling, the application
has to call the xChannelIORead function once.
A common use case is to synchronize the process data exchange on SyncManager2 event with
activated handshake mode to exchange data. After the slave has received a frame, the slave
triggers an interrupt and copies the output process data (master to salve) received from the bus
EtherCAT Slave V5 | Protocol API
DOC181005API01EN | Revision 1| English | 2019-04 | Released | Public © Hilscher, 2018-2019
Application interface 63/127
into the triple buffer in the slave controller. As soon as data is copied, the output valid mark is set
and the AP task copies data into the local memory. The input handshake bit in the dual-port
memory is toggled and the local cycle of the application starts. After the slave has copied the
received data, the slave gives back the input handshake bit back to the netX. Now the slave copies
its input data (slave to master) to the triple buffer and gives the output handshake bit to the netX
that copies the data to the bus and gives the handshake back again. A synchronization for
exchange of input process data (slave to master) is not necessary because the application can do
this right after output data is received and thus as fast as possible.
The values for the discussed use case SM2 synchronous are:
Parameter Description Setting
bPDInSource process data trigger source for inputs (master - ECAT_DPM_SYNC_SOURCE_SM2
> slave)
bPDInHskMode handshake bits which show that data is copied HIL_IO_MODE_BUFF_HST_CTRL
to DPM
bPDOutSource process data trigger source for outputs (slave - ECAT_DPM_SYNC_SOURCE_FREERUN
> master)
bPDOutHskMode handshake bits which show that Data is HIL_IO_MODE_BUFF_HST_CTRL
copied to DPM
bSyncSource for special sync handshake cell, not needed ECAT_DPM_SYNC_SOURCE_FREERUN
Table 39 Example for SM2 synchronous mode
A similar configuration is used for DC synchronous mode, which eliminates the jitter of the bus
cycle. The only difference is to set the bPDInSource to ECAT_DPM_SYNC_SOURCE_SYNC0.
The synchronization on SM3 event makes sense if only inputs are transmitted.
Note: All values mentioned above have no influence on the real physical sync signal
generation by the ESC. Whether it is active or not and which sync signal. This is done
by the following parameters in ECAT_SET_CONFIG_SYNCPDI_T and from the master
side, which has to activate signals by writing to ESC registers.
Keep in mind, that the application must enable and explicitly configure the distributed clocks
feature including the Sync0/Sync1 settings in the configuration of the EtherCAT Master.
Even, if a sync signal in the slave is activated through the configuration of the EtherCAT master,
but the application does not need the sync interrupt for synchronisation, the interrupt has to be
activated. This is necessary, because the stack uses the interrupt to monitor the presence of a
sync signal. Otherwise, the stack cannot reach Operational state. By default, the Sync Interrupt is
always enabled.
The value usStationAlias will be written into the EEPROM and the register 0x12 of the ESC.
A configuration tool can write the station alias address to the EEPROM. It will be transferred to the
ESC register at startup of the device. If it is set here, this possibility is no longer available, because
EtherCAT Slave V5 | Protocol API
DOC181005API01EN | Revision 1| English | 2019-04 | Released | Public © Hilscher, 2018-2019
Application interface 65/127
the value configured by the tool will be overwritten by usStationAlias. Therefore, for most use
cases the parameter should be set to zero. To change the Configured Station Alias, the application
can use the Set Station Alias service.
Device Identification Value: If it is possible to set an address from the device side (for instance, via
a rotary switch, a display or by other ways), the Device Identification Value can be set here.
Otherwise, set the value to zero to deactivate the handling. If the parameter
usDeviceIdentificationValue is set, the application needs to send the packet
HIL_SET_FW_PARAMETER_REQ in addition to update the address in case it has changed. This is
necessary to fulfill the conformance requirements. The actual value should be updated by sending
this packet to the stack before the bus is switched on. The use of HIL_SET_FW_PARAMETER_REQ
automatically activates the address exchange as well, so if it is used, the parameter
usDeviceIdentification is obsolete.
The Bootstrap Mailbox size has a default value of 128 byte, which is defined in the configuration
file. If the component parameter evaluation is enabled by setting the flag in
ulComponentInitialization, this value can be changed by the configuration parameter. If the
configuration parameter usBootstrapMbxSize is set to zero, it deactivates the Bootstrap
Mailbox. If the parameter is set to a value different from zero, it overwrites the default value. The
minimum possible value is 128 Byte.
Attention: Despite the length information, the parameters have to be set in the maximum array
length, even if the parameter length is shorter than possible or if the length is set to
zero. The strings can be filled up with zeros.
The mailbox sizes for SM0 and SM1 have a default value of 128 bytes. The SM2/3 default start
addresses dependent on the chip. To change the default settings, the component parameter
evaluation has to be set to enabled (flag in ulComponentInitialization).
If the configuration parameter usMailboxSize is set to a value less than 128 bytes, the minimum
possible value of 128 byte is used. The maximum configurable size is chip dependent. It also
depends on the needed process data size.
3200 bytes minus processdata size (three times counted because of triple buffer) for each
direction.
Mailboxes always have the same size for both directions and the size has to be 4 byte aligned.
The configuration parameter usSM2StartAddress defines the start address for the output
(master/network -> slave) process data image. The address must be set directly after the mailbox
data image to utilize space. If e.g. the mailbox has the default value of 128 Byte, the start address
has to be 0x1100, because the mailboxes start at 0x1000 and have a length of 2 * 0x80 byte.
The configuration parameter usSM3StartAddress defines the start address for the input (slave
-> master/network) process data image. The address can be set directly after the output data
image to utilize space. If e.g. the output image is 256 byte long and usSM2StartAddress starts
at 0x1100, the start address for the input image has to be at minimum 0x1400, because the
process data uses triple buffers. The rest of the address space can be used for input data.
It is necessary to configure both sync manager addresses even for devices, which only have input
data. As well as the mailboxes, also the process data sync managers have to be 4 byte aligned.
This means the triple buffers must each be 4 byte aligned. Values have to follow the calculatuion:
usSM2StartAddress + 3 * ((ulProcessDataOutput
Size + 3) & (~3)) < = usSM3StartAddress.
If this component is used, the configured values are automatically written to the virtual EEPROM
by the EtherCAT stack. The values for the default syncmanager length are defined by the amount
of configured process data (set in ECAT_SET_CONFIG_REQ_DATA_BASIC_T of the configuration
packet). This replaces the standard value 200 bytes used for Hilscher devices. Take care to adapt
the ESI file to the values you use in ECAT_ESM_CONFIG_SMLENGTH_T.
Packet description
The handshake configuration is also adjustable with the Sync Modes configuration parameter
(page 62) of the Set Configuration service. The Set Trigger Type request is only needed if the
Configuration can be changed.
The application must not send this service when the slave is in a process data exchange mode.
/* request packet */
typedef struct ECAT_DPM_SET_IO_SIZE_REQ_DATA_Ttag
{
uint32_t ulProcessDataOutputSize;
uint32_t ulProcessDataInputSize;
} ECAT_DPM_SET_IO_SIZE_REQ_DATA_T;
Packet description
/* confirmation packet */
typedef struct ECAT_DPM_SET_IO_SIZE_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_DPM_SET_IO_SIZE_CNF_T;
Packet description
/* request packet */
typedef struct ECAT_DPM_SET_STATION_ALIAS_REQ_DATA_Ttag
{
uint16_t usStationAlias;
} ECAT_DPM_SET_STATION_ALIAS_REQ_DATA_T;
Packet description
/* confirmation packet */
typedef struct ECAT_DPM_SET_STATION_ALIAS_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_DPM_SET_STATION_ALIAS_CNF_T;
Packet description
/* request packet */
typedef struct ECAT_DPM_GET_STATION_ALIAS_REQ_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_DPM_GET_STATION_ALIAS_REQ_T;
Packet description
/* confirmation packet */
typedef struct ECAT_DPM_GET_STATION_ALIAS_CNF_DATA_Ttag
{
uint16_t usStationAlias;
} ECAT_DPM_GET_STATION_ALIAS_CNF_DATA_T;
Packet description
/* request packet */
typedef struct ECAT_ESM_REGISTER_FOR_ALCONTROL_INDICATIONS_REQ_DATA_Ttag
{
uint32_t fEnableBootToInitHandling;
} ECAT_ESM_REGISTER_FOR_ALCONTROL_INDICATIONS_REQ_DATA_T;
Packet description
/* confirmation packet */
typedef struct ECAT_ESM_REGISTER_FOR_ALCONTROL_INDICATIONS_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_REGISTER_FOR_ALCONTROL_INDICATIONS_CNF_T;
Packet description
/* request packet */
typedef struct ECAT_ESM_UNREGISTER_FROM_ALCONTROL_INDICATIONS_REQ_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_UNREGISTER_FROM_ALCONTROL_INDICATIONS_REQ_T;
Packet description
/* confirmation packet */
typedef struct ECAT_ESM_UNREGISTER_FROM_ALCONTROL_INDICATIONS_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_UNREGISTER_FROM_ALCONTROL_INDICATIONS_CNF_T;
Packet description
Note: It is necessary to register the application by using the Register for AL Control Changed
Indications service in order to receive an AL Control Changed Indication.
For more information on this service, also refer to section AL Control Register and AL Status
Register, especially Figure 6 (page 21) and Figure 7 (page 22).
The master will set the flag fAcknowledge to 0x01 if the state change happens because of a
previous error situation of the slave. The master tries to reset this error situation with this state
change. In case of a regular state change (e.g. during system Startup), the flag fAcknowledge
will be set to 0x00.
For more information regarding fAcknowledge see reference [10].
According to reference [10], the last bits of the structure are reserved, respectively application-
specific.
/* indication packet */
typedef struct ECAT_ESM_ALCONTROL_CHANGED_IND_DATA_Ttag
{
ECAT_ALCONTROL_T tAlControl;
uint16_t usErrorLed;
uint16_t usSyncControl;
uint16_t usSyncImpulseLength;
uint32_t ulSync0CycleTime;
uint32_t ulSync1CycleTime;
uint8_t bSyncPdiConfig;
uint8_t bOriginState;
} ECAT_ESM_ALCONTROL_CHANGED_IND_DATA_T;
Packet description
/* response packet */
typedef struct ECAT_ESM_ALCONTROL_CHANGED_RES_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_ALCONTROL_CHANGED_RES_T;
Packet description
For more information on this service, also refer to section Handling and controlling the EtherCAT
State Machine, especially Figure 5: Sequence diagram of state change with indication to
application/host and Figure 7: Sequence diagram of state change controlled by application/host
with additional AL Status Changed indications.
If flag fChange is set to 0x01, the cause of the state change was the slave itself, which means that
the state change happened without request of the master because of an error situation of the slave
itself. To get more information check the usAlStatusCode field.
According to reference [10], the last bits of the structure are reserved, respectively application-
specific. The variable usErrorLed contains a code for the current state of the error LED. The
meaning of the possible codes is described in chapter Error LED status. The meaning behind each
LED signal is also defined in reference [10].
usAlStatusCode contains the current AL Status Code of the slave. For listings of supported
general and vendor specific AL Status Codes see chapter AL status codes.
Packet description
Packet description
/* request packet */
typedef struct ECAT_ESM_SET_ALSTATUS_REQ_DATA_Ttag
{
uint8_t bAlStatus;
uint8_t bErrorLedState;
uint16_t usAlStatusCode;
} ECAT_ESM_SET_ALSTATUS_REQ_DATA_T;
Packet description
/* confirmation packet */
typedef struct ECAT_ESM_SET_ALSTATUS_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_SET_ALSTATUS_CNF_T;
Packet description
/* request packet */
typedef struct ECAT_ESM_GET_ALSTATUS_REQ_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_GET_ALSTATUS_REQ_T;
Packet description
/* confirmation packet */
typedef struct ECAT_ESM_GET_ALSTATUS_CNF_DATA_Ttag
{
uint8_t bAlStatus;
uint8_t bErrorLedState;
uint16_t usAlStatusCode;
} ECAT_ESM_GET_ALSTATUS_CNF_DATA_T;
Packet description
6.4 CoE
Overview over the CoE packets of the EtherCAT Slave stack
Packet Command code Page
Send CoE Emergency service 0x1994, 0x1995 92
Table 69: Overview over the CoE packets of the EtherCAT Slave stack
/* request packet */
typedef struct ECAT_COE_SEND_EMERGENCY_REQ_DATA_Ttag
{
uint16_t usStationAddress;
uint16_t usPriority;
uint16_t usErrorCode;
uint8_t bErrorRegister;
uint8_t abDiagnosticData[5];
} ECAT_COE_SEND_EMERGENCY_REQ_DATA_T;
Packet description
/* confirmation packet */
typedef struct ECAT_COE_SEND_EMERGENCY_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_COE_SEND_EMERGENCY_CNF_T;
Packet description
/* request packet */
typedef struct ECAT_ESM_SII_READ_REQ_DATA_Ttag
{
uint32_t ulOffset;
uint32_t ulSize;
} ECAT_ESM_SII_READ_REQ_DATA_T;
Packet description
/* confirmation packet */
typedef struct ECAT_ESM_SII_READ_CNF_DATA_Ttag
{
uint8_t abData[ECAT_ESM_SII_READ_DATA_BYTESIZE];
} ECAT_ESM_SII_READ_CNF_DATA_T;
Packet description
/* request packet */
typedef struct ECAT_ESM_SII_WRITE_REQ_DATA_Ttag
{
uint32_t ulOffset;
uint8_t abData[ECAT_ESM_SII_WRITE_DATA_BYTESIZE];
} ECAT_ESM_SII_WRITE_REQ_DATA_T;
Packet description
/* confirmation packet */
typedef struct ECAT_ESM_SII_WRITE_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_SII_WRITE_CNF_T;
Packet description
/* request packet */
typedef struct ECAT_ESM_REGISTER_FOR_SIIWRITE_INDICATIONS_REQ_DATA_Ttag
{
uint32_t ulIndicationFlags;
} ECAT_ESM_REGISTER_FOR_SIIWRITE_INDICATIONS_REQ_DATA_T;
Packet description
/* confirmation packet */
typedef struct ECAT_ESM_REGISTER_FOR_SIIWRITE_INDICATIONS_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_REGISTER_FOR_SIIWRITE_INDICATIONS_CNF_T;
Packet description
/* request packet */
typedef struct ECAT_ESM_UNREGISTER_FROM_SIIWRITE_INDICATIONS_REQ_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_UNREGISTER_FROM_SIIWRITE_INDICATIONS_REQ_T;
Packet description
/* confirmation packet */
typedef struct ECAT_ESM_UNREGISTER_FROM_SIIWRITE_INDICATIONS_CNF_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_UNREGISTER_FROM_SIIWRITE_INDICATIONS_CNF_T;
Packet description
Note: It is necessary to register the application by using the Register for SII Write Indications
Request in order to receive an SII Write Indication
/* indication packet */
typedef struct ECAT_ESM_SII_WRITE_IND_DATA_Ttag
{
uint32_t ulSiiWriteStartAddress;
uint8_t abData[2];
} ECAT_ESM_SII_WRITE_IND_DATA_T;
Packet description
/* response packet */
typedef struct ECAT_ESM_SII_WRITE_RES_Ttag
{
HIL_PACKET_HEADER_T tHead;
/* no data part */
} ECAT_ESM_SII_WRITE_RES_T;
Packet description
Hexadecimal Definition
Value Description
0xC04C0009 HIL_E_ECAT_DPM_UPDATE_CFG_SM2_UPDATE_PARAMETER_IS_INVALID
Sm2 Update Parameter is invalid.
0xC04C000A HIL_E_ECAT_DPM_UPDATE_CFG_SM3_UPDATE_PARAMETER_IS_INVALID
Sm2 Update Parameter is invalid.
0xC04C000B HIL_E_ECAT_DPM_UPDATE_CFG_BUS_SYNC_UPDATE_PARAMETER_IS_INVALID
Bus-Sync Update Parameter is invalid.
Table 86: Status / error codes of ECAT_SET_CONFIG_REQ
8.1.3 ESM
Hexadecimal Definition
Value Description
0xC0AF000A HIL_E_ECSV4_ESM_TOO_MANY_APPLICATIONS_ALREADY_REGISTERED
Too many applications already registered for indications.
0xC0AF000B HIL_E_ECSV4_ESM_INPUTSIZE_AND_OUTPUSIZE_ZERO
Invalid I/O size: input size and output size both are 0.
0xC0AF000C HIL_E_ECSV4_ESM_OUTPUTSIZE_EXCEEDS_MAX
Invalid I/O size: output size exceeds maximum (depends on chip type).
0xC0AF000D HIL_E_ECSV4_ESM_INPUTSIZE_EXCEEDS_MAX
Invalid I/O size: input size exceeds maximum (depends on chip type).
0xC0AF000E HIL_E_ECSV4_ESM_SUM_OF_INPUTSIZE_AND_OUTPUSIZE_EXCEEDS_MAX
Invalid I/O size: sum of input size and output size exceeds maximum (depends on chip type).
Table 87: Status / error codes of the ESM (Base component)
8.1.4 MBX
Hexadecimal Definition
Value Description
0xC0B00001 HIL_E_ECSV4_MBX_INITIALIZATION_INVALID
Mailbox initialization invalid.
0xC0B00002 HIL_E_ECSV4_MBX_MAILBOX_NOT_ACTIVE
Mailbox is not active.
Table 88: Status / error codes of the MBX (Base component)
8.1.5 CoE
Hexadecimal Definition
Value Description
0xC0B10001 HIL_E_ECSV4_COE_SDOABORT_TOGGLE_BIT_NOT_CHANGED
Toggle bit was not changed.
0xC0B10002 HIL_E_ECSV4_COE_SDOABORT_SDO_PROTOCOL_TIMEOUT
SDO protocol timeout.
0xC0B10003 HIL_E_ECSV4_COE_SDOABORT_CLIENT_SERVER_COMMAND_SPECIFIER_NOT_VALID
Client/Server command specifier not valid or unknown.
0xC0B10004 HIL_E_ECSV4_COE_SDOABORT_OUT_OF_MEMORY
Out of memory.
Hexadecimal Definition
Value Description
0xC0B10005 HIL_E_ECSV4_COE_SDOABORT_UNSUPPORTED_ACCESS_TO_AN_OBJECT
Unsupported access to an object.
0xC0B10006 HIL_E_ECSV4_COE_SDOABORT_ATTEMPT_TO_READ_A_WRITE_ONLY_OBJECT
Attempt to read a write only object.
0xC0B10007 HIL_E_ECSV4_COE_SDOABORT_ATTEMPT_TO_WRITE_TO_A_READ_ONLY_OBJECT
Attempt to write to a read only object.
0xC0B10008 HIL_E_ECSV4_COE_SDOABORT_OBJECT_DOES_NOT_EXIST
The object does not exist in the object dictionary.
0xC0B10009 HIL_E_ECSV4_COE_SDOABORT_OBJECT_CAN_NOT_BE_MAPPED_INTO_THE_PDO
The object cannot be mapped into the PDO.
0xC0B1000A HIL_E_ECSV4_COE_SDOABORT_NUMBER_AND_LENGTH_OF_OBJECTS_WOULD_EXCEE
D_PDO_LENGTH
The number and length of the objects to be mapped would exceed the PDO length.
0xC0B1000B HIL_E_ECSV4_COE_SDOABORT_GENERAL_PARAMETER_INCOMPATIBILITY_REASON
General parameter incompatibility reason.
0xC0B1000C HIL_E_ECSV4_COE_SDOABORT_GENERAL_INTERNAL_INCOMPATIBILITY_IN_DEVICE
General internal incompatibility in the device.
0xC0B1000D HIL_E_ECSV4_COE_SDOABORT_ACCESS_FAILED_DUE_TO_A_HARDWARE_ERROR
Access failed due to a hardware error.
0xC0B1000E HIL_E_ECSV4_COE_SDOABORT_DATA_TYPE_DOES_NOT_MATCH_LEN_OF_SRV_PARAM
_DOES_NOT_MATCH
Data type does not match, length of service parameter does not match.
0xC0B1000F HIL_E_ECSV4_COE_SDOABORT_DATA_TYPE_DOES_NOT_MATCH_LEN_OF_SRV_PARAM
_TOO_HIGH
Data type does not match, length of service parameter too high.
0xC0B10010 HIL_E_ECSV4_COE_SDOABORT_DATA_TYPE_DOES_NOT_MATCH_LEN_OF_SRV_PARAM
_TOO_LOW
Data type does not match, length of service parameter too low.
0xC0B10011 HIL_E_ECSV4_COE_SDOABORT_SUBINDEX_DOES_NOT_EXIST
Subindex does not exist.
0xC0B10012 HIL_E_ECSV4_COE_SDOABORT_VALUE_RANGE_OF_PARAMETER_EXCEEDED
Value range of parameter exceeded (only for write access).
0xC0B10013 HIL_E_ECSV4_COE_SDOABORT_VALUE_OF_PARAMETER_WRITTEN_TOO_HIGH
Value of parameter written too high.
0xC0B10014 HIL_E_ECSV4_COE_SDOABORT_VALUE_OF_PARAMETER_WRITTEN_TOO_LOW
Value of parameter written too low.
0xC0B10015 HIL_E_ECSV4_COE_SDOABORT_MAXIMUM_VALUE_IS_LESS_THAN_MINIMUM_VALUE
Maximum value is less than minimum value.
0xC0B10016 HIL_E_ECSV4_COE_SDOABORT_GENERAL_ERROR
General error.
0xC0B10017 HIL_E_ECSV4_COE_SDOABORT_DATA_CANNOT_BE_TRANSFERRED_OR_STORED_TO_T
HE_APP
Data cannot be transferred or stored to the application.
0xC0B10018 HIL_E_ECSV4_COE_SDOABORT_DATA_CANNOT_BE_TRANSFERRED_OR_STORED_DUE_
TO_LOCAL_CONTROL
Data cannot be transferred or stored to the application because of local control.
0xC0B10019 HIL_E_ECSV4_COE_SDOABORT_DATA_CANNOT_BE_TRANSFERRED_OR_STORED_DUE_
TO_PRESENT_DEVICE_STATE
Data cannot be transferred or stored to the application because of the present device state.
0xC0B1001A HIL_E_ECSV4_COE_SDOABORT_NO_OBJECT_DICTIONARY_PRESENT
Object dictionary dynamic generation fails or no object dictionary is present.
Hexadecimal Definition
Value Description
0xC0B1001B HIL_E_ECSV4_COE_SDOABORT_UNKNOWN_ABORT_CODE
Unknown SDO abort code.
0xC0B1001C HIL_E_ECSV4_COE_EMERGENCY_MESSAGE_COULD_NOT_BE_SENT
CoE emergency message could not be sent.
0xC0B1001D HIL_E_ECSV4_COE_EMERGENCY_MESSAGE_HAS_INVALID_PRIORITY
CoE emergency message has invalid priority.
0xC0B1001E HIL_E_ECSV4_COE_SDOABORT_SUBINDEX_CANNOT_BE_WRITTEN_SI0_MUST_BE_0
Subindex cannot be written, Subindex 0 must be 0 for write access.
0xC0B1001F HIL_E_ECSV4_COE_SDOABORT_COMPLETE_ACCESS_NOT_SUPPORTED
Complete Access not supported.
0xC0B10020 HIL_E_ECSV4_COE_SDOABORT_OBJECT_MAPPED_TO_RXPDO_DOWNLOAD_BLOCKED
Object mapped to RxPDO. SDO Download blocked.
0xC0B10021 HIL_E_ECSV4_COE_SDOABORT_OBJECT_LENGTH_EXCEEDS_MAILBOX_SIZE
Object length exceeds mailbox size.
Table 89: Status / error codes of the CoE component
8.1.6 DPM
Hexadecimal Definition
Value Description
0xC0AE0001 HIL_DIAG_E_ECSV4_DPM_WATCHDOG_TRIGGERED
DPM watchdog triggered.
0xC0AE0002 HIL_E_ECSV4_DPM_REQUEST_ABORTED
Request has been aborted.
0xC0AE0003 HIL_E_ECSV4_DPM_NXD_GENERAL_ERROR
Unknown error while parsing database.
0xC0AE0004 HIL_E_ECSV4_DPM_NXD_NOT_AVAILABLE
No database available.
0xC0AE0005 HIL_E_ECSV4_DPM_NXD_INVALID_NXD_TYPE
Not an EtherCAT slave database.
0xC0AE0006 HIL_E_ECSV4_DPM_NXD_INVALID_STRUCTURE
Invalid database structure.
0xC0AE0007 HIL_E_ECSV4_DPM_NXD_INVALID_NXD_VERSION
Invalid database version.
0xC0AE0008 HIL_E_ECSV4_DPM_NXD_INVALID_ECS_CONFIG
Invalid EtherCAT slave stack configuration.
0xC0AE0009 HIL_E_ECSV4_DPM_NXD_INVALID_SM_CONFIG
Invalid Sync Manager configuration.
0xC0AE000A HIL_E_ECSV4_DPM_NXD_INVALID_SM0_CONFIG
Invalid Sync Manager 0 configuration.
0xC0AE000B HIL_E_ECSV4_DPM_NXD_INVALID_SM1_CONFIG
Invalid Sync Manager 1 configuration.
0xC0AE000C HIL_E_ECSV4_DPM_NXD_INVALID_SM2_CONFIG
Invalid Sync Manager 2 configuration.
0xC0AE000D HIL_E_ECSV4_DPM_NXD_INVALID_SM3_CONFIG
Invalid Sync Manager 3 configuration.
Table 90: Status / error codes of the DPM
8.1.8 ODV3
See reference [3].
Error class
The element Error Class (1 byte) generally classifies the kind of error, see table:
Class (hex) Name Description
1 vfd-state Status error in virtual field device
2 application-reference Error in application program
3 definition Definition error
4 resource Resource error
5 service Error in service execution
6 access Access error
7 od Error in object dictionary
8 other Other error
Table 96: SDO Abort codes: Error class
Error code
The element Error Code (1 byte) accomplishes the more precise differentiation of the error cause
within an Error Class. For Error Class = 8 (Other error) only Error Code = 0 (Other error code) is
defined, for more detailing the Additional Code is available.
Additional code
The additional code contains the detailed error description
9 Appendix
9.1 Legal notes
Copyright
© Hilscher Gesellschaft für Systemautomation mbH
All rights reserved.
The images, photographs and texts in the accompanying materials (in the form of a user's manual,
operator's manual, Statement of Work document and all other document types, support texts,
documentation, etc.) are protected by German and international copyright and by international
trade and protective provisions. Without the prior written consent, you do not have permission to
duplicate them either in full or in part using technical or mechanical methods (print, photocopy or
any other method), to edit them using electronic systems or to transfer them. You are not permitted
to make changes to copyright notices, markings, trademarks or ownership declarations.
Illustrations are provided without taking the patent situation into account. Any company names and
product designations provided in this document may be brands or trademarks by the
corresponding owner and may be protected under trademark, brand or patent law. Any form of
further use shall require the express consent from the relevant owner of the rights.
Important notes
Utmost care was/is given in the preparation of the documentation at hand consisting of a user's
manual, operating manual and any other document type and accompanying texts. However, errors
cannot be ruled out. Therefore, we cannot assume any guarantee or legal responsibility for
erroneous information or liability of any kind. You are hereby made aware that descriptions found
in the user's manual, the accompanying texts and the documentation neither represent a
guarantee nor any indication on proper use as stipulated in the agreement or a promised attribute.
It cannot be ruled out that the user's manual, the accompanying texts and the documentation do
not completely match the described attributes, standards or any other data for the delivered
product. A warranty or guarantee with respect to the correctness or accuracy of the information is
not assumed.
We reserve the right to modify our products and the specifications for such as well as the
corresponding documentation in the form of a user's manual, operating manual and/or any other
document types and accompanying texts at any time and without notice without being required to
notify of said modification. Changes shall be taken into account in future manuals and do not
represent an obligation of any kind, in particular there shall be no right to have delivered
documents revised. The manual delivered with the product shall apply.
Under no circumstances shall Hilscher Gesellschaft für Systemautomation mbH be liable for direct,
indirect, ancillary or subsequent damage, or for any loss of income, which may arise after use of
the information contained herein.
Liability disclaimer
The hardware and/or software was created and tested by Hilscher Gesellschaft für
Systemautomation mbH with utmost care and is made available as is. No warranty can be
assumed for the performance or flawlessness of the hardware and/or software under all application
conditions and scenarios and the work results achieved by the user when using the hardware
and/or software. Liability for any damage that may have occurred as a result of using the hardware
and/or software or the corresponding documents shall be limited to an event involving willful intent
or a grossly negligent violation of a fundamental contractual obligation. However, the right to assert
Warranty
Hilscher Gesellschaft für Systemautomation mbH hereby guarantees that the software shall run
without errors in accordance with the requirements listed in the specifications and that there were
no defects on the date of acceptance. The warranty period shall be 12 months commencing as of
the date of acceptance or purchase (with express declaration or implied, by customer's conclusive
behavior, e.g. putting into operation permanently).
The warranty obligation for equipment (hardware) we produce is 36 months, calculated as of the
date of delivery ex works. The aforementioned provisions shall not apply if longer warranty periods
are mandatory by law pursuant to Section 438 (1.2) BGB, Section 479 (1) BGB and Section 634a
(1) BGB [Bürgerliches Gesetzbuch; German Civil Code] If, despite of all due care taken, the
delivered product should have a defect, which already existed at the time of the transfer of risk, it
shall be at our discretion to either repair the product or to deliver a replacement product, subject to
timely notification of defect.
The warranty obligation shall not apply if the notification of defect is not asserted promptly, if the
purchaser or third party has tampered with the products, if the defect is the result of natural wear,
was caused by unfavorable operating conditions or is due to violations against our operating
regulations or against rules of good electrical engineering practice, or if our request to return the
defective object is not promptly complied with.
Confidentiality
The customer hereby expressly acknowledges that this document contains trade secrets,
information protected by copyright and other patent and ownership privileges as well as any related
rights of Hilscher Gesellschaft für Systemautomation mbH. The customer agrees to treat as
confidential all of the information made available to customer by Hilscher Gesellschaft für
Systemautomation mbH and rights, which were disclosed by Hilscher Gesellschaft für
Systemautomation mbH and that were made accessible as well as the terms and conditions of this
agreement itself.
The parties hereby agree to one another that the information that each party receives from the
other party respectively is and shall remain the intellectual property of said other party, unless
provided for otherwise in a contractual agreement.
The customer must not allow any third party to become knowledgeable of this expertise and shall
only provide knowledge thereof to authorized users as appropriate and necessary. Companies
associated with the customer shall not be deemed third parties. The customer must obligate
authorized users to confidentiality. The customer should only use the confidential information in
connection with the performances specified in this agreement.
The customer must not use this confidential information to his own advantage or for his own
purposes or rather to the advantage or for the purpose of a third party, nor must it be used for
commercial purposes and this confidential information must only be used to the extent provided for
in this agreement or otherwise to the extent as expressly authorized by the disclosing party in
written form. The customer has the right, subject to the obligation to confidentiality, to disclose the
terms and conditions of this agreement directly to his legal and financial consultants as would be
required for the customer's normal business operation.
Export provisions
The delivered product (including technical data) is subject to the legal export and/or import laws as
well as any associated regulations of various countries, especially such laws applicable in
Germany and in the United States. The products / hardware / software must not be exported into
such countries for which export is prohibited under US American export control laws and its
supplementary provisions. You hereby agree to strictly follow the regulations and to yourself be
responsible for observing them. You are hereby made aware that you may be required to obtain
governmental approval to export, reexport or import the product.
Conformance
EtherCAT Devices have to conform to the EtherCAT specifications. The EtherCAT Conformance
Test Policies apply, which can be obtained from the EtherCAT Technology Group (ETG,
www.ethercat.org).
Hilscher range of embedded network interface products are conformance tested for network
compliance. This simplifies conformance testing of the end product and can be used as a
reference for the end product as a statement of network conformance (when used with standard
operational settings). It must however be clearly stated in the product documentation that this
applies to the network interface and not to the complete product.
Conformance Certificates can be obtained by passing the conformance test in an official EtherCAT
Conformance Test lab. Conformance Certificates are not mandatory, but may be required by the
end user.
9.5 Contacts
Headquarters
Germany
Hilscher Gesellschaft für
Systemautomation mbH
Rheinstrasse 15
65795 Hattersheim
Phone: +49 (0) 6190 9907-0
Fax: +49 (0) 6190 9907-50
E-Mail: [email protected]
Support
Phone: +49 (0) 6190 9907-99
E-Mail: [email protected]
Subsidiaries
China Japan
Hilscher Systemautomation (Shanghai) Co. Ltd. Hilscher Japan KK
200010 Shanghai Tokyo, 160-0022
Phone: +86 (0) 21-6355-5161 Phone: +81 (0) 3-5362-0521
E-Mail: [email protected] E-Mail: [email protected]
Support Support
Phone: +86 (0) 21-6355-5161 Phone: +81 (0) 3-5362-0521
E-Mail: [email protected] E-Mail: [email protected]
France Korea
Hilscher France S.a.r.l. Hilscher Korea Inc.
69500 Bron Seongnam, Gyeonggi, 463-400
Phone: +33 (0) 4 72 37 98 40 Phone: +82 (0) 31-789-3715
E-Mail: [email protected] E-Mail: [email protected]
Support
Phone: +33 (0) 4 72 37 98 40 Switzerland
E-Mail: [email protected] Hilscher Swiss GmbH
4500 Solothurn
India Phone: +41 (0) 32 623 6633
Hilscher India Pvt. Ltd. E-Mail: [email protected]
Pune, Delhi, Mumbai Support
Phone: +91 8888 750 777 Phone: +49 (0) 6190 9907-99
E-Mail: [email protected] E-Mail: [email protected]
Italy USA
Hilscher Italia S.r.l. Hilscher North America, Inc.
20090 Vimodrone (MI) Lisle, IL 60532
Phone: +39 02 25007068 Phone: +1 630-505-5301
E-Mail: [email protected] E-Mail: [email protected]
Support Support
Phone: +39 02 25007068 Phone: +1 630-505-5301
E-Mail: [email protected] E-Mail: [email protected]