
Manual – XFE24A EtherCAT Fieldbus Interface
31
6
Parameter setting via EtherCAT
Operating Behavior on EtherCAT
6.2.2
Reading a parameter via TwinCAT (example)
The function "SDO-READ" is available for reading a parameter. The index of the param-
eter to be read is necessary.
For implementation in TwinCAT, the function module
FB_EcCoESdoRead
is required.
This function module is available in the
TcEtherCAT.lib
library. You can integrate this
function module in two steps.
1. Creating an instance of the function module
FB_EcCoESdoREAD
.
2. The inputs of the function module are assigned as follows:
• sNetID: Specification of the Net-ID of the EtherCAT master.
• nSlaveAddr: EtherCAT address of the SEW unit from which the data is read.
• nIndex: Index of the parameter to be read.
• nSubIndex: Subindex of the parameter to be read.
• pDstBuf: Pointer to the data range in which the read parameters are to be stored.
• cbBufLen: Maximum memory size for parameters to be read in byte.
• bExecute: A positive edge starts the read process.
• tTimeout: Timeout interval of the function module.
The output flags
bBusy
and
bError
indicate the state of the service,
nErrId
the error num-
ber when flag
bError
is set, if applicable.
The function module is integrated in TwinCAT as follows:
In the above example, the DC link voltage was read off (9789.1). The number 610000
is received, for example, which corresponds to a voltage of 610 V according to the
MOVIAXIS
®
parameter description.
You can display information about the index and the subindex of the parameter to be
read in the parameter tree by moving the cursor over the respective parameter. The in-
formation is then displayed as a tool tip.
11661AXX
Figure 12: Integration of the function module in TwinCAT
0
0
I
Summary of Contents for 1821 2492
Page 2: ...SEW EURODRIVE Driving the world...
Page 66: ......