Online configuration of the TwinCAT EAP device

The CANopen OD offers the great advantage of allowing the virtually unlimited online configuration of a TwinCAT EAP device via a standardized interface. Carrying out an online configuration means that the TwinCAT EAP device is already active and needs to be switched to a safe state before changing the configuration. No process data communication takes place in the safe state.

The configuration is done by setting parameters and takes place

  • via TwinCAT:
    the values are then changed directly in the online Object Dictionary.
    This is useful for commissioning of the system. The new value is set in the respective parameter by clicking on the corresponding row of the index to be parameterized and entering an appropriate value in the Set Value dialog.
  • or from an application via ADS or AoE:
    This is recommended for changes when the system is running or if no TwinCAT or operator is available.

On the one hand, a change can exclusively concern the entries in existing objects of the OD. On the other, a change can result in the generation of new objects or the deletion of existing ones.

Changing existing objects

A change that concerns only existing objects serves the adaptation of the current operating behavior (e.g. transmission cycle, destination address, etc.) or to assign purpose-related names to individual objects for a better understanding. The steps that are necessary for such a change can best be illustrated with an example:

Changing the time interval with which a Publisher Variable is transmitted.

Let's assume that the EAP device is configured with a TxPD (0xD000) in which an interval of 10000 µs is configured as the Cycle Time and this interval is now to be enlarged to 30000 µs. In this case the following steps have to be carried out:

1. Place the EAP device in a safe state.
Set the object entry 0xF200:01 (Control Word) to the value 2 (=PreOperational)
Check object entry 0xF100:01 to ascertain whether the state is 2 (=PreOperational)
Carry out this check several times (polling) with a timeout of, for example, 200 ms.
2. Change the time interval of the TxPD to the new value
Set the object entry Cycle Time of the TxPD (0xD000:07) to the value 30000
3. Place the EAP device in its operative state again.
Set the object entry 0xF200:01 (Control Word) to the value 4 (=SafeOperational)
Check object entry 0xF100:01 to ascertain whether the state is 4 (=SafeOperational)
Carry out this check several times (polling) with a timeout of, for example, 200 ms.
Set the object entry 0xF200:01 (Control Word) to the value 8 (=Operational)
Check object entry 0xF100:01 to ascertain whether the state is 8 (=Operational)
Carry out this check several times (polling) with a timeout of, for example, 200 ms.

Generation and deletion of objects

The generation of new objects serves the extension of existing communication connections or the addition of new communication connections. This function makes it possible, for example, to establish a temporary communication connection between two controllers. Only the transmission and reception of the EAP device are briefly interrupted during the configuration phase. The processes of other components and modules of the controller are unaffected by this and can remain active throughout.

Objects are generated or deleted with the help of the objects Frame List (index 0xF020 – 0xF022) and Bitmap (index 0xF801)
There are a total of 512 entries in the Frame List objects – exactly as many as the maximum possible number of TxFrame objects (see index 0xF020 in The EAP Object Dictionary (subprofile 1000)). Each entry is thus assigned precisely one TxFrame object. The value 1000 (sub-profile number) is then saved in the corresponding entry for each existing TxFrame object. All other entries have the value 0. Let's assume that there are three TxFrames with the indices 0x8000, 0x8008 and 0x87F0. The assignment is then to be understood as follows:

No.

Frame List entries

Value

Assigned TxFrame object

1

0xF020:01

1000

0x8000

2

0xF020:02

1000

0x8008

0

254

0xF020:254

0

0x87E8

255

0xF021:01

1000

0x87F0

0

512

0xF022:04

0

0x8FF8

The corresponding TxFrame objects are generated as soon as the value of an entry is set to 1000. The object is deleted again when the value is reset to 0.

With the exception of TxFrames a separate entry exists for each dynamic object type in the object Bitmap. Accordingly, six entries are to be found (excluding the entry 0 – see index 0xF801 in The EAP Object Dictionary (subprofile 1000)). An entry contains a bit field of a sufficient length to be able to save the maximum number of objects of the corresponding object type in unary notation.

Let's assume that there are three TxPD objects with the indices 0xD000, 0xD00C and 0xD014. Then the bit sequence 10010100000000…0 with the total length of 1024 bits is saved in the entry 0xF801:03. The sequence is to be interpreted as follows:

Bit 1

Bit 2

Bit 3

