Defining Extended Execution Model terms

You can use MicroC profile to specify the sequence of the element actions. The specification of an execution order for element parts is based on an Execution Scheme and the following two MicroC concepts: Executable and Execution Manager.

Executable objects

When using the MicroC profile, the element has its own event queue if it is defined to be an Execution Manager and the concurrency setting is sequential. This behavior is different from the general behavior in which a model element has an event queue only if its concurrency has been set to active.

A class or object is tagged as Executable in its Features window, General tab. The Executable tag of the class is required to implement a doExecute() method. The doExecute() method does its own calculations and return values.

Features window - Execution Scheme check boxes enabled
Features window - Parts tab

Execution Manager objects

A class or object that is tagged as an Execution Manager controls the execution of itself and its parts.

Each execution manager controls the execution of its executable parts. An execution manager has its own event queue for handling the events defined in its statechart. You can specify whether the event handling will precede or follow the doExecute methods of the parts of the element by modifying the value of the C_CG::Class::ExecutionManagerDispatchEventOrder property. The size of an execution of the manager's event queue is controlled by the C_CG::Class::ExecutionManagerEventQueueSize property. An execution manager also handles any statecharts defined for parts of its parts, down to the lowest level of the hierarchy. A new Execution Manager can be defined anywhere in the model hierarchy. However, in terms of doExecute calls, an execution manager calls only the doExecute methods defined for its direct parts.

If you have specified one or more model elements as Executable, but do not have at least one active element in your model, the generated code includes a package-level doExecute method. This package-level method calls the doExecute methods that you defined for individual executable elements at the highest-level of the package. This default behavior can be turned off by modifying the value of the C_CG::Configuration::UseMainTask property.

Features dialog of an active element

For an active element, the doExecute() method of the execution manager is defined to:
  • Call the doExecute() of all of its “Executable” parts with no statechart, following the defined execution order.
  • Dispatch all events in its event queue, if they exist.
You can control the order of the preceding operations by using the Activation Policy property, that can have the values of Periodic or Asynchronous for an active element. The Features dialog for an active element, is always defined in the Execution Scheme field as executable and as an execution manager by default. It also always contains two values to select: Periodic and Asynchronous.
Features window - Execution Scheme check boxes enabled
  • The Periodic value enables to run “Delay” time from system startup and then periodically every “Period” time. For each activation, runs until completed.
  • The Asynchronous value enables that the "Period" and "Delay fields" to be dimmed, and it allows to get control from the operating system (OS) when having a pending signal (event) in its queue.

Features dialog of a sequential element

A sequential element can be tagged as execution manager and that is required to implement the doExecute () method. To control the execution of the sequential model and its parts you must check the Execution Manager box. The sequential element as an execution manager drives the complete execution required by all of its parts, including the event dispatching of its Reactive parts.

Note: For a sequential element the Activation frame is not visible.
Features window - Execution Scheme check boxes enabled

Execution Manager: Execution Order

The execution order can be defined between the sibling parts of the model.

In the Features window, the Parts tab, you can define a table of the parts with the following columns:
  • Name – The name of the part
  • Execution Order - Can have one of the following values:
    • Integer number: Appears for parts tagged as Executable. Indicates the order in the execution, and can be modified.
    • N/A: Appears for parts not tagged Executable. It cannot be modified.
Features window - Execution Scheme check boxes enabled
  • Type: Can have one of the following values:
    • Execution Manager: The part is tagged as an execution manager.
    • Executable: The part is tagged as executable.
    • Reactive: Parts with the statechart that are not marked executable or execution manager.
    • None: Parts without statechart that are not marked executable or execution manager.
    • Active: Parts tagged as active.
    • inNetworkPort: Connects to an input signal.
    • outNetworkPort: Connects to an output signal.
Features window - Execution Scheme check boxes enabled