ETCSlave (FB)¶
FUNCTION_BLOCK ETCSlave EXTENDS ETCSlaveStack
Implicit Instance of Slave¶
An instance of the data type ETCSlave is generated for each EtherCAT slave inserted in the device tree. The name of the instance corresponds to the name of the slave in the device tree. The availability of the instance is indicated in the IEC Objects area of the EtherCAT I/O Mapping dialog of the slave.
The slave instance is used in the application in order to query or change the state of the slave at runtime.
- InOut:
Scope
Name
Type
Comment
Inherited from
Input
xSetOperational
BOOL
Rising edge: An attempt is made to switch to the ETC_SLAVE_OPERATIONAL mode.
ETCSlaveStack
Output
wState
ETC_SLAVE_STATE
Current state of the slave:
0: ETC_SLAVE_BOOT
1: ETC_SLAVE_Init
2: ETC_SLAVE_PREOPERATIONAL
4: ETC_SLAVE_SAVEOPERATIONAL
8: ETC_SLAVE_OPERATIONAL
Configuration was successfully completed.
If errors occur during the configuration, the slave can fall back into an earlier state.
ETCSlaveStack