IgH EtherCAT Master
1.5.3
|
EtherCAT slave configuration state machine. More...
Go to the source code of this file.
Macros | |
#define | EC_DC_MAX_SYNC_DIFF_NS 10000 |
Maximum clock difference (in ns) before going to SAFEOP. More... | |
#define | EC_DC_SYNC_WAIT_MS 5000 |
Maximum time (in ms) to wait for clock discipline. | |
#define | EC_DC_START_OFFSET 100000000ULL |
Time offset (in ns), that is added to cyclic start time. | |
EtherCAT slave configuration state machine.
Definition in file fsm_slave_config.c.
#define EC_DC_MAX_SYNC_DIFF_NS 10000 |
Maximum clock difference (in ns) before going to SAFEOP.
Wait for DC time difference to drop under this absolute value before requesting SAFEOP.
Definition at line 50 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_start | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: START.
fsm | slave state machine |
Definition at line 221 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_init | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: INIT.
fsm | slave state machine |
Definition at line 246 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_clear_fmmus | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: CLEAR FMMU.
fsm | slave state machine |
Definition at line 283 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_clear_sync | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: CLEAR SYNC.
fsm | slave state machine |
Definition at line 342 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_dc_clear_assign | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: CLEAR DC ASSIGN.
fsm | slave state machine |
Definition at line 398 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_mbox_sync | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: SYNC.
fsm | slave state machine |
Definition at line 559 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_assign_pdi | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: ASSIGN_PDI.
fsm | slave state machine |
Definition at line 650 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_boot_preop | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: BOOT/PREOP.
fsm | slave state machine |
Definition at line 703 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_assign_ethercat | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: ASSIGN_ETHERCAT.
fsm | slave state machine |
Definition at line 776 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_sdo_conf | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: SDO_CONF.
fsm | slave state machine |
Definition at line 845 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_soe_conf_preop | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: SOE_CONF.
fsm | slave state machine |
Definition at line 918 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_watchdog_divider | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: WATCHDOG_DIVIDER.
fsm | slave state machine |
Definition at line 1027 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_watchdog | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: WATCHDOG.
fsm | slave state machine |
Definition at line 1086 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_pdo_sync | ( | ec_fsm_slave_config_t * | fsm | ) |
Configure PDO sync managers.
fsm | slave state machine |
Definition at line 1185 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_pdo_conf | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: PDO_CONF.
fsm | slave state machine |
Definition at line 976 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_fmmu | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: FMMU.
fsm | slave state machine |
Definition at line 1272 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_dc_cycle | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: DC CYCLE.
fsm | slave state machine |
Definition at line 1342 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_dc_sync_check | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: DC SYNC CHECK.
fsm | slave state machine |
Definition at line 1385 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_dc_start | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: DC START.
fsm | slave state machine |
Definition at line 1486 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_dc_assign | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: DC ASSIGN.
fsm | slave state machine |
Definition at line 1531 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_wait_safeop | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: WAIT SAFEOP.
fsm | slave state machine |
Definition at line 1599 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_safeop | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: SAFEOP.
fsm | slave state machine |
Definition at line 1629 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_soe_conf_safeop | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: SOE_CONF.
fsm | slave state machine |
Definition at line 1695 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_op | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: OP.
fsm | slave state machine |
Definition at line 1753 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_init | ( | ec_fsm_slave_config_t * | fsm | ) |
Start state change to INIT.
fsm | slave state machine |
Definition at line 233 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_clear_sync | ( | ec_fsm_slave_config_t * | fsm | ) |
Clear the sync manager configurations.
fsm | slave state machine |
Definition at line 313 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_dc_clear_assign | ( | ec_fsm_slave_config_t * | fsm | ) |
Clear the DC assignment.
fsm | slave state machine |
Definition at line 374 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_mbox_sync | ( | ec_fsm_slave_config_t * | fsm | ) |
Check for mailbox sync managers to be configured.
fsm | slave state machine |
Definition at line 427 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_assign_pdi | ( | ec_fsm_slave_config_t * | fsm | ) |
Assign SII to PDI.
fsm | slave state machine |
Definition at line 626 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_boot_preop | ( | ec_fsm_slave_config_t * | fsm | ) |
Request PREOP state.
fsm | slave state machine |
Definition at line 682 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_sdo_conf | ( | ec_fsm_slave_config_t * | fsm | ) |
Check for SDO configurations to be applied.
fsm | slave state machine |
Definition at line 814 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_soe_conf_preop | ( | ec_fsm_slave_config_t * | fsm | ) |
Check for SoE configurations to be applied.
fsm | slave state machine |
Definition at line 884 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_pdo_conf | ( | ec_fsm_slave_config_t * | fsm | ) |
PDO_CONF entry function.
fsm | slave state machine |
Definition at line 962 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_watchdog_divider | ( | ec_fsm_slave_config_t * | fsm | ) |
WATCHDOG_DIVIDER entry function.
fsm | slave state machine |
Definition at line 1002 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_watchdog | ( | ec_fsm_slave_config_t * | fsm | ) |
WATCHDOG entry function.
fsm | slave state machine |
Definition at line 1059 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_pdo_sync | ( | ec_fsm_slave_config_t * | fsm | ) |
Check for PDO sync managers to be configured.
fsm | slave state machine |
Definition at line 1117 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_fmmu | ( | ec_fsm_slave_config_t * | fsm | ) |
Check for FMMUs to be configured.
fsm | slave state machine |
Definition at line 1218 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_dc_cycle | ( | ec_fsm_slave_config_t * | fsm | ) |
Check for DC to be configured.
fsm | slave state machine |
Definition at line 1304 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_wait_safeop | ( | ec_fsm_slave_config_t * | fsm | ) |
Wait before SAFEOP transition.
The feature flag WaitBeforeSAFEOPms can be used to add a wait time before going to SAFEOP. This can be used as a workaround for slaves that need some extra time for initialisation.
fsm | slave state machine |
Definition at line 1567 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_safeop | ( | ec_fsm_slave_config_t * | fsm | ) |
Request SAFEOP state.
fsm | slave state machine |
Definition at line 1616 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_soe_conf_safeop | ( | ec_fsm_slave_config_t * | fsm | ) |
Check for SoE configurations to be applied in SAFEOP.
fsm | slave state machine |
Definition at line 1661 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_op | ( | ec_fsm_slave_config_t * | fsm | ) |
Bring slave to OP.
fsm | slave state machine |
Definition at line 1739 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_end | ( | ec_fsm_slave_config_t * | fsm | ) |
void ec_fsm_slave_config_state_error | ( | ec_fsm_slave_config_t * | fsm | ) |
void ec_fsm_slave_config_reconfigure | ( | ec_fsm_slave_config_t * | fsm | ) |
Reconfigure the slave starting at INIT.
fsm | slave state machine |
Definition at line 1779 of file fsm_slave_config.c.
void ec_fsm_slave_config_init | ( | ec_fsm_slave_config_t * | fsm, |
ec_datagram_t * | datagram, | ||
ec_fsm_change_t * | fsm_change, | ||
ec_fsm_coe_t * | fsm_coe, | ||
ec_fsm_soe_t * | fsm_soe, | ||
ec_fsm_pdo_t * | fsm_pdo | ||
) |
Constructor.
fsm | slave state machine |
datagram | datagram structure to use |
fsm_change | State change state machine to use. |
fsm_coe | CoE state machine to use. |
fsm_soe | SoE state machine to use. |
fsm_pdo | PDO configuration state machine to use. |
Definition at line 121 of file fsm_slave_config.c.
void ec_fsm_slave_config_clear | ( | ec_fsm_slave_config_t * | fsm | ) |
void ec_fsm_slave_config_start | ( | ec_fsm_slave_config_t * | fsm, |
ec_slave_t * | slave | ||
) |
Start slave configuration state machine.
fsm | slave state machine |
slave | slave to configure |
Definition at line 158 of file fsm_slave_config.c.
int ec_fsm_slave_config_running | ( | const ec_fsm_slave_config_t * | fsm | ) |
fsm | slave state machine |
Definition at line 172 of file fsm_slave_config.c.
int ec_fsm_slave_config_exec | ( | ec_fsm_slave_config_t * | fsm | ) |
Executes the current state of the state machine.
If the state machine's datagram is not sent or received yet, the execution of the state machine is delayed to the next cycle.
fsm | slave state machine |
Definition at line 189 of file fsm_slave_config.c.
int ec_fsm_slave_config_success | ( | const ec_fsm_slave_config_t * | fsm | ) |
fsm | slave state machine |
Definition at line 208 of file fsm_slave_config.c.