Bit 4

Bit 5

Bit 6

Bit 7

Bit 8

 

Bit 1024

1

0

0

1

0

1

0

0

0

0xD000

0x D004

0x D008

0x D00C

0x D010

0x D014

0x D018

0x D01C

0x DFFC


The corresponding object is generated as soon as a bit is set to 1. The object is deleted again on resetting.

Note
Deletion of objects configured offline.

It is also possible to delete objects that were configured before commissioning by means of TwinCAT (offline configuration) and as a result are already generated on activating the controller. The following must be considered in this case:

Some objects manage variables (e.g. CycleIndex, Quality, Status Word, Control Word etc.) that are located in the process image of the EAP device. TwinCAT accesses the process image by ADS when displaying online values. The addresses of the respective variables in the process image that were generated and activated with the help of TwinCAT are calculated after the configuration.

If an object that was configured offline is now deleted during an online configuration, this change remains hidden from TwinCAT. It therefore still accesses the calculated addresses in order to display their contents in the online view. It should be clear at this point that the online values displayed no longer match the configuration generated in TwinCAT.

In this case, therefore, the online view, or the addresses of the process image respectively, are no longer a valid reference source for monitoring or even evaluating the values of the process image.

It is recommended that objects configured offline be deactivated and not deleted.

If objects are deleted or added with the help of TwinCAT, new objects are not directly displayed in the Object Dictionary. Deleted objects remain in the OD and no values are displayed for their entries any longer. So that new objects are displayed and deleted objects are no longer displayed, the structure of the OD must be read again in TwinCAT. This can be done with the help of the Advanced Settings dialog (see fig. CoEOnline in chapter The TwinCAT EAP device).

Activation/deactivation of objects

In case certain Process Data/PDOs or complete Frames are only to be temporarily removed from the existing EAP communication, it is advisable to deactivate the objects concerned instead of deleting them.

The objects TxFrame (0x8000), TxPD Assignment (0x8001), TxPD (0xD000), TxPDO (0x1A00), RxPD (0xE000) and RxPDO (0x1600) can be deactivated and reactivated by setting their subindex 0 to the value 0. The activation then takes place by setting the original value or any other value greater than 0.

List-based objects

Note with the list-based objects TxPD Assignment and Rx/TxPDOs that their entries always contain references to other objects. Any change made to subindex 0 will therefore affect which and how many other objects are actually referenced.

Linking of a variable from the EAP process image with a PLC variable.

The linking of variables from the TwinCAT I/O level with variables from a PLC program takes place as standard in TwinCAT. If an Input/Output Variable from a PLC program is linked with a Publisher or Subscriber Variable of the EAP device, the symbol name of this variable is entered in the corresponding CANopen object of the EAP device (see next illustration).

Online configuration of the TwinCAT EAP device 1:
Online configuration of the TwinCAT EAP device 2:

As the previous illustration shows, the symbol name is made up of the Object ID (OID) of the PLC instance and the unique name of the PLC program variable, separated by a colon. Using the same syntax a symbol name can also be entered for an EAP object during the online configuration. The PLC variable is then linked accordingly with the Rx/TxVariable.

Online configuration of offline links

Links that had already been generated during the offline configuration can neither be changed nor deleted during the online configuration. These symbol names are thus marked with the Read-Only (RO) flag.

Reason:
The linking of these variables is defined by TwinCAT with the help of a mapping object when creating a configuration. However, this mapping object cannot be changed during operation.

Access to the CANopen Object Dictionary by Single Access/Complete Access

With the support of the communication channel CANopen SDO (see The TwinCAT ADS interface to the EAP device), the ADS interface allows both the values of individual object entries and the data of a complete object to be read or written respectively. Access to the individual object entry (Single Access) is explained in the section Changing existing objects in the chapter Online configuration of the TwinCAT EAP device.
Complete Access means access to the complete object. In this case the values of all object entries are transmitted in succession in binary in a block. For safety in the case of a write access, the correlation of the block length with the size of the object is checked before the access is enabled. To determine the necessary block length the documentation for the Object Dictionary can be consulted or an offline configuration can be exported to an EAP Device Configuration (EDC) file (see section Protocol in chapter The TwinCAT EAP device). The latter is a file in XML format containing the full Object Dictionary of the current configuration (see chapter The EAP Device Configuration (EDC) File).