IgH EtherCAT Master  1.5.3
fsm_change.c File Reference

EtherCAT state change FSM. More...

Go to the source code of this file.

Macros

#define EC_AL_STATE_CHANGE_TIMEOUT   5
 Timeout while waiting for AL state change [s].
 

Functions

void ec_fsm_change_state_start (ec_fsm_change_t *fsm)
 Change state: START. More...
 
void ec_fsm_change_state_check (ec_fsm_change_t *fsm)
 Change state: CHECK. More...
 
void ec_fsm_change_state_status (ec_fsm_change_t *fsm)
 Change state: STATUS. More...
 
void ec_fsm_change_state_start_code (ec_fsm_change_t *fsm)
 Enter reading AL status code. More...
 
void ec_fsm_change_state_code (ec_fsm_change_t *fsm)
 Change state: CODE. More...
 
void ec_fsm_change_state_ack (ec_fsm_change_t *fsm)
 Change state: ACK. More...
 
void ec_fsm_change_state_check_ack (ec_fsm_change_t *fsm)
 Change state: CHECK ACK. More...
 
void ec_fsm_change_state_end (ec_fsm_change_t *fsm)
 State: END. More...
 
void ec_fsm_change_state_error (ec_fsm_change_t *fsm)
 State: ERROR. More...
 
void ec_fsm_change_init (ec_fsm_change_t *fsm, ec_datagram_t *datagram)
 Constructor. More...
 
void ec_fsm_change_clear (ec_fsm_change_t *fsm)
 Destructor. More...
 
void ec_fsm_change_start (ec_fsm_change_t *fsm, ec_slave_t *slave, ec_slave_state_t state)
 Starts the change state machine. More...
 
void ec_fsm_change_ack (ec_fsm_change_t *fsm, ec_slave_t *slave)
 Starts the change state machine to only acknowlegde a slave's state. More...
 
int ec_fsm_change_exec (ec_fsm_change_t *fsm)
 Executes the current state of the state machine. More...
 
int ec_fsm_change_success (ec_fsm_change_t *fsm)
 Returns, if the state machine terminated with success. More...
 

Variables

const ec_code_msg_t al_status_messages []
 Application layer status messages.
 

Detailed Description

EtherCAT state change FSM.

Definition in file fsm_change.c.

Function Documentation

◆ ec_fsm_change_state_start()

void ec_fsm_change_state_start ( ec_fsm_change_t fsm)

Change state: START.

Parameters
fsmfinite state machine

Definition at line 152 of file fsm_change.c.

◆ ec_fsm_change_state_check()

void ec_fsm_change_state_check ( ec_fsm_change_t fsm)

Change state: CHECK.

Parameters
fsmfinite state machine

Definition at line 174 of file fsm_change.c.

◆ ec_fsm_change_state_status()

void ec_fsm_change_state_status ( ec_fsm_change_t fsm)

Change state: STATUS.

Parameters
fsmfinite state machine

Definition at line 237 of file fsm_change.c.

◆ ec_fsm_change_state_start_code()

void ec_fsm_change_state_start_code ( ec_fsm_change_t fsm)

Enter reading AL status code.

Parameters
fsmfinite state machine

Definition at line 326 of file fsm_change.c.

◆ ec_fsm_change_state_code()

void ec_fsm_change_state_code ( ec_fsm_change_t fsm)

Change state: CODE.

Parameters
fsmfinite state machine

Definition at line 406 of file fsm_change.c.

◆ ec_fsm_change_state_ack()

void ec_fsm_change_state_ack ( ec_fsm_change_t fsm)

Change state: ACK.

Parameters
fsmfinite state machine

Definition at line 458 of file fsm_change.c.

◆ ec_fsm_change_state_check_ack()

void ec_fsm_change_state_check_ack ( ec_fsm_change_t fsm)

Change state: CHECK ACK.

Parameters
fsmfinite state machine

Definition at line 495 of file fsm_change.c.

◆ ec_fsm_change_state_end()

void ec_fsm_change_state_end ( ec_fsm_change_t fsm)

State: END.

Parameters
fsmfinite state machine

Definition at line 572 of file fsm_change.c.

◆ ec_fsm_change_state_error()

void ec_fsm_change_state_error ( ec_fsm_change_t fsm)

State: ERROR.

Parameters
fsmfinite state machine

Definition at line 561 of file fsm_change.c.

◆ ec_fsm_change_init()

void ec_fsm_change_init ( ec_fsm_change_t fsm,
ec_datagram_t datagram 
)

Constructor.

Parameters
fsmfinite state machine
datagramdatagram

Definition at line 65 of file fsm_change.c.

◆ ec_fsm_change_clear()

void ec_fsm_change_clear ( ec_fsm_change_t fsm)

Destructor.

Parameters
fsmfinite state machine

Definition at line 80 of file fsm_change.c.

◆ ec_fsm_change_start()

void ec_fsm_change_start ( ec_fsm_change_t fsm,
ec_slave_t slave,
ec_slave_state_t  state 
)

Starts the change state machine.

Parameters
fsmfinite state machine
slaveEtherCAT slave
staterequested state

Definition at line 90 of file fsm_change.c.

◆ ec_fsm_change_ack()

void ec_fsm_change_ack ( ec_fsm_change_t fsm,
ec_slave_t slave 
)

Starts the change state machine to only acknowlegde a slave's state.

Parameters
fsmfinite state machine
slaveEtherCAT slave

Definition at line 107 of file fsm_change.c.

◆ ec_fsm_change_exec()

int ec_fsm_change_exec ( ec_fsm_change_t fsm)

Executes the current state of the state machine.

Returns
false, if the state machine has terminated
Parameters
fsmfinite state machine

Definition at line 124 of file fsm_change.c.

◆ ec_fsm_change_success()

int ec_fsm_change_success ( ec_fsm_change_t fsm)

Returns, if the state machine terminated with success.

Returns
non-zero if successful.
Parameters
fsmFinite state machine

Definition at line 139 of file fsm_change.c.