IgH EtherCAT Master  1.6.2
fsm_change.c File Reference

EtherCAT state change FSM. More...

Go to the source code of this file.

Functions

unsigned int ec_fsm_change_timeout_ms (const ec_fsm_change_t *fsm)
 Get timeout in ms. More...
 
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_timeout_ms()

unsigned int ec_fsm_change_timeout_ms ( const ec_fsm_change_t fsm)

Get timeout in ms.

For defaults see ETG2000_S_R_V1i0i15 section 5.3.6.2.

Parameters
fsmfinite state machine

Definition at line 79 of file fsm_change.c.

◆ 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 185 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 207 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 270 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 362 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 442 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 494 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 531 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 610 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 599 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 54 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 69 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 123 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 140 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 157 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 172 of file fsm_change.c.