ADS access to device parameters

The exchange of the acyclic data takes place via a specified index and subindex range that is device-specific and can be read about in the corresponding vendor documentation.

Parameter data exchange

An intelligent IO-Link sensor/actuator (in the previous figure marked "Sensor (IO-Link Device)") can support parameterization by SPDU (Service Protocol Data Units). The PLC must explicitly query or, when marked as such, send these acyclic service data.

ADS access to device parameters 1:

SPDU access

TwinCAT supports access via ADS and via the EP6224-xxxxxx CoE directory.

The respective parameter is addressed via the so-called SPDU index. The following ranges are available:

Name

Index range

System

0x00 … 0x0F

Identification

0x10 … 0x1F

Diagnostic

0x20 … 0x2F

Communication

0x30 … 0x3F

Preferred Index

0x40 … 0xFE

Extended Index

0x0100 … 0x3FFF

 

the range 0x4000 … 0xFFFF is reserved

The use of the implementation of these ranges is the responsibility of the sensor/actuator vendor. In the interest of clarity, only a few possible indices with names are listed here. Please refer to the corresponding chapter "Object description and parameterization".

Index

Name

0010

Vendor Name

0011

Vendor Text

0012

Product Name

0013

Product ID

0015

Serial Number

0016

Hardware Revision

0017

Firmware Revision

...

...

ADS

Communication relating to IO-Link demand data is initiated via an ADS command. An ADS address always consists of a NetID and PortNo. TwinCAT forwards an ADS command to the EP6224 Box module via AoE (ADS over EtherCAT). From where the command is relayed to the IO-Link master section and therefore to the data channel.

AoE-NetID

The EP6224 is assigned a dedicated AoE-NetID for communication with the IO-Link master section. This is assigned by the configuration tool (see the figure below).

ADS access to device parameters 2:
AoE-NetID allocation

PortNo

The individual IO-Link ports for the master are allocated via the port number. The port numbers are allocated in ascending order from 0x1000. I.e. IO-Link Port1 === PortNo 0x1000 and IO-Link Portn === PortNo 0x1000 + n-1.
The following specification applies for the EP6224 (4-port IO-Link master):
IO-Link Port1 === PortNo 0x1000
IO-Link Port2 === PortNo 0x1001
IO-Link Port3 === PortNo 0x1002
IO-Link Port4 === PortNo 0x1003

ADS Indexgroup

As for CoE, the Indexgroup of an ADS command is specified as 0xF302 for the IO link data channel.

ADS Indexoffset

The IO link addressing with index and subindex is coded in the Indexoffset. The Indexoffset has a size of 4 bytes and is subdivided as follows: 2-byte index, 1-byte reserve, 1-byte subindex.

Example with ADS monitor

Reading of the Application-Specific Name, index 0x0018 subindex 0x00 (see figure below).

ADS access to device parameters 3:
Reading of the Application-Specific Name

Example showing the principle in the code

Reading of Application-Specific Name, index 0x0018 subindex 0x00 at IO-Link Port2.
AmsAddr adsAdr;
adsAdr.netId.b[0] = 0x0A; //AoE-NetID of EP6224
adsAdr.netId.b[1] = 0x03; //AoE-NetID of EP6224
adsAdr.netId.b[2] = 0x02; //AoE-NetID of EP6224
adsAdr.netId.b[3] = 0x16; //AoE-NetID of EP6224
adsAdr.netId.b[4] = 0x02; //AoE-NetID of EP6224
adsAdr.netId.b[5] = 0x03; //AoE-NetID of EP6224
adsAdr.port = 0x1001; //IO-Link Port2
errCode = AdsSyncReadReq(&adsAdr, 0xF302, 0x00180000, 100, &pReadBuffer);