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.
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
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.
- 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.
Execution Manager: Execution Order
The execution order can be defined between the sibling parts of the model.
- 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.
- 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.