SmartPLC DataLine with EtherCAT slave interface
160
>
Use acyclic commands
42909
Since request and response are paired, the following partial steps always have to be executed
sequentially in the program code:
1. Send command to the device (write)
2. Check if command was successfully executed (read)
3. If successful receive the reply data (read)
To access the device command interface in reading or writing the user has to define the following
inputs of the TwinCAT function blocks:
Input
Description
Possible values
sNetId
AMS net ID of the EtherCAT master to which
the device is connected
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
0x2010
System command
0x2011
AS-i Master 1 command
0x2012
AS-i Master 2 command
nSubIndex
subindex of the fieldbus object
0x01
command request
0x02
status of the command execution
0x03
command response
pDstBuf
pointer to the array to be sent/received
e.g. ADR(arTxData)
(= address of the transmit buffer arTxData)
cbBufLen
maximum size of the data buffer (number of
the words)
depending on the command
e.g. 8