Language Reference - Execution Model


In every scan the following operations are performed:

  1. Read digital and analog inputs.
  2. Each transition that is enabled and has a condition that is true, is marked for firing.

  3. If a transition marked for firing has lower priority than an alternative transition which is also marked for firing, its firing mark is removed.

  4. The transitions marked for firing perform the following operations:

    1. Each step preceding the transition is deactivated, i.e. the exit actions of these steps are executed.
    2. Each step succeeding the transition is activated, i.e. the enter actions of these steps are executed.
  5. The following operations are performed for each step:

  6. Update variables that are marked due to normal actions.

  7. Sleep until the start of the next scan cycle.

This evaluation strategy makes the evaluation order of the transitions irrelevant and eliminates the risk of firing chains of transitions within the same scan-cycle. It also affects how alternative transitions with non-mutually exclusive conditions are handled. In JGrafchart all the alternative transitions will be fired. This conforms to the Grafcet standard and also gives a fully deterministic behavior. You need to make sure that alternative transitions always are mutually exclusive, e.g. by using priorities.

Alternative Firing