2 ethercat state machine, Ethercat state machine – BECKHOFF ET9300 User Manual

Page 30

Advertising
background image

28

Application Note ET9300

Prototype:

UINT16 (* pAPPL_EEPROM_Write)(UINT32 wordaddr)

Parameter

Wordaddr

start word address within the EEPROM memory

Return

0 if the operation was successful.
greater 0 an error has occurred

Description

This is an optional function and only required if EEPROM_EMULATION is
enabled and no EEPROM content is created (CREATE_EEPROM_CONTENT
== 0)
This function shall copy data from the ESC EEPROM data register
(0x508:0x50F/0x50B) to the EEPROM memory.
The EEPROM data starting at the specified word address and the length
specified with "EEPROM_WRITE_SIZE".

Prototype:

UINT16 (* pAPPL_EEPROM_Reload)(void)

Parameter

Void

Return

0 if the operation was successful.
greater 0 an error has occurred

Description

This is an optional function and only required if EEPROM_EMULATION is
enabled and no EEPROM content is created (CREATE_EEPROM_CONTENT
== 0). In case that this function is implemented the function
“HW_EepromReload()” is not used.
This function shall copy the EEPROM reload information to the ESC EEPROM
data register (0x508:0x50F/0x50B).
Read the ESC data sheet for the reload information (e.g. Beckhoff IPCore ESC
Datasheet section II, clause 3.45.1)

6.3.2

EtherCAT State Machine

Each ESM function returns a 16Bit Value which reflects the result of the state transition.
Return value:

0

Indicates a successful transition. Define : ALSTATUSCODE_NOERRO

0xFF Indicates a pending state transition (the application need to complete the transition by

calling ECAT_StateChange). Define : NOERROR_INWORK

Other Indicates the reason for the failed transition. See [2] for a list of valid return codes.

Prototype:

UINT16 APPL_StartMailboxHandler(void)

Parameter

Void

Return

See generic ESM return code description

Description

This function is called during the state transition from INIT to PREOP or INIT to
BOOT.

Advertising