
32
Manual – XFE24A EtherCAT Fieldbus Interface
6
Parameter setting via EtherCAT
Operating Behavior on EtherCAT
6.2.3
Writing a parameter via TwinCAT (example)
The function "SDO-WRITE" is available for writing a parameter. The index of the param-
eter to be written is necessary.
For implementation in TwinCAT, the function module
FB_EcCoESdoWrite
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_EcCoESdoWrite
.
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.
You can display the index and the subindex of the parameter to be read in the parameter
tree by moving the cursor over the respective parameter. The information is then dis-
played as a tool tip.
0
0
I
Summary of Contents for 1821 2492
Page 2: ...SEW EURODRIVE Driving the world...
Page 66: ......