4 l_iodrvethercat (fb), L_iodrvethercat (fb), L_iodrvethercat (fb) ( 140) – Lenze EtherCAT Controller-based Automation User Manual
Page 140: 9function library l_iodrvethercat.lib
9
Function library L_IODrvEtherCAT.lib
9.3
Device Interface
140
Lenze · Controller-based Automation · EtherCAT® Communication Manual · DMS 6.4 EN · 04/2014 · TD17
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
9.3.4
L_IODrvEtherCAT (FB)
If an EtherCAT master is created in the configuration tree of a »PLC Designer« project, the system
automatically creates an object of the L_IODrvEtherCAT type.
The name of the function block for the EtherCAT master ist "EtherCAT_Master".
Visualisation: VISU_L_IODrvEtherCAT
Inputs (VAR_INPUT)
Outputs (VAR_OUTPUT)
Note!
The L_IODrvEtherCAT function block is called in the context of the bus cycle task and
must not be called again in the PLC program.
L_IODrvEtherCAT
BOOL xRestart
xDone BOOL
BOOL xStopBus
xBusy BOOL
xError BOOL
eErrorCode L_ETC_ERRORCODE
wState WORD
xDistributedClockInSync BOOL
Identifier/data type
Meaning/possible settings
xRestart
BOOL
A positive edge (TRUE) executes a bus restart.
• The EtherCAT master is first set to the Init state and then to "Operational".
• When xStopBus = TRUE, the positive edge is ignored.
Restarting the EtherCAT fieldbus ( 159)
xStopBus
BOOL
A positive edge (TRUE) executes a bus stop.
• The fieldbus is set to the "Init" state.
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).
General error codes (L_ETC_ERRORCODE) ( 183)
wState
WORD
L_ETC_STATE (EtherCAT status) ( 158)
xDistributedClockInSync
BOOL
• TRUE: All DC slaves have been synchronised.
• FALSE: Not all DC slaves have been synchronised.