4 l_etc_setslavestate (fb), L_etc_setslavestate (fb), L_etc_setslavestate (fb) ( 154) – Lenze EtherCAT Controller-based Automation User Manual
Page 154: 9function library l_iodrvethercat.lib
9
Function library L_IODrvEtherCAT.lib
9.6
State Machine Interface
154
Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.4 EN · 04/2014 · TD17
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9.6.4
L_ETC_SetSlaveState (FB)
This function block sets the state of the EtherCAT slave.
Visualisation: VISU_L_ETC_SetSlaveState
Inputs (VAR_INPUT)
Outputs (VAR_OUTPUT)
Note!
The status of the slaves cannot be higher than the status of the EtherCAT master.
Example: If the master is in the Pre-Operational state, the state of a slave cannot be
"Safe-Operational" or "Operational".
L_ETC_SetSlaveState
BOOL xExecute
xDone BOOL
UINT uiDevice
xBusy BOOL
WORD wState
xError BOOL
UDINT udiTimeout
eErrorCode L_ETC_ERRORCODE
Identifier/data type
Meaning/possible settings
xExecute
BOOL
A positive edge (TRUE) sets the EtherCAT slave state by the slave given by uiDevice.
uiDevice
UINT
EtherCAT address of the slave.
wState
WORD
EtherCAT slave state to be set of the
L_ETC_STATE (EtherCAT status) ( 158)
udiTimeout
UDINT
Timeout in milliseconds (ms)
• The value 0 is not permissible and causes the error ETC_E_INVALIDPARM
(0x9811000B).
Identifier/data type
Meaning/possible settings
xDone
BOOL
• TRUE: An action has been executed successfully.
• FALSE: No action active / action is still being executed.
xBusy
BOOL
• TRUE: An action is currently being executed.
• FALSE: No action active
xError
BOOL
• TRUE: An error has occurred.
• FALSE: No error
eErrorCode
L_ETC_ERRORCODE
Error code of the incorrectly executed action (xError = TRUE).