Functions Linked to States

Functions Treatment

The Function Treatment image shows how functions (that are state dependent) are treated.

Figure 1: Function Treatment

Function (Function Step)

Function

Description

Example

Run Function

  • Initializes exceptions on new state M1_CmdState <> M1_ReqState and on errors set in M1_StatusWord.
  • Goes to exit function when an exception occurs.
  • Acknowledges running.
  • Performs all actions needed for the function until the function call command is reset.

Figure 2: Change State > Error Stop > State

Stop Function

  • Performs all actions to properly leave this function.
  • Acknowledges end of exit, by setting M1_AckState to M1_ReqState.
  • Returns to last state.

Add a New Function

  1. Copy a similar existing function sequence.
  2. Replace the old function name by the new one (e.g., Running replaced with MyFunction).
  3. Modify the exit section of the new function to perform the relevant actions.
  4. Insert the needed function code into the run part.
  5. Add the function call command line to the state sequence where the function is used.