SmartPLC DataLine with EtherCAT slave interface
158
>
Read acyclic data records
42163
To access acyclic data sets of the device the user can use the TwinCAT function block
FB_EcCoESdoRead. The functions block is part of the TwinCAT library Tc2_EtherCAT.lib (
→
TwinCAT documentation).
The user has to configure the parameters of the function block:
Input
Description
Possible values
sNetId
AMS net ID of the device
depends on the project, e.g. 172.16.2.131.2.1
nSlaveAddr
EtherCAT address of the device
depends on the project, e.g. 1006
nIndex
index of the field bus object
0x2013
read/write an acyclic data set
nSubIndex
subindex of the fieldbus object
xx
number of the data set DSxx
(
→
Overview: acyclic data sets (DSx)
(
→ S.
pDstBuf
pointer to the structure variable (e.g.
arRxData) to which the read data set DSxx
is written
address of the structure variable, e.g.
ADR(arTxData)
cbBufLen
maximum size of the data buffer (number of
the words)
depending on the command, e.g. 8