Master

A type “IoDrvEtherCAT” instance is generated for each EtherCAT Master added to the device tree.

Inputs (Master)

Name

Data Type

Description

xRestart

BOOL

Rising edge: The master is restarted and all configuration parameters are reloaded.

xStopBus

BOOL

TRUE: Communication is stopped. No further EtherCAT telegrams are sent. Then, because they were switched to error status, most devices must be restarted.

Outputs (Master)

Name

Data Type

Description

xConfigFinished

BOOL

TRUE: All configuration parameters were successfully transmitted. Communication is running on the bus.

xDistributedClockInSync

BOOL

When distributed clocks are used, the PLC is synchronized with the first EtherCAT slave for which the distributed clock option is enabled.
The output becomes TRUE as soon as the synchronization has been successfully completed. This signal can be used, for example, to ensure the SoftMotion function block is only started when the PLC is in synchronization mode, which will prevent potential position jumps. When the PLC starts, the output is FALSE and changes to TRUE after a few seconds. If the synchronization is lost for any reason, the output is reset to FALSE.

xError

BOOL

The output becomes TRUE if
• An error occurs when the EtherCAT stack is starting.
• Communication with the slaves is interrupted because no further messages can be received (e.g., due to a broken cable).

xSyncInWindow

BOOL

Output is TRUE when the option “Sync Window Monitoring” is activated and the synchronization of all slaves is within the synch window.

Examples

Properties of the Master

Parameter

Description

AutoSetOperational

TRUE: Master attempts to restart the slaves immediately after a communication interruption.
Default: FALSE

ConfigRead

TRUE: Reading the configuration has ended and the user can edit the settings, e.g., to add self-defined SDOs.

DCInSyncWindow

Timeframe for XDistributedClockInSync. Jitter must remain within this timeframe so the output signal “XDistributedClockInSync” always stays at TRUE.
Default: 50 microseconds

DCClockReferenceTime

Returns the current time of the first slave with activated distributed clock. This time serves as reference time for all other slaves and the PLC itself.

DCIntegralDivider

Integral factor for the distributed clock control loop;
Default: 20

DCPropFactor

Proportional factor for the distributed clock control loop;
Default: 25

DCSyncToMaster

Distributed-clock synchronization on the master when set to TRUE; then all slaves are synchronized to the master instead of synchronization of the first slave with the PLC.
Default: FALSE

DCSyncToMasterWithSysTime

Distributed-clock synchronization on the master
TRUE: All slaves are synchronized to the system time on the master. The time read from “SysTimeRtcHighResGet” is used to distribute the PLC system time to all EtherCAT slaves.
Default: FALSE

EnableTaskOutputMessage

Normally, EtherCAT messages are sent from the bus task and from each task that uses slave outputs. In the bus task, all outputs are written and all inputs read. In other tasks, the outputs are transmitted once more, so they immediately arrive to be written in the corresponding slaves. This is an attempt to keep dead time until writing as short as possible. In conjunction with distributed clocks, this may cause problems in some devices; for instance, servo controllers are not synchronized with “synch interrupt”; instead, they use the time of the writing for internal synchronization. In this case, multiple writing accesses may occur during a cycle. When “EnableTaskOutputMessage” is set to FALSE, only the bus cycle task is used. No other tasks will cause additional messages.
Default: TRUE

FirstSlave

Pointer to the first slave below the master

FrameAtTaskStart

TRUE: To minimize jitter, the frame for the slaves is transmitted to start the task (before the IEC task). This command is used to ensure servo drive movements are smooth and not jerky. When this flag is set to TRUE, the frame of the output buffer is written in the next cycle (see diagram below).
Default: FALSE

LastInstance

Pointer to linked master list -> preceding master

LastMessage

This property returns a string with the last message from the EtherCAT stack. “All slaves done” is returned if the start is successful. The string used is the same as the one for the diagnostics message displayed in the EtherCAT Master Device Editor window during online mode.

NextInstance

Pointer to linked master list -> next master

NumberActiveSlaves

This property returns the number of slaves that are actually connected. StartConfigWithLessDevice := TRUE: The number of real devices can be returned.

OpenTimeout

Timeout for opening the network adapter.
Default: 4 seconds

StartConfigWithLessDevice

Used to affect the starting behavior of the stack. Normally, EtherCAT stack stops when, for example, five servo controllers are configured in a project but only three are connected. However, if StartConfigWithLessDevice := TRUE in the first cycle, the stack will try to start anyhow. This makes it possible to, for instance, arrange a universal configuration of 10 servo controllers but still be able to vary the number that are actually connected. Note that in any case, the manufacturer and product IDs of each slave are checked. If any discrepancies are determined, the stack is stopped.

Effect of “FrameAtTaskStart”
Effect of “FrameAtTaskStart”