Te1610 en
Te1610 en
EAP Configurator
Version: 1.2
Date: 2016-08-18
Order No.: TE1610
Table of contents
Table of contents
1 Foreword .................................................................................................................................................... 4
1.1 Notes on the documentation............................................................................................................. 4
1.2 Safety instructions ............................................................................................................................ 5
2 Product description................................................................................................................................... 6
2.1 Overview........................................................................................................................................... 6
2.2 The functional principle of the TwinCAT EAP Configurator .............................................................. 7
2.3 Basic principles................................................................................................................................. 8
2.3.1 Communication methods .................................................................................................... 10
2.3.2 Remote station monitoring via ARP .................................................................................... 12
2.3.3 EAP send mechanism......................................................................................................... 13
2.3.4 EAP performance................................................................................................................ 15
2.3.5 The EAP state machine ...................................................................................................... 15
3 Installation................................................................................................................................................ 17
3.1 Supported operating systems ......................................................................................................... 17
3.2 Downloading the setup file.............................................................................................................. 17
3.3 Installation....................................................................................................................................... 17
3.4 After the installation ........................................................................................................................ 20
6 Appendix .................................................................................................................................................. 60
6.1 Creating the project examples ........................................................................................................ 60
1 Foreword
The responsible staff must ensure that the application or use of the products described satisfy all the
requirements for safety, including all the relevant laws, regulations, guidelines and standards.
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.
Trademarks
Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE®, XFC®and XTS® 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 patent applications and
patents:
EP1590927, EP1789857, DE102004044764, DE102007017835
with corresponding applications or registrations in various other countries.
The TwinCAT Technology is covered, including but not limited to the following patent applications and
patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.
EtherCAT® is registered trademark and patented technology, licensed by Beckhoff Automation GmbH,
Germany
Copyright
© Beckhoff Automation GmbH & Co. KG, Germany.
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.
Exclusion of liability
All the components are supplied in particular hardware and software configurations appropriate for the
application. Modifications to hardware or software configurations other than those described in the
documentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG.
Personnel qualification
This description is only intended for trained specialists in control, automation and drive engineering who are
familiar with the applicable national standards.
Description of symbols
In this documentation the following symbols are used with an accompanying safety instruction or note. The
safety instructions must be read carefully and followed without fail!
Risk of injury!
Failure to follow the safety instructions associated with this symbol endangers the life and
health of persons.
WARNING
Personal injuries!
Failure to follow the safety instructions associated with this symbol can lead to injuries to
persons.
CAUTION
Tip or pointer
This symbol indicates information that contributes to better understanding.
Note
2 Product description
The TwinCAT EAP Configurator is a tool for visualizing and configuring communication networks, in which
data exchange based on the EtherCAT Automation Protocol (EAP) takes place or is to be established. EAP
is used for master/master communication.
The TwinCAT EAP Configurator offers a graphical interface for a clear representation of the existing
communication links and for convenient configuration of new communication links.
The configuration of the participating EAP devices is read, so that the existing communication links can be
displayed. The configuration can then be modified and transferred back to the EAP devices. The
configuration is transferred with the aid of the TwinCAT EAP Configurator, without having to stop the
respective TwinCAT system. Only the cyclic processing operation of the affected EAP device has to be
interrupted for the duration of the transfer. During the transfer, the modified configuration is then written to
the EAP device.
Like TwinCAT 3, the TwinCAT EAP Configurator integrates itself into Microsoft Visual Studio. In this way it is
possible to use TwinCAT 3 projects and TwinCAT EAP Configurator projects in parallel in a Visual Studio
solution. However, the TwinCAT EAP Configurator can also be installed as a stand-alone tool.
2.1 Overview
The TwinCAT EAP Configurator is a Visual Studio package that integrates itself seamlessly into Microsoft
Visual Studio. The following overview shows the individual components of the EAP Configurator:
• Solution explorer:
In general, the Solution explorer is part of Visual Studio and it enables viewing and management of all
elements within the solution and the projects below. A TwinCAT EAP Configurator project (see
overview no. 1) has subordinate element nodes, each of which corresponds to a file (see overview no.
2) describing the configuration of an EAP device.
• Graphical editor:
The graphical editor (see overview no. 3) visualizes the configuration of all EAP devices of the EAP
Configurator project. The graphical editor reproduces the communication links between the EAP
devices in a transparent manner and enables the configurations of the EAP devices involved to be
modified.
• EAP Config Tool window:
A complete overview of all configuration data of an EAP device can be displayed in the form of a two-
stage table in the EAP Config Tool window (see overview no. 4), referred to as object dictionary.
This component also contains the operating elements for transferring a modified configuration to the
EAP device, in order to activate it.
• Properties window:
The main properties of a graphical object, which is selected with the mouse in the graphic editor, are
shown in the Properties window (see overview no. 5). The properties can then be modified as required.
• Toolbox window:
The Toolbox window (see overview no. 6) provides the user with the tools required for adding new
objects to an EAP device or generating new communication links. This is necessary in situations where
further Publisher or Subscriber variables are to be configured.
The TwinCAT EAP Configurator can read the objects of the EAP object dictionary from an EAP device and
interpret them based on the EAP profile specification. In this way the EAP Configurator is able to display the
communication links between all read EAP devices. If the configuration of an EAP device is changed, the
content of the read objects is modified, deleted, or additional objects are created. The modified set of objects
can then be re-written to the respective TwinCAT EAP devices, so that the modifications are applied.
By default, the TwinCAT EAP Configurator communicates with a TwinCAT EAP device via the ADS/AMS
protocol during reading and writing of objects. ADS stands for Automation Device Specification. It describes
a device- and fieldbus-independent interface. AMS stands for Automation Message Specification. It enables
addressing of central and local systems such as PCs, and also Bus Controllers. ADS/AMS was specified by
Beckhoff and is supported by the TwinCAT router. Messages that are sent in a network beyond the computer
boundaries are transferred via TCP/IP. Therefore, the TwinCAT EAP Configurator can communicate via
ADS/AMS both with a TwinCAT EAP device, which exist locally on the same PC, and with a TwinCAT EAP
device that runs on another PC, which is integrated in the network.
Alternatively, the TwinCAT EAP Configurator can use the AoE protocol (AoE = ADS over EtherCAT) for
reading and writing objects. The IP and UDP protocols are used for relaying and transporting the AoE
messages. On this basis, each device within the network can be reached via an IP address. The
specification of the AoE protocol can be found in the EtherCAT Protocol Enhancements (ETG 1020).
The difference between ADS/AMS communication and AoE communication is that, in contrast to ADS/AMS
communication, AoE communication requires no TwinCAT router. The AoE protocol is one of the protocols
that are classified as mailbox communication in TwinCAT.
TwinCAT processes both protocols acyclically. Their sole purpose is transfer of configuration data from or to
the EAP device. Only the process data of EAP devices are processed and transferred cyclically and highly
deterministically. The configuration of an EAP device defines the structure, size and transmission type of the
process data.
The communication between EAP devices takes place based on the Publisher/Subscriber principle. The
senders, referred to as Publishers, send messages to all or several network devices; as a rule, a Publisher
does not know the receivers or whether a receiver exists at all. On the other side there are receivers,
referred to as Subscribers, which are interested in certain messages and receive these, without knowing
from which Publisher they originate or whether such a Publisher exists at all.
At the next higher level, TxVariables are referenced in the TxPDO elements (TxPDO =
TxProcessDataObjects). A TxPDO can reference several TxVariables, thereby consolidating them in an
object. The TxPDO then defines an ordered set of TxVariables. The condition that the maximum size of an
EAP frame must not be exceeded also applies to a TxPDO.
The TxData element (TxProcessData = TxPD) is located at the next higher level. It represents a Publisher
variable and is understood as communication unit of the Publisher in EAP. The TxData element references a
certain TxPDO and defines a number of properties, such as the ID of the Publisher variable, their version
and the clock cycle, based on which the Publisher variable is sent in the first place. Based on these
properties, the Publisher variable defines an object on the sender side, for which a suitable Subscriber
variable must be defined on the receiver side, so that successful data exchange can take place.
The data transfer takes place network-based via the Ethernet protocol or via UDP/IP. Similarly, a TxFrame is
then assigned a list of TxData, which are to be sent to the same destination address. A TxFrame is limited to
a maximum data length per data packet. For sending a Publisher variable, at least the following properties
must be defined:
Destination address:
The destination address is usually a multicast address, so that the Publisher variable is automatically sent to
a group of receivers. It is also possible to enter the address of an individual receiver.
ID:
For each Publisher variable a number is defined, which must be unique across the network. Based on this
number, the Publisher variable can be identified by a Subscriber.
Clock cycle:
The clock cycle defines the interval at which the Publisher variable is sent. EAP cycle times generally range
between a few milliseconds up to several 100 milliseconds.
Accordingly, the elements at the level above are referred to as RxPDOs (RxProcessDataObjects). Each
element defines an ordered set of RxVariables.
The RxData element (RxProcessData = RxPD) is located at the next higher level. It represents a Subscriber
variable and is understood as communication unit of the Subscriber in EAP. The RxData element references
a certain RxPDO and defines the required properties (ID and version), which must match the Publisher
variable to be received. For a successful data exchange, the data types of the referenced RxVariable and its
order in the RxPDO must be identical to the TxPDO of the Publisher variable. The Subscriber variable thus
defines an object on the receiving side, for which a matching Publisher variable must be defined on the
sender side, in order for data exchange to take place.
Due to the design of the EtherCAT Automation Protocol, for a Subscriber it is irrelevant from which sender
the received data originate. In particular, it is irrelevant which Publisher variables are sent within a frame. For
this reason the Subscriber has no frame element or similar, which would consolidate certain Subscriber
variables as a unit, so that they would only be received en bloc. Nevertheless, RxData offers an option to
define an AMS NetID as a filter address, in cases where a Subscriber should only receive the Publisher
variables of a certain sender. In this case, at least the following properties must be defined for a Subscriber
variable:
ID:
The ID of a Subscriber variable defines which Publisher variable should receive it. The ID is a number, which
should be unique for each Publisher variable across the whole network. It is used to identify the Publisher
variable at the receiving end.
In addition, the data length of the Subscriber variable must be identical to data length of the Publisher
variable. Otherwise the received Publisher variable is discarded.
Pushed Data Exchange mode, in which an EAP sender sends its process information to the network either
cyclically or when a change in status is detected, and an EAP receiver expects this process information and
receives it accordingly. This mode corresponds to the Publisher/Subscriber principle of the network variables
(NWV) of TwinCAT 2.
Polled Data Exchange mode, in which an EAP client sends a request telegram with its process information
to an EAP server, which then sends its process information back to the EAP client in a response telegram.
In addition, the TwinCAT EAP device supports different connection types and different addressing modes
during process data communication. The supported connection types are:
• Unicast: The EAP message is sent from one end point to another end point, in other words: the
message is addressed to precisely one PC.
• Multicast: The EAP message is sent from one end point to several other end points, in other words:
the message is addressed to a group of PCs.
• Broadcast: The EAP message is sent from one end point to all accessible end points, in other words:
the message is addressed to all devices.
MAC addresses, AMS NetIDs or IP addresses can be used. Depending on the configuration of the
connection type and the addressing mode, a particular network protocol is activated for the EAP process
data communication. The exact assignment is shown in table Network protocols [} 10].
Depending on the different addressing modes (MAC, AMS NetID and IP), the connection types’ unicast,
multicast and broadcast are supported as follows:
MAC addressing:
The EAP message is transferred based on the Ethernet protocol. The MAC address of the network adapter
that is to receive the message is configured as destination address. With this addressing mode, the EAP
message cannot be relayed from a router to another subnet, since it operates based on IP addresses. The
message can therefore only be sent within a subnet via switches.
IP addressing:
For the EAP message, the Internet protocol (IP) is used in conjunction with the User Datagram Protocol
(UDP) for relaying and addressing of the recipient. The required destination MAC address is determined
based on the Address Resolution Protocol (ARP) and the configured IP address. With UDP/IP addressing, a
router can relay the EAP message to other subnets (including the internet, for example).
Broadcast IP: 255.255.255.255 is specified as broadcast IP address. The broadcast MAC address FF-FF-
FF-FF-FF-FF is derived directly from this IP address.
Multicast IP: A multicast IP address must be in the range 224.0.0.0 to 239.255.255.255 (IPv4). In the EAP
device, TwinCAT generates a compliant multicast MAC address for each configured multicast IP address,
which is used when TwinCAT starts up (i.e. when the Run mode is activated).
With Pushed Data Exchange, the addressing mode (unicast, multicast or broadcast) for each configured
EAP telegram can be freely selected as required.
Note
Network protocols
Ethernet protocol
The Ethernet protocol is responsible for switching the data packets in the network. It handles the tasks of
OSI layers 1 and 2 (physical layer and data link layer). The Ethernet protocol header should contain a sender
address, a receiver address and an Ethernet type, which specifies which protocol is used for the next higher
OSI layer. The sender and receiver addresses are entered in the form of a MAC address. MAC stands for
media access control and in this case refers to the unique hardware address assigned to each Ethernet
device during production. The Ethernet port of a Beckhoff PC could be assigned the MAC address
00:01:05:34:05:84, for example; "00:01:05" is the Beckhoff ID, and the second part is specified during
production. The sender and receiver MAC addresses determine the route of each Ethernet telegram
between two PCs in the network. An Ethernet telegram can be processed further via a switch, but usually not
via a router.
TwinCAT identifies an EAP telegram either on the basis of Ether type 0x88A4 (if the Ethernet protocol is
used) or on the basis of the destination port 0x88A4 (for UDP/IP). Accordingly, the TwinCAT Ethernet driver
makes a received EAP telegram bypass the NDIS stack of the operating system, so that TwinCAT treats it
preferentially as a Beckhoff real-time Ethernet telegram. When an EAP telegram is sent, the NDIS stack of
the operating system is also bypassed.
Once an EAP telegram has been received by a TwinCAT PC and identified as such, during further
processing of the telegram the process data (PD) transported in the telegram are assigned to the RxData
configured in the EAP device. This assignment is based on the PD ID. The received PD is discarded, if no
RxData with matching PD ID were configured at the receiver.
Finally, the values of the individual process variables (PV) of a PD are only applied if, in addition, the data
length and the version number of the received PD match the expected data length and version number.
If Subscriber Monitoring is enabled, the Publisher sends an ARP Request telegram to the configured target
device, based on the configured time interval. If the receiver still operates as expected, it responds with an
ARP reply telegram. Otherwise there is no response. In the diagnostic variable FrameState (see Publisher),
the third bit (0x0004) is set in the event of an error.
ARP handling
The ARP handling for assigning MAC addresses to network addresses (IP addresses) is
treated by the operating system (Windows). The ARP handling for assigning MAC ad-
Note dresses to AMS NetIDs is handled by the TwinCAT system.
There are 5 different types of trigger conditions, which are described here.
1. Poll Request Rx PD
The trigger condition Poll Request Rx PD controls the sending of a response telegram in Polled Data
Exchange mode (see section Communication methods [} 10]). Once a TxData has a valid entry for
the trigger condition Poll Request Rx PD, the respective TxData operates in this mode. A valid entry is
present, if it matches the object index of an RxData configured in the EAP device. This RxData then
defines the expected request for returning the TxData as response. When the EAP device receives an
EAP telegram containing the expected process data, in the next cycle the TxData is returned in a new
EAP telegram to the sender of the request telegram. Consequently, the EAP device serves as Polled
Data Exchange server for this TxData, when the trigger condition Poll Request RxData is enabled.
All other conditions (2 to 5) have to be disabled, if the Poll Request Rx PD condition is enabled.
2. Divider/Modulo
A Divider/Modulo condition is used to specify the frequency with which a TxFrame or a TxData is sent
(see illustration above). The frequency is always a multiple of the task cycle time driving the EAP
device. The divider value defines the multiple. The Modulo value specifies the start cycle at which the
TxFrame or the TxData is sent for the first time. If the Divider has the value 0, this condition is
disabled.
Conditions 3, 4 and 5 are not relevant if the Divider/Modulo condition is enabled; they should
nevertheless be disabled. Condition 1 must be disabled.
3. Cycle Time
The TxData is sent at particular intervals, as defined by the cycle time value (unit: µs) (see illustration
below). The cycle time should be an integer multiple of the task cycle time. If a value is configured that
is not an integer multiple of the task cycle time, the next smaller multiple is set automatically, down to
0, if necessary. If the value is 0 µs, this condition is disabled.
Trigger conditions 1, 2, 4 and 5 should be disabled, if the cycle time trigger condition is enabled.
A combination of the conditions is not recommended because they are not clearly defined. The following
gives a good example of the complexity:
The last line clearly shows that the transmission at 160 ms and 240 ms does not take place because it is
prevented by the additional divider/modulo conditions.
In a network, in which other communication takes place in parallel, the performance of the EAP
communication can be impaired.
The regular state of each EAP device after it started is the OP state. Until the OP state is reached, the EAP
device is switched once to each state in turn. During each state transition the EAP device performs certain
actions. If an error occurs during one of the transitions, the device cannot be switched to the corresponding
subsequent state and therefore remains in the state that was reached last. A readable error code can be
used to diagnose the reason for the error.
Init
As a rule, the Init state of an EAP device is a temporary state. That is, the EAP device cannot be set to the
Init state explicitly. Nevertheless, there are cases in which the SM resets the EAP device to the Init state. In
this state neither mailbox communication nor process data communication with the EAP device is possible.
Pre-Operational (Pre-Op)
During the transition from Init to Pre-Op, the EAP device checks whether the mailbox was initialized
correctly. In Pre-Op state, mailbox communication is possible, but not process data communication.
Safe-Operational (Safe-Op)
During the transition from Pre-Op to Safe-Op, the EAP device checks the internal object references and
updates:
• the cycle time-based configuration parameters,
• the reference pointers to the input and output variables of the process image, and
• the mapping of each Publisher/Subscriber variables to its process variables from the PLC.
In Safe-Op state, mailbox communication and sending of Publisher variables takes place. No EAP telegrams
are received yet.
Operational (Op)
During the transition from Safe-Op to Op, the EAP device checks once again whether an error has occurred
during startup.
In Op state the EAP device receives incoming EAP telegrams and copies the received process data to the
input variables, if required. Mailbox communication takes place, Publisher variables are sent, and Subscriber
variables are received.
If an error occurs in one of the state transitions, the EAP device remains either in the last reached state, or it
is reset to Safe-Op state. At the same time, the error bit and a corresponding error code are set (cf. section
The CANopen object dictionary in the documentation for the TwinCAT EAP device). Typical errors occur due
to inconsistencies in the CANopen object dictionary, for example, so that the configuration is invalid.
3 Installation
The TwinCAT EAP Configurator is supplied with a setup program. The latest version is always available for
download from the Beckhoff website.
3.3 Installation
Description of the installation procedure of a TwinCAT 3 Function for Windows-based operating Systems.
1. Double-click the downloaded setup file "TE1610 TC3 EAP-Configurator.exe".
Please note: Under Windows 32-bit/64-bit, please start the installation with "Run as Administrator" by
right-clicking the setup file and selecting the corresponding option in the context menu.
4. To install the full product, including all sub-components, please choose "Complete" as the Setup
Type.Alternatively you can also install each component seperately by choosing "Custom".
4 First steps
Before the TwinCAT EAP Configurator can be used in a meaningful manner, at least two TwinCAT EAP
devices have to be created in a network with the aid of TwinCAT via the I/O configuration and enabled, if
necessary. The configuration of a TwinCAT EAP device is described in the documentation for the TwinCAT
EAP device. A section is devoted to the subject of how TwinCAT can be used to create an EAP device
configuration (EDC) file for an EAP device.
EDC file
For convenience, an EDC file should generally be created for each TwinCAT EAP device
for subsequent import in the TwinCAT EAP Configurator.
Note
The two TwinCAT projects Measuring and Operating should each control a machine, which together form a
small production line. The project Measuring includes the configuration of the first machine, referred to as
machine M below. It measures a particular product property (e.g. a length). The project Operating includes
the configuration of the second machine, referred to as machine O below. It machines a product (e.g. a
groove is milled, which matches the measured length).
The whole processing operation in the production line should run as follows (see illustration below): Machine
M measures a product. When the measurement is completed, machine M is ready to output the measured
value for machining the product. When a request from machine O is detected in machine M via the input
variable in_Req, the measured value is written to the dedicated output variable out_Measure. (In the project
example the measured values vary randomly between 4500 and 5500.) In addition, the current product ID is
written to the variable out_ProductID, and the request from machine O is acknowledged using the variable
out_Ack. Once the request has been processed, the input variable in_Req is reset, and the next product is
measured.
Machine O uses its output variable out_Req to indicate that it is ready to machine the next product. The
machine then waits for confirmation from Machine M that the next product with the required processing
parameters is ready for machining. Machine O expects the confirmation in the variable in_Ack; the
processing parameters are expected in the variables in_Measure and in_ProductID. When machine O
receives an acknowledgement, the output variable out_Req is reset, and the product is machined. The next
product is requested once the machining is complete. The duration of the machining depends on the
measured value. (In this example: processing duration in milliseconds = value / 2, i.e. the processing
duration varies between 2250 ms and 2750 ms).
1. Double-click on Device 1 (EtherCAT Automation Protocol) to open it from the I/O configuration.
2. Select the Protocol tab and click on [Export Configuration File…].
ð The Save As dialog opens.
3. Define the file name and the storage location for the EDC file.
Ideally, the EDC file of machine M should have the name Measuring_EapDev_1.xml. Accordingly, the EDC
file of machine O should have the name Operating_EapDev_1.xml.
In both project examples a small example PLC program with a few input and output variables was created.
The symbol information for these variables is automatically saved in the EDC files during export. The
TwinCAT EAP device can subsequently access the contents of these variables using this symbol
information.
2. From the list Installed Templates select the entry EtherCAT AP Project.
3. Enter a name for the project (e.g. TwinCAT Plant 1) and, if applicable, select a directory, under which
the project is to be stored.
4. Then confirm your inputs with [OK] button.
ð The project node is created and displayed in Visual Studio.
2. Assign meaningful names for your EAP devices (e.g. the name Measuring for machine M and the name
Operating for Machine O) and confirm your entry with the [Add] button.
ð The created device nodes then represent the corresponding EAP devices of the two machines.
Once all required device nodes have been created, open any device node by double-clicking. The graphical
user interface opens, loads all device nodes that were created and displays them as EAP device objects
(see illustration). Each EAP device object is shown as a box in column Publisher Area and in column
Subscriber Area. In other words: An EAP device object is graphically represented by two boxes (see section
Architecture [} 35]).
When the current configuration is read, the previously imported device configuration is discarded and
replaced by the read configuration. The imported symbol information remains unchanged.
3. Then click on the EAP device object, which is to receive the data.
(see illustration above)
ð A dialog opens, in which the symbol names of the PLC variables are listed, which were imported
from the EDC file (see illustration below).
The list on the left shows the symbol names of all output variables of the sender, the list on the right shows
the symbol names of all input variables of the receiver.
4. In the list on the left select the variable whose values are to be sent.
5. In the list on the right select the variable, which is to receive the sent values.
6. Use the [Generate] button to generate the communication link.
ð Further connections between the two EAP device objects can then be configured, or the dialog can be
closed via the [Close] button.
In this example all output variables are successively linked to the corresponding input variables, so that in
the end three Publisher boxes, each with a TxData, are configured for the sender and three RxData for the
receiver (see illustration).
Once the required configuration is complete, it has to be transferred to the EAP device. This measure is
described in section Transferring the new/modified configuration to the EAP devices [} 32].
To this end, set the property Type to Multicast in the Properties window of the respective Publisher box
(TxFrame). The TwinCAT multicast address for EAP devices is then automatically entered as the standard
multicast address under the property Target MAC (see illustration).
Once the configuration has been modified, it has to be transferred to the EAP device. This measure is
described in section Transferring the new/modified configuration to the EAP devices [} 32].
In this example the measurement takes 200 ms. Accordingly, the Change Timeout Time is set to 150000 µs
for all three TxData of machine M, and the Inhibit Time to 0 µs (see illustration). As a result of this setting, the
variables are resent after 150000 µs = 150 ms at most, even if their values have not changed. If the value of
a variable changes with each task cycle (e.g. every 10 ms), the variable is sent once in each cycle (due to
the Inhibit Time = 0 µs).
Similarly, a timeout value of 1000000 µs = 1000 ms can be configured for the TxData of Machine O. In this
example the processing time of Machine O is based on the measured values for Machine M. The measured
values vary between 4500 and 5500. Processing in Machine O then takes half the measured value in
milliseconds (cf. Project examples [} 21]). Accordingly, it is sufficient for Machine O to send the request
variable every second at most.
Once the configuration has been modified, it has to be transferred to the EAP device. This measure is
described in section Transferring the new/modified configuration to the EAP devices [} 32].
The required commands can be found in the context menus of the respective graphical objects. Alternatively,
the familiar keyboard shortcuts ([Ctrl] + [X] for cut, [Ctrl] + [V] for paste and [Delete] for delete) can be used.
1. Select the TxData from the second Publisher box and cut it using the [Cut] command (see illustration).
2. Then select the first Publisher box and use the [Paste] command to insert the TxData (see illustration).
ð Proceed accordingly for the TxData from the third Publisher box.
Finally, the two empty Publisher boxes can be deleted by selecting them sequentially and using the [Delete]
command (see illustration).
Once the configuration has been modified, it has to be transferred to the EAP device. This measure is
described in section Transferring the new/modified configuration to the EAP devices [} 32].
In this example the Local AoE Net ID of the EAP device sending the required variable is entered in the Filter
AMS Net ID under the properties of the RxData (see illustration).
This setting ensures that the EAP variable is only received, if it was sent by the EAP device with the
specified NetID.
Once the configuration has been modified, it has to be transferred to the EAP device. This measure is
described in section Transferring the new/modified configuration to the EAP devices [} 32].
A configuration can only be written successfully, if the TwinCAT EAP device is in state PREOP. The state
can be switched using the icon bar in the EAP Config Tool Window (see section Displaying the object
dictionary [} 41]). The EAP Config Tool Window is opened by clicking the command Show in Tool Window
from the context menu for the EAP device object. The icon bar is located at the top of the window. The first
four icons are used to change the state of the TwinCAT EAP device.
1. Icon => Init (INIT)
A device configuration can then be written by running the command Write All to Device, which can be found
in the context menu of the EAP device object or in the icon bar . This command can be used to transfer
all configuration data of the EAP device object to the TwinCAT EAP device.
Once the transfer is complete, the successfully written configuration data are marked in green. Any
configuration data for which the transfer failed are marked in red. Finally, the EAP device must be set to OP
state again with the aid of the icon , so that the configured process data are processed cyclically (see
section Writing a new device configuration [} 41]).
3. Specify a name and a storage location for the project and click [OK].
ð The project is generated, and the Solution Explorer contains a project node with the selected project type
and the required name.
2. Enter a name for the new EAP device node and confirm the dialog with [OK].
For each EAP device in the network exactly one EAP device node should be created. Each device node is
saved as a separate file in the project directory.
Any device node can be opened from the project, either by double-clicking with the left mouse button or with
the [Open] command from the context menu of the device node. When a node is opened, all device nodes
contained in the project are loaded and shown in the graphical user interface that opens (see illustration).
The EAP device object whose device node was opened is shown at the top. An EAP device object therefore
represents an EAP device.
5.1.1 Architecture
The graphical user interface is divided into three columns: the Publisher area is on the left, the Subscriber
area is on the right, and the Configuration area is in the middle. When the user interface is opened, each
project node contained in it is displayed graphically as an EAP device object. Each EAP device object is
shown as a box in column Publisher Area and in column Subscriber Area. In other words: An EAP device
object is graphically represented by two boxes.
Counting from the top, the third box in the Publisher Area represents the same EAP device as the third box
in the Subscriber Area, for example. Whenever the graphical user interface is reopened, the Configuration
Area is empty. A double-click on an EAP device object from one of the two other Areas results in the two
corresponding boxes to be contracted and displayed in the form of a single box in the Configuration Area.
The two individual boxes are then no longer displayed in the Publisher and Subscriber Areas.
The communication links are only displayed across the column borders between Publisher Area and
Configuration Area and between Configuration Area and Subscriber Area. This reduced representation
makes a diagnosis of the communication links between the devices more transparent.
In the Publisher Area only the Publishers of an EAP device are displayed, the structure of which is explained
in section Structure of an EAP Publisher [} 8].
In the Subscriber Area only the subscribers of an EAP device are displayed, the structure of which is
explained in section Structure of an EAP Subscriber [} 9].
Initially, no EAP device object is displayed in the Configuration Area. The two corresponding boxes from the
Publisher and Subscriber Areas are only brought together and displayed in the Configuration Area when an
EAP device object (e.g. Device1.eap) is double-clicked with the left mouse button from one of the two other
areas. The two individual boxes are then no longer displayed in the Publisher and Subscriber Areas. Only
one device object at a time is displayed in the Configuration Area. In other words, double-clicking on another
EAP device object in the Publisher/Subscriber Area (e.g. Device2.eap) results in Device1 being moved back
from the Configuration Area to the Publisher/Subscriber Area , while Device2 is moved to the Configuration
Area.
In the Configuration Area both the Publishers and the Subscribers of the EAP device are displayed. In
addition, the communication links between the EAP device object displayed in the center and the EAP
device objects to the left and right are displayed. All other communication links not involving the current EAP
device remain invisible.
Communication link
A communication link, which leads to a data exchange between an EAP device object as source (Publisher/
TxData) and an EAP device object as sink (Subscriber/RxData) based on the previously implemented
configuration, is represented by an arrow from the source to the sink. A communication arrow always points
from a TxData of a device object to an RxData of another device object. A communication link within an EAP
device object (loop), i.e. from a TxData to an RxData of the same EAP device object, can neither be
configured nor displayed. This matches the actual properties of a TwinCAT EAP device. The color of the
communication arrow indicates the connection type configured by the Publisher:
Color Connection type
black Unicast
green Multicast
blue Broadcast
The Frame, TxData and RxData tools are handled in the same way.
1. Left-click on one of the tools.
2. Pull the mouse pointer to the position at which the new element is to be generated.
The required element cannot be generated at the current position while the mouse pointer shows a
prohibited action symbol (red circle with a diagonal line) . Otherwise the mouse pointer changes to
the symbol for the respective tool.
3. Press the left mouse button again.
ð The new element is added, and the standard tool (Pointer) becomes active again.
The standard tool is the Pointer . This is usually enabled. If another tool was enabled and the ESC key or
the right mouse button is pressed later, the Pointer tool becomes active again.
The Pointer tool can be used to select individual objects, e.g. in order to view their properties in the
Properties window. In addition, the EAP device object can be moved vertically within the Configuration Area.
A double-click can be used to bring another EAP device object from the Publisher/Subscriber Area into the
Configuration Area. In addition, the names of the elements of an EAP device object can be selected and
modified by double-clicking.
Right-clicking on one of the elements opens a context menu listing some commands that can be executed
on the respective element. The standard commands [Cut], [Copy], [Paste] and [Delete] are generally
supported for all elements. They can be used to cut, copy, paste or delete elements, as usual for many other
applications.
The [Properties] command opens the Properties window, in which the configuration properties of the
respective element can be found.
The Frame tool is used to generate a new TxFrame element within an EAP device object. Frame
elements can only be generated within the box of an EAP device object that is located within the Publisher
Area or the Configuration Area.
Within a TxFrame, TxData elements are then added with the aid of the TxData tool . TxData elements
cannot be generated anywhere else.
In addition to the standard commands, the context menu for the TxData element contains the command
[Process Data Configuration]. The command opens a dialog for generating and editing TxPDO elements.
One of the TxPDOs can then be selected for the TxData. A more detailed description of the dialog can be
found in section Generating a communication link manually [} 40].
The RxData tool is used to generate a new RxData element within an EAP device object. RxData
elements can only be generated within the box of an EAP device object that is located within the Subscriber
Area or the Configuration Area.
Like for TxData elements, in addition to the standard commands, the context menu for the RxData element
contains the command [Process Data Configuration], which can be used to generate and edit RxPDO
elements, and to assign them to the RxData (cf. section Generating a communication link manually [} 40]).
The Connector tool is a wizard, used for semi-automatic configuration of a communication link between
two EAP device objects. Two application cases are supported: TxData to RxData and EAP device object to
EAP device object.
TxData to RxData
The first case relates to the application of a Connector between TxData and RxData. For this action the
properties of the respective Publisher and Subscriber elements are adjusted such that a communication link
is created.
1. Select the Connector tool.
2. Drag the mouse pointer to the required TxData element.
3. Press the left mouse button.
It lists three options which can be set as required, and depending on the current configuration status:
• Set Frame Target Address from Target EAP Device.
This option is enabled by default. In this case, the AMS NetID of the target EAP device is entered as
destination address during automatic generation of the TxFrame.
• Set ID and Version from TxData.
This option ensures that the identification number and the version number of the selected TxData
element are adopted during configuration of the RxData Subscriber element. If these two properties do
not match, a communication link cannot be established.
• Generate Process Variables corresponding to TxData PDO.
This option is only available if a TxPDO has already been defined and configured on the Publisher side
for the TxData. Ideally, the TxPDO should already have the full list of references for the required Tx
variables. This ensures that the whole RxPDO including all required Rx variables is created and
configured on the receiving side. Accordingly, the communication link is then also configured correctly.
The dialog is divided into two halves. In the left half, a list box shows all symbol names of process variables
whose data can be sent with the aid of the EAP device. The process variables may originate from a PLC
program of the machine on which the EAP device was instantiated, for example.
In the right half, the symbol names of the process variables of the target machine are listed, to which the
target EAP device can write the received data. If no symbol names are listed, no communication link can be
generated.
The dialog offers several filter options for the symbol table. One option is to display all available symbol
names: either symbols that have already been used, together with unused symbols (Used and Unused); or
only symbols that have not yet been used (Unused).
In addition, you can select whether only the symbols for the input variables should be listed (Exclude Output
enabled) or only the symbols for the output variables (Exclude Input enabled) or both (neither Exclude Input
nor Exclude Output enabled). By default only the symbols for the output variables are shown on the left (for
the EAP Publisher) and only the symbols for the input variables on the right (for the EAP Subscriber).
If a symbol from one of the two lists has been selected, the two filter options Matching Size and Matching
Type can be used in a meaningful way. If, for example, the symbol for a process variable was selected on
the left for the EAP Publisher, the symbol name list for the EAP Subscriber on the right can be filtered such
that only the symbol names of the process variables are listed,
Finally, there is the option Set Frame Target address from Target EAP Device. This option is enabled by
default. In this case, the AMS NetID of the target EAP device is entered as destination address during
automatic generation of the TxFrame.
Import/Export
The configuration of an EAP device can be exported to an XML-based file via the command [Export EAP
Device Config File]. This file is therefore referred to as EAP Device Configuration (EDC). A TwinCAT EAP
device that was created and configured with TwinCAT 3 also offers a function for exporting its configuration
to an EDC file. The TwinCAT EAP Configurator can then read this file via the import function [Import EAP
Device Config File]. On import of an EDC file the existing configuration is discarded and is therefore lost, if it
was not backed up.
In addition to the EAP configuration, an EDC file exported from TwinCAT 3 also contains the symbol
information for all PLC programs created in the TwinCAT project. After import of the EDC file into the
TwinCAT EAP Configurator, this symbol information is available for creating communication links.
An TwinCAT EAP device only becomes active once it was configured and activated via TwinCAT 3. If one of
these prerequisites is not met, the TwinCAT EAP Configurator cannot communicate with the EAP device.
Once the current EAP configuration has been read, it is visualized directly.
Before a configuration can be transferred to a TwinCAT EAP device, the device must be set to a suitable
state, in which changing the configuration is uncritical. The TwinCAT EAP device features a state machine
with four states.
• Init (INIT)
The TwinCAT EAP device is never in INIT state, except for a short time during activation of the
TwinCAT project. In this case the EAP device was already instantiated, but not yet configured.
• Pre-Operational (PREOP)
In PREOP state the TwinCAT EAP device is fully preconfigured, so that cyclic processing of the
process data is ready to commence. In PREOP state further configurations can be implemented in the
TwinCAT EAP device, e.g. with the aid of the TwinCAT EAP Configurator.
• Safe-Operational (SAFEOP)
When the EAP device switches from PREOP state to SAFEOP state, the current configuration is
checked for consistency, references between objects defined via the configuration are created, and
links to the PLC variables are created based on the configured symbol names. In SAFEOP state the
EAP device already sends variables, but it does not yet receive data.
• Operational (OP)
In OP state, the EAP device receives and sends the configured process data cyclically and highly
deterministically.
Before the new device configuration can be written, the TwinCAT EAP device must be switched to PREOP
state. The state can be switched using the icon bar in the EAP Config Tool Window (see section Displaying
the [} 41]object dictionary).
The command [Write Changes to Device] can also be called up from the icon bar .
Once the transfer is complete, the marking for the successfully written configuration data changes to green.
Any configuration data for which the transfer failed are marked in red.
At the top of the Config Tool window, the file name of the corresponding EAP device object is displayed, and
an icon bar below, which can be used to execute several commands (see illustration above), as explained
below.
The icon executes the command [Read from Device] as described in section Reading an active device
configuration [} 40].
The icon executes the command [Write Changes to Device], as described in section Writing a new
device configuration [} 41].
The icon executes the command [Write All to Device], as described in section Writing a new device
configuration [} 41].
The icon executes the command [Clear Object Dictionary], as described in section Deleting the
configuration [} 43].
The icon executes the command [Clear Change Flags], as described in section Configuration state
display [} 43].
The icon can be used to add a further column to the object dictionary, in which the configuration data of
the currently active TwinCAT EAP device are displayed. The icon works like a toggle switch, i.e. the column
appears when the icon is clicked for the first time and is hidden when it is clicked again. Whenever the
column display is enabled, the configuration data are read from the TwinCAT EAP device again and
displayed.
Highlighting Meaning
none No flag is used in the following cases:
• The project was opened directly
• The flags were explicitly reset
yellow The configuration data have changed.
green The configuration data were written successfully.
red Writing of the configuration data has failed.
The flag can be reset with the command [Clear Change Flags] from the context menu of the EAP device.
The dialog can be used to read the configurations of all listed EAP devices, provided the basic requirements
are met (cf. section Reading an active device configuration [} 40] f.). Three options are available:
EAP Configurator tool and TwinCAT EAP device on the same computer
If the EAP Configurator tool and the TwinCAT EAP device are executed on the same com-
puter, only the ADS/AMS protocol can be used for the configuration. The AoE protocol
Note does not work in this configuration, because a TwinCAT EAP device invariably receives
and sends AoE packets directly via TwinCat’s real-time capable network card driver. There-
fore, it is not possible to transfer AoE packets between the EAP Configurator tool and the
TwinCAT EAP device within the PC. Only ADS/AMS communication can be used within the
PC. With this communication type, the TwinCAT router can relay ADS/AMS packets to re-
ceivers within the PC.
Progress indicator
The progress indicator provides an overview of the time taken by the reading/writing of the configuration of
each EAP device object and indicates when the write or read operation is complete.
The Result column shows either 0, if no error has occurred, or an error code.
Generating variables
The command [Variables Configuration] from the context menu of the EAP device object opens a dialog (see
illustration) for generating and editing Tx variables or Rx variables. The dialog is divided into three areas.
1. The buttons at the top left are used to generate or edit variables.
2. The right-hand part consists of a list, which shows variables that already exist.
3. At the bottom left are operator control elements for activating/deactivating display filters, which are
applied to the variable list.
where the OID (object ID) is an 8-digit hexadecimal unique number, which identifies the current PLC
project within the machine control system, and the full symbol name is the unique identifier of the
process variable within the PLC project (a full symbol name has the following form, for example:
01010010:Main.Status).
• Via symbol
A number of symbol names is offered on the Symbols tab. Symbols are only displayed, if a
configuration for the EAP device object was imported via an EDC file and this file also contains symbol
names for a PLC project.
Once a symbol name has been selected, all properties of the corresponding process variable are
automatically entered in the input fields below the list, in this case also the full symbol name.
Finally, the [Create] button is used to create the variable, which can then be found in the list among the
existing variables.
Edit
The [Edit] button can be used to edit an existing variable. The variable to be edited must be selected first.
The edit option is helpful, if a different symbol name is to be entered for linking with another PLC variable, for
example.
Remove Selected
The [Remove Selected] button deletes the selected variable.
The left half displays all existing process data in a list. To the left of this list there are buttons for creating new
PDOs or deleting PDOs. The operator control elements located below can be used to activate/deactivate
display filters, which are applied to the PDO list.
The right half displays a list of variables, which are assigned to the PDO selected in the left half. The buttons
on the far right can be used to edit the variable list. The radio buttons [Easy View] and [Technical View] can
be used to switch the variable display.
Edit PDO
The [Edit PDO] button opens a dialog for generating and configuring process variables (see illustration
above). In the context of a PDO configuration, this dialog is also used to select the variables to be added to
the selected PDO. Each variable, whose checkbox is ticked, is added to the variable list for the select PDOs,
once the dialog has been confirmed with [OK].
Remove Selected
The [Remove Selected] button on the left deletes the selected PDO.
The [Remove Selected] button on the right removes the selected variable from the PDO definition.
• Error
An error has occurred. (e.g. during transfer of the configuration to the TwinCAT EAP device.)
AMS Port
Filename
This property is for information only; it indicates which file, including the full file path, belongs to this EAP
device object. This file is loaded when the user interface is opened; any changes in the configuration are
saved in this file.
The AMS NetID of the TwinCAT EAP device must be entered in the Local AoE Net ID. It is marked for the
communication with the required TwinCAT EAP device.
This address is used for the communication between the EAP Configurator and the TwinCAT EAP device.
The communication is required for reading the active configuration of a TwinCAT EAP device and for writing
a new configuration from the TwinCAT EAP Configurator to the TwinCAT EAP device. If no valid NetID is
entered, no communication with a TwinCAT EAP device can take place.
The first four digits of the Local AoE Net ID are always identical to the Router AoE Net ID. The last two digits
of the Local AoE Net ID can never be .1.1, since these digits are reserved for the AMS NetID of the PC itself
(cf. Router AoE Net ID).
Local IP
The Local IP is set when an active EAP configuration is read. It can also be set and modified manually. The
IP is used when the TwinCAT EAP Configurator communicates via AoE and UDP/IP. In addition, the
TwinCAT EAP Configurator needs this information to detect which EAP device object can be reached from a
configured TxFrame with an IP address as destination address.
Local MAC
Like the Local IP, the Local MAC is also set when an active EAP configuration is read. It can also be set and
modified manually. In addition, the TwinCAT EAP Configurator needs this information to detect which EAP
device object can be reached from a configured TxFrame with an MAC address as destination address.
Name
This property indicates which file belongs to this EAP device object.
Operation State
The Operation State indicates which operation is currently executed by the EAP Configurator for this device
object. Possible states are
• Read (an active configuration is read from a TwinCAT EAP device), or
• Write (a new configuration is written to the TwinCAT EAP device).
Process Data
The property Process Data can be used to generate PDO elements. When this property is selected, a button
is displayed, that can be clicked on in order to open the respective configuration dialog (cf. section
Generating process data objects [} 48]).
The Router AoE Net ID is set when an active EAP configuration is read. It is essentially intended for
information only. The first four digits of the Router AoE Net ID and the Local AoE Net ID are identical. The
last two digits of the Router AoE Net ID are always .1.1.
Protocol
The protocol defines the communication protocol that is used to transfer the configuration data from/to the
TwinCAT EAP device. ADS and UDP are available. UDP means that the application protocol AoE via UDP/
IP is used automatically (cf. The functional principle of the TwinCAT EAP Configurator [} 7]).
The frame
The following frame properties can be checked and modified via the Properties window (see illustration).
Enabled
Index
The Index is created automatically. It is shown in the list of properties for information only. It indexes the
frame object in the EAP object dictionary and must not be modified manually.
Name
The property Name is also defined automatically, although it can be modified as required. The length is
limited to 255 characters.
Subscriber Monitoring
The property Subscriber Monitoring can be switched on or off. Depending on which selection is made in the
property Option (see below), Subscriber Monitoring is activated or deactivated by default. Subscriber
Monitoring is used to monitor whether a receiver is still reachable in the network. This monitoring is only
meaningful and possible, if the frame is addressed as Unicast, i.e. to a single receiver.
Option
This property is used to specify the addressing mode for the frame. Three addressing modes are available.
The default addressing mode is via AMS NetID, which only enables Unicast. The other modes are MAC or
UDP/IP. Both modes enable Unicast, Broadcast or Multicast (cf. Communication methods [} 10]).
The property Target (AMS Net ID / MAC / IP) is used to define the destination address. The AMS NetID is an
address with a length of 6 bytes. The bytes are separated by dots. The MAC address is also 6 bytes long,
which are separated by colons. The IP address is 4 bytes long, which are separated by dashes. If the
addressing mode MAC or IP is used, an additional Type property field is displayed, which can be used to
specify Unicast, Multicast or Broadcast.
The configured addressing mode determines which transport protocol is used for sending the EAP
messages (cf. Communication methods [} 10]).
Type
Specifies the connection type of a MAC-addressed or an IP-addressed frame (cf. Communication methods
[} 10]).
• Unicast:
The address of a particular receiver is entered under MAC or Target IP.
• Multicast:
Under Target MAC, the TwinCAT Multicast MAC address for network variables (01:01:05:04:00:00) is
entered automatically. Any other multicast-valid MAC address can be entered, as required.
Under Target IP, a Multicast IP address (i.e. 224.0.0.0) is entered automatically. Any other multicast-
valid IP address can be entered, as required.
• Broadcast:
Under Target MAC, the Broadcast MAC FF:FF:FF:FF:FF:FF is entered automatically.
Under Target IP, the Broadcast IP 255.255.255.255 is entered automatically.
VLAN Enabled
The property VLAN Enabled enables configuration of a frame for a virtual LAN. The property can be
switched on or off. If VLAN is enabled, the EAP message is extended by a VLAN header. Accordingly, there
are two further properties for determining the required VLAN and for specifying a priority for the processing
of the message within a virtual network:
• VLAN Info ID: defines the ID of the VLAN (range between 0 and 4095), in which the message is to be
sent, and
• VLAN Info Priority: defines a priority for the message in the VLAN (high priority = 7, low priority = 0).
TxData
The following TxData properties can be checked and modified via the Properties window (see illustration).
Index
The Index is created automatically. It is shown in the list of properties for information only. It indexes the
TxData object in the EAP object dictionary and must not be modified manually.
Name
The property Name is also defined automatically, although it can be modified as required. The length is
limited to 255 characters.
Enabled
ID
The property ID is used to assign an ID from the range 0 to 65535 for the TxData, which is unique across the
network. The ID is automatically assigned whenever a new TxData is created. The same ID must be set for
the RxData of a Subscriber, which is to receive data from this TxData.
Length
The property Length is included in the list for information only. It indicates the number of bytes in the data set
of the referenced PDO (see PDO number). If no PDO is referenced, no size is specified. The Length of the
TxData and the associated RxData at the receiver (Subscriber) must be identical. Otherwise the data are not
received.
PDO Content
The property PDO Content can be used to generate TxPDO elements. When this property is selected, a
button is displayed, that can be clicked on in order to open the respective configuration dialog (cf. section
Generating process data objects [} 48]).
PDO Number
The property PDO Number is used to specify which PDO is referenced by the TxData. A selection box shows
all available TxPDOs.
Version
The property Version is set to 0 by default. Version can be used to assign a version number to the TxData.
The user should increment the version number when the TxData configuration is modified, so that the
structure of the user data is distinguished from the previous version. The version number enables the
Subscriber to detect that the received user data no longer match the expected data structure. During normal
operation it compares the version number defined for RxData with the version number sent by the Publisher.
If the version numbers do not match, the data is discarded and therefore not received. In this way it is
possible to avoid a scenario where invalid data are received when the EAP variables are changed on one
side. A one-sided change means the configuration is changed only at the TxData of the Publisher or only at
the RxData of the Subscriber.
Trigger Condition
For a TxData one of three mechanisms is set, which defines how sending of data is triggered. The
predefined Trigger Condition is the Cycle Time. In this case, data are sent cyclically at a defined interval. The
time interval is defined under the property Cycle Time.
Another option is Change of State (CoS). In this case data are only sent if there was a change since the last
task cycle. If this mechanism is used, the properties CoS Change Timeout Time and CoS Inhibit Time are
used to define two delay times to control the mechanism (cf. section EAP send mechanism [} 13]).
The third option is Polled. In this case the property Poll Request Rx PD must be defined. In this configuration
the TxData acts as a client in a client/server model. The TxData is sent as request to a server. In this case
the property Poll Request Rx PD defines the receive buffer for the expected response from the server.
Cycle Time
The property Cycle Time defines the interval at which the data are sent, in microseconds [µs]. If a time of
10000 µs was entered, the data are sent every 10000 µs = 10 ms = 0.01 s. The smallest possible cycle time
depends on the task cycle time driving the EAP device. The resulting cycle times should always be integer
multiples of the task cycle time.
This property is used to define a maximum delay time for the Change of State mechanism. It determines the
interval for sending the TxData, if the data of the process variables assigned to this TxData have not
changed within the interval.
This property is used to define a minimum delay time for the Change of State mechanism. It specifies the
duration for which sending of the TxData is interrupted, even if the data of the process variables assigned to
this TxData have changed within this period. By definition, the Inhibit Time (minimum delay time) can never
be greater than the Change Timeout Time (maximum delay time).
Poll Request Rx PD
For the Polled mechanism, this property is used to define the index of the RxData to be used as receive
buffer.
RxData
The Filter AMS Net ID is used for RxData to specify that an EAP variable can only be received if it was sent
by the EAP device with the defined AMS Net ID.
Index
The Index is created automatically. It is shown in the list of properties for information only. It indexes the
RxData object in the EAP object dictionary and must not be modified manually.
The property Multicast MAC Address can be used to set up a multicast MAC address for the EAP device (cf.
section Communication methods [} 10]).
Multicast IP Address
The property Multicast IP Address can be used to set up a multicast IP address for the EAP device. For this
property the same restrictions apply as for the Multicast MAC Address. Multicast IP addresses are only
required if the communication is to take place beyond the subnet boundary, i.e. via a router into other
subnets.
Multicast IP address
An EAP Publisher, for which a Multicast IP Address is configured as the destination ad-
dress in TwinCAT 3, is assigned the Multicast IP Address 224.0.0.0 by default. Other Multi-
Note cast IP Addresses may be used, as required. TwinCAT generates a compliant multicast
MAC address for each configured multicast IP address, which is used when TwinCAT
starts up (i.e. when the Run mode is activated).
It is not possible to configure additional multicast IP addresses for a TwinCAT EAP device
with the aid of the TwinCAT EAP Configurator, since this is used to configure the EAP de-
vice after the TwinCAT system has been commissioned (Run mode).
Name
The property Name is also defined automatically, although it can be modified as required. The length is
limited to 255 characters.
Enabled
Ignore Version
The property Ignore Version can be used to specify whether a version check should take place when EAP
variables are received. If Ignore Version is set to TRUE, an EAP variable can be received even if its version
number does not match the version number defined here.
Poll Request Tx PD
The property Poll Request Tx PD only has to be defined if RxData is to be used for the Polled mechanism.
Otherwise the value entered must remain 0.
In the Polled mechanism, RxData acts as a server in a client/server model. RxData then receives a request
from a client. The property Poll Request Tx PD defines which TxData is sent as immediate response to the
request. To this end the index of the required TxData is defined.
ID
The property ID is used to assign an ID from the range 0 to 65535 for the RxData, which is unique across the
network. The ID is automatically assigned whenever a new RxData is created. The RxData that is used to
receive the TxData must have the same ID as the sending TxData.
Length
The property Length is included in the list for information only. It indicates the number of bytes in the data set
of the referenced PDO (see PDO number). If no PDO is referenced, no size is specified. The Length of the
RxData and the length of the associated TxData of the sender (Publisher) must be identical. Otherwise the
receiver (Subscriber) will not receive the data.
PDO Content
The property PDO Content can be used to generate RxPDO elements. When this property is selected, a
button is displayed, that can be clicked on in order to open the respective configuration dialog (cf. section
Generating process data objects [} 48]).
PDO Number
The property PDO Number is used to specify which PDO is referenced by the RxData. A selection box
shows all available RxPDOs.
Version
The property Version is set to 0 by default. Version can be used to assign a version number to the RxData.
The user should increment the version number when the RxData configuration is modified, so that the
structure of the user data is distinguished from the previous version. The version number enables the
Subscriber to detect that the received user data no longer match the expected data structure. During normal
operation this version number is compared with the defined version number. If the version numbers do not
match, the data is discarded and therefore not received. In this way it is possible to avoid a scenario where
invalid data are received when the EAP variables are changed on one side. A one-sided change means the
configuration is changed only at the TxData of the Publisher or only at the RxData of the Subscriber.
Symbol information
If a .EDC file with symbol information was imported for an EAP device object, this informa-
tion is stored, so that it is available after the EAP project has been loaded.
Note
Any device node can be opened from the project after loading. Either double-click with the left mouse button
or use the context menu (right-click) for the device node and click on the command [Open]. When a node is
opened, all device nodes in the project are loaded and displayed in the graphical user interface that opens
(see section The TwinCAT EAP Configurator project [} 34]). The EAP device object whose device node was
opened is shown at the top. An EAP device object therefore represents an EAP device (see illustration).
Read Only
All entries in the object dictionary that are labelled as Read Only (RO) must not be
changed. Also, the objects with the indices 0xF800 and 0xF801 must not be modified man-
Note ually under any circumstances. These two objects are modified, if new EAP elements such
as TxFrame, Tx/RxData, Tx/RxPDOs or Tx/RxVariables are added.
The structure of the object dictionary and the meaning of the individual object entries are described in detail
in section The CANopen object dictionary of the documentation for TwinCAT EAP device.
6 Appendix
Now create the EAP device and a PLC project in the new project.
A PLC program is written within a TwinCAT PLC project. Create a PLC project by following these steps:
1. Right-click on the node PLC in your TwinCAT project and select the command [Add New Item…] (see
illustration above).
ð The Add New Item dialog opens.
2. Select the Standard PLC Project template, define a name (in this case Measuring is recommended) and
close the dialog with [Add].
A standard PLC project references several basic PLC libraries by default. The library Tc2_Utilities is also
required for the example program. Add a reference to this library as follows:
1. Right-click on the node References in the PLC project node (see illustration).
The Measuring example program is intended to simulate a straightforward measurement for a product or
workpiece with an identification number and make the data available later to another controller via EAP.
For this task a function block (FB) with the name GetMeasure is generated, which supplies randomly
different measured values, and a MAIN program is written, which deals with the function of making the
determined data available on request.
2. Enter GetMeasure as name, select Type: Function Block and Implementation Language: Structured
Text (ST).
ð After confirmation with [Open], the new function block is displayed in the editor, and the logic can be im-
plemented.
The input parameters (NominalMeasure = 5000, Variance = 1000, Steps = 100) are therefore used to
randomly generate a measured value [4500, 4600, 4700, …, 5400, 5500] to be returned as output parameter
by the FB. The program code for the GetMeasure FB can then look as follows:
FUNCTION_BLOCK PUBLIC GetMeasure
VAR_INPUT
nominalMeasure : UDINT;
variance : UDINT;
steps : UINT;
END_VAR
VAR_OUTPUT
measure : UDINT;
END_VAR
VAR
FB_SystemTime : GETSYSTEMTIME;
currTimeLo : UDINT;
currTimeHi : UDINT;
FB_Randomizer : DRAND;
rand : LREAL;
seed : INT;
varianceEffective: UDINT;
varianceAbsolute : UDINT;
deviation : UDINT;
END_VAR
Copy the program code to FB GetMeasure. Then open the MAIN program by double-clicking in the editor.
Here, the main program is now coded. An input variable and three output variables are defined in the main
program.
Input variable:
• in_Req of type BOOL
is used to log a request from the other controller.
Output variables:
• out_Measure of type UDINT
should receive the measured value from FB GetMeasure.
• out_ProductID of type UDINT
should receive an identification number (ID), which identifies the product unambiguously.
• out_Ack of type BOOL
should have the value FALSE, as long as no measurement result and no ID were written to the
corresponding output variables.
PROGRAM MAIN
VAR
in_Req AT%I* : BOOL := FALSE;
FB_R_TRIG : R_TRIG;
FB_F_TRIG : F_TRIG;
FB_GetMeasure : GETMEASURE;
FB_TON : TON;
END_VAR
out_ProductID := out_ProductID + 1;
request := FALSE;
isReady := FALSE;
out_Ack := TRUE;
END_IF;
ELSE
FB_TON( PT := T#200MS,
IN := NOT FB_TON.Q );
isReady := FB_TON.Q;
END_IF;
(* END: Simulating duration for measuring the next product*)
1. Copy the program code for the main program to the program MAIN.
2. Compile the PLC project by clicking the menu item [Build] → [Build Solution].
ð An instance for the PLC project is created, in which the input and output variables for the PLC program
can be found as process variables (see illustration). These can later be linked in TwinCAT.
3. From the list select the type: EtherCAT Automation Protocol (Network Variables) that corresponds to the
EtherCAT devices and press [OK].
4. You may be asked to select an adapter, via which the EAP device should communicate.
ð The EAP device is then created and preconfigured with default settings.
The EAP device now has to be linked to a cyclic task, so that it can send and receive variables in a real-time
context.
5. Right-click on the EAP device and select the menu item [Add New Item…].
ð The dialog Insert Box opens.
Activate your TwinCAT project, so that subsequently a connection to the EAP device can be created with the
TwinCAT EAP Configurator.
The Operating example program is intended to simulate a machining operation for a product or workpiece
with an identification number in a simple manner. After machining is complete, it should be able to notify
another controller via EAP that the next workpiece can be machined.
For this task a function block (FB) with the name Processing is created, which simulates the machining
duration, which depends on an input parameter (the measured value for this workpiece). The MAIN program
issues a request for the next workpiece, once the last machining operation is complete and logs the
confirmation of the request, so that machining of the next workpiece can commence.
The FB simulates a processing duration by halving the value of the input parameter and waiting in seconds.
During this delay time the output parameter busy is set to TRUE, otherwise the value is FALSE. The program
code for the Processing FB can then look as follows:
VAR_INPUT
measure : UDINT := 0;
END_VAR
VAR_OUTPUT
bBusy : BOOL := FALSE;
END_VAR
VAR
FB_TON : TON;
bReady : BOOL;
processingTime : TIME;
END_VAR
processingTime := UDINT_TO_TIME(measure/2);
FB_TON.PT := processingTime;
FB_TON.IN := NOT FB_TON.Q;
FB_TON();
Input variables:
• in_Measure of type UDINT
should receive the measured value from project Measuring.
• in_ProductID of type UDINT
should be assigned an identification number (ID), which identifies the product unambiguously and is
allocated by the Measuring project.
• in_Ack of type BOOL
should receive the value FALSE from project Measuring, as long as the next workpiece has not yet
been measured, i.e. is not yet available for machining.
Output variable:
• out_Req of type BOOL
is used to request the next workpiece from the other controller.
PROGRAM MAIN
VAR
in_Measure AT%I* : UDINT := 0;
in_ProductID AT%I* : UDINT := 0;
in_Ack AT%I* : BOOL := FALSE;
FB_R_TRIG : R_TRIG;
FB_F_TRIG : F_TRIG;
FB_Processing : Processing;
END_VAR
In the EAP device, for this project a Publisher with a Publisher variable of data type BOOL is added, instead
of a Subscriber. This variable is then linked with the PLC variable MAIN.out_Req.
Activate this TwinCAT project, so that subsequently a connection to the EAP device can be created with the
TwinCAT EAP Configurator.