State Machine

States

State

Description

SETUP

Initialization of OPC-UA server and EtherCAT master (reading/parsing of ENI file, initialization of link layer)

FAILED SETUP

Setup failed. OPC-UA server might be reachable, but EtherCAT master is not instantiated. Usually caused by misconfiguration.

READY

OPC-UA server is running and EtherCAT master is activated (but no active communication yet). Waiting for user input (request master state).

STARTING

EtherCAT communication is initiated. Master transitions through states INIT, PREOP or SAFEOP (depending on requested state).

ACTIVE

EtherCAT master is in state OPERATIONAL.

ERROR TRANSITION

An error ocurred in ACTIVE state. The master will try to keep EtherCAT communication active for a configured time period before transitioning to ERROR state.

ERROR

An error ocurred in ACTIVE state and the transition timeout is expired. EtherCAT master is in SAFEOP or lower (depending on requested state).

STOPPING

Transitional state before STOPPED state. The EtherCAT master is being deactivated.

STOPPED

Error state in which no EtherCAT communication is possible. The EtherCAT master is deactivated.

SHUTDOWN

The EtherCAT master application is shutting down (including OPC-UA server).

FINAL

Final state while the process is being terminated.

State Chart

digraph state_machine { fontname="Helvetica,Arial,sans-serif" node [fontname="Helvetica,Arial,sans-serif"] edge [fontname="Helvetica,Arial,sans-serif"] node [shape=box]; rankdir=TB; SETUP->FAILED_SETUP[label="(1)"]; SETUP->READY[label="(2)"]; FAILED_SETUP->SETUP[label="(3)"]; READY->STOPPING[label="(4)"]; READY->STARTING[label="(5)"]; STARTING->STOPPING[label="(6)"]; STARTING->ACTIVE[label="(7)"]; ACTIVE->ERROR_TRANSITION[label="(8)"]; ACTIVE->READY[label="(9)"]; ERROR_TRANSITION->STOPPING[label="(10)"]; ERROR_TRANSITION->ERROR[label="(11)"]; ERROR_TRANSITION->STARTING[label="(12)"]; ERROR->STOPPING[label="(13)"]; ERROR->STARTING[label="(14)"]; STOPPING->STOPPED[label="(15)"]; STOPPED->SETUP[label="(16)"]; SHUTDOWN->FINAL[label="(17)"]; ANY_STATE->SHUTDOWN[label="(18)"]; }

Transitions

Transition

Conditions

  1. SETUP -> FAILED SETUP

HasError

  1. SETUP -> READY

IsMasterActive

  1. FAILED SETUP -> SETUP

IsRestartRequested

  1. READY -> STOPPING

HasError or not IsMasterActive

  1. READY -> STARTING

IsMasterStateRequested or IsMasterOperational

  1. STARTING -> STOPPING

HasError or not IsMasterActive

  1. STARTING -> ACTIVE

IsMasterOperational

  1. ACTIVE -> ERROR TRANSITION

HasError or not IsMasterActive

  1. ACTIVE -> READY

not IsMasterOperational

  1. ERROR TRANSITION -> STOPPING

not IsMasterActive

  1. ERROR TRANSITION -> ERROR

not IsErrorTimerActive

  1. ERROR TRANSITION -> STARTING

IsContinueRequested

  1. ERROR -> STOPPING

not IsMasterActive or IsRestartRequested

  1. ERROR -> STARTING

IsContinueRequested

  1. STOPPING -> STOPPED

not IsMasterActive

  1. STOPPED -> SETUP

IsRestartRequested

  1. SHUTDOWN -> FINAL

not IsMasterActive

  1. ANY_STATE -> SHUTDOWN

IsShutdownRequested

Conditions

Condition

Description

IsMasterActive

The EtherCAT master is active, i.e. correctly initialised. EtherCAT communication does not need to be initiated.

IsMasterStateRequested

An EtherCAT master state was requested by the user application (INIT, PREOP, SAFEOP or OP).

IsMasterOperational

EtherCAT master is in state OPERATIONAL (‘OP’).

HasError

An error has occurred.

IsErrorTimerActive

In ERROR TRANSITION state: the timer for the transition period is still active (not expired).

IsContinueRequested

The user app requested ‘Continue’ in error state.

IsRestartRequested

The user app requested ‘Restart’.

IsShutdownRequested

Shutdown was requested by the operating system.