48
Manual – Fieldbus Interface DFE24B EtherCAT®
6
Parameterization via EtherCAT
®
Operating Behavior on EtherCAT
®
SEW parameter always have a data length of 4 bytes (1DWord). Refer to the
"MOVITRAC
®
B Communication and Fieldbus Unit Profile" manual for more details and
information on scaling.
In the above example, the DC link voltage was read off (index 8325, subindex 0). For
example, the figure 639000 is received, which - according to the fieldbus unit profile -
corresponds to a voltage of 639 V.
6.3.3 Example of writing a parameter in TwinCAT via EtherCAT
®
The function SDO-WRITE is available for writing parameters. The index of the parame-
ter to be written is required. You can display the parameter index in the SHELL program
or in the parameter tree using the key combination [CTRL + F1].
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: Net ID of the EtherCAT
®
master
– nSlaveAddr: EtherCAT
®
address of the SEW unit from which data is to be written.
– nIndex: Index of the parameter to be written.
– nSubIndex: Subindex of the parameter to be written.
– pDstBuf: Pointer to the data range in which the data to be written is located.
– cbBufLen: Amount of data to be sent, in bytes.
– bExecute: A positive edge starts the writing process.
– tTimeout: Timeout interval of the function module.
The output flags bBusy and bError indicate the status of the service. nErrId shows the
error number when the bError flag is set if an error occurs.
The function module is integrated in TwinCAT as follows: