IgH EtherCAT Master
1.6.2
|
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 43 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 174 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 223 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 248 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 285 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 344 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 400 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 561 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 652 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 705 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 778 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 847 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 920 of file fsm_slave_config.c.
void ec_fsm_slave_config_state_eoe_ip_param | ( | ec_fsm_slave_config_t * | fsm | ) |
Slave configuration state: EOE_IP_PARAM.
fsm | slave state machine |
Definition at line 990 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 1080 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 1139 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 1238 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 1029 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 1325 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 1395 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 1438 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 1539 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 1584 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 1652 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 1682 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 1748 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 1806 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 235 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 315 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 376 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 429 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 628 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 684 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 816 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 886 of file fsm_slave_config.c.
void ec_fsm_slave_config_enter_eoe_ip_param | ( | ec_fsm_slave_config_t * | fsm | ) |
EOE_IP_PARAM entry function.
fsm | slave state machine |
Definition at line 964 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 1015 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 1055 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 1112 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 1170 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 1271 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 1357 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 1620 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 1669 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 1714 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 1792 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 1832 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, | ||
ec_fsm_eoe_t * | fsm_eoe | ||
) |
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. |
fsm_eoe | EoE 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 160 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 191 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 210 of file fsm_slave_config.c.