Assigning Actions to a State

Each state can have an entry action, a static action and an exit action. All these are optional.

  1. Do one of the following:

    • Double-click a state.

      The State Editor window opens in the Entry tab.

    • Right-click the state, open the Edit State context menu and select action.

      The State Editor window opens in the action tab.

  2. On the Entry tab of the State Editor window, select an entry action from the combo box.

  3. On the Static and Exit tabs, select the static and exit actions.

    You can use all actions and public methods without return value.

  4. Click OK.

    The names of the actions are displayed in the state symbol.

    If you have assigned actions or conditions with arguments, a test is carried out when you leave the state or transition editor to see if all the relevant triggers have the corresponding arguments with identical names and types. If this is not the case, an error message appears in the ASCET monitor window.

  5. Generate the trigger elements specified in the error message as described in Adding a Trigger Argument.

If you generated a trigger argument, and it is not used in any action or condition, this has no effect on the function of the state machine. On code generation, an information (IMdl92) is shown in the ASCET monitor window.

Once you have assigned actions or conditions from an ActionCondition diagram, the Edit button on the various tabs becomes active. You can use it to edit the action/condition assigned on the respective tab.

See also

Adding a Trigger Argument