SmartPLC DataLine with EtherCAT slave interface
163
1 Send command request to the device
►
Execute function block FB_EcCoESdoWrite with the following input values:
Input
Value
Description
nNetId
depends on the project
AMS network ID of the EtherCAT master
nSlaveAddr
depends on the project
EtherCAT address of the device
nSubIndex
0x01
subindex of the fieldbus object (command request)
nIndex
0x2010
Index of the fieldbus object (system command)
pSrcBuf
ADR(arTxData)
address of the buffer storage with the data to be transmitted
cbBufLen
SIZEOF(arTxData)
Number of words to be transferred
2 Evaluate command status
►
Execute function block FB_EcCoESdoRead with the following input values:
Input
Value
Description
nNetId
depends on the project
AMS network ID of the EtherCAT master
nSlaveAddr
depends on the project
EtherCAT address of the device
nSubIndex
0x02
subindex of the fieldbus object (status message)
nIndex
0x2010
Index of the fieldbus object (system command)
pSrcBuf
ADR(bRxStatus)
Buffer storage for data to be transmitted
cbBufLen
SIZEOF(bRxStatus)
Number of words to be transferred
►
Evaluate the status of the command processing (bRxStatus).
3 Command response received from the device
►
After faultless command processing: Execute FB_EcCoESdoRead with the following input values:
Input
Value
Description
nNetId
depends on the project
AMS network ID of the EtherCAT master
nSlaveAddr
depends on the project
EtherCAT address of the device
nSubIndex
0x03
subindex of the fieldbus object (command response)
nIndex
0x2010
Index of the fieldbus object (system command)
pSrcBuf
ADR(arRxData)
Buffer storage for data to be transmitted
cbBufLen
SIZEOF(arRxData)
Number of words to be transferred
►
Evaluate the command status (word 3) and command error code (word 4).
>
If successful: words 5...11 contain the date / time / NTP settings.