General access to online CoE values
Many functionally critical parameters of the EtherCAT Terminals/ Box‑Modules are managed online in the so-called CoE directory in the device. Under certain circumstances, read or write access is to be made to individual or several entries in the active device during commissioning. That is possible:
- via the OnlineView in TwinCAT 3,
- via a PLC read/write access via ADS and
- via the TwinCAT TF6010 ADS Monitor
OnlineView in TwinCAT 3
The easiest way is the online access in TwinCAT2/3: double-clicking the index/subindex opens an editor window and a value can be changed in decimal/hexadecimal and/or copied and - depending on the type - also written at runtime. Note that the EtherCAT fieldbus is active, the device is addressable and "OnlineData" is visible. Only individual values can be accessed, a so-called CompleteAccess is not possible.
PLC access
If values are to be changed or read specifically at application runtime, function blocks (FBs) can be used for CoE access to the TwinCAT TC2_EtherCAT.lib. See also the sample programs in this documentation. Single access and CompleteAccess are possible.
TwinCAT TF6010 ADS Monitor
The TF6010 ADS Monitor is a free tool from Beckhoff for monitoring ADS communication. It can be used to read or write CoE values from/to the EtherCAT device (Command Test). Single access and CompleteAccess are possible.
An example: the TwinCAT 3 FilterDesigner TE1310 (or the FilterControl on the terminal) generates a set of filter coefficients for digital analog value filtering and sends them to the device.
The 4-byte coefficients can be read and also copied/edited via the OnlineView.
In case of device replacement
If the coefficients should/have to be reloaded into the new device after a device exchange, they can be stored in a StartUp list:
A total of up to 40 coefficients (i.e. 160 bytes) can be stored there for this device. These are now to be extracted from the terminal "in one set", alternatively they could also be copied out manually one after the other as above.
After installing the TF6010 ADS Monitor from the Beckhoff website, it can be started in the development environment menu under [TwinCAT] → [ADS Monitor]:
In order to access the CoE of the EtherCAT terminal, "EtherCAT address" must be activated, after which TwinCAT must be activated or restarted.
The following is to be entered in the dialog:
- A: Ams Net ID of the EtherCAT master
- B: as port, the EtherCAT address of the 'Slave'
- C: a ReadRequest must be appended for the intended read
- D: as ADS index, the value 0xF302 for the CoE area
- E: composed as ADS offset with eight digits
- first the CoE index, here 0x8001
- then the subindex, here 0x0101 so 257dec
0...0x00FF would be the regular subindices :01 to :255 in the CoE
0x0100 is a CompleteAccess including :00, so it returns the size information that is in :00 with (4 bytes)
0x0101 is a CompleteAccess without the value in :00 - F: the read target must be specified here, e.g. as INT or WORD;
after successful "transfer" in - G: are the read data, here the complete 0x8001 content
In this way all 160 bytes (40 coefficients) can be read in one go.
The byte stream (BLOP, "binary large object"):
[40 83 20 00 00 00 00 40...] is then to be read inverted:
- Subindex 01: 0x00 20 83 40 = 2130752dec
- Subindex 02: 0x40 00 00 00 = 1073741824dec
- ...
Which corresponds exactly to the values from figure above "Filter coefficients nos. 1 to 12 of channel 1 in CoE-Online of an ELM3602 EtherCAT Terminal". The values can thus be further processed using a spreadsheet program and, if necessary, incorporated into a self-generated Startup.xml.