EAP between TwinCAT 2 and 3

The EtherCAT Automation Protocol is compatible with the conventional network variables (NWV) from TwinCAT 2. However, there are some extensions to the network variables with EAP under TwinCAT 3 that require increased attention if communication between TwinCAT 2 NWV and TwinCAT 3 EAP is to be established.

Observance of the Publisher NetID

If TwinCAT2 uses a NWV Publisher, the AmsNetID of the overall system is used as AmsNetID. This can be entered accordingly at the receiver.
EAP between TwinCAT 2 and 3 1:

In contrast, TwinCAT 3 uses for EAP the AmsNetID of the EAP device as Publisher.
EAP between TwinCAT 2 and 3 2:

"Ignore Data Type Hash" option

A further point that needs to be borne in mind results from the extension of the data type system between the TwinCAT versions 2 and 3:

When using a complex (i.e. non-native) data type, TwinCAT 2 calculates a 16-bit hash value that unambiguously identifies this data type. This data type hash is always 0 for native data types. The data type hash is sent along as a version number when sending a Publisher Variable. This version number is then compared on the receiver side with the data hash type of the configured Subscriber Variable. If the comparison reports correlation, the data are accepted by the subscriber.

In TwinCAT 3 each data type is assigned a Global Unique Identifier (GUID). This has a data length of 128 bits. Accordingly, the value 0 is always used as the version number when configuring a Publisher or Subscriber Variable.

Due to this difference between TwinCAT 2 and 3, you must proceed as follows when using complex data types:

  • Let's assume that variables of a complex, non-native data type are to be sent between TwinCAT 2 and TwinCAT 3.
1. In this case the "Ignore Data Type Hash" must be activated for the Subscriber Variable.
  • This setting suppresses the comparison operation on the receiver side and the data are accepted by the subscriber without a comparison of the versions.

Creating a Subscriber Variable by "Browse for Computer" or "Browse for File".

Due to the change of the file format of a TwinCAT 2 project to a TwinCAT 3 project, the two variants "Browse for Computer" or "Browse for File" for creating a Subscriber Variable to match an existing Publisher Variable are currently only downwardly compatible. This means that it is currently only possible to use these two variants from a TwinCAT 3 system in order to have a Subscriber Variable automatically created from a TwinCAT 2 project on the basis of a Publisher Variable. In the reverse case a Subscriber Variable must be manually created (variant "Create new variable").