Execution type

Table Execution types shows the different execution types for processing blocks.

Execution types

Name

Description

Synchronous

The processing block is executed inside the isochronous sample loop.

Asynchronous

The processing block is executed outside the isochronous sample loop. Inputs and outputs are copied from and to the isochronous sample loop at a configured interval. This execution type is useful for processing blocks with execution times longer than the period of the isochronous sample loop.

The different execution types are described in the following sub-sections.

Synchronous execution

A block that is executed synchronously is executed every sample. The sequence of reading the inputs, calculating the new outputs, and writing these outputs is completed within one sample. Overview of the processing of two input samples shows the steps that are executed during every sample in a synchronously executed processing block.

Overview of the processing of two input samples

Overview of the processing of two input samples

Asynchronous execution

When executing asynchronously, the inputs are read in the sample but the actual processing is decoupled.

The sequence of reading the inputs, calculating the new outputs, and writing these outputs is completed over one or more samples, depending on the ref:software/general-concepts/processing-block/execution-period:Execution period configuration. Overview of asynchronously processed samples shows the processing of an asynchronous processing block in relation with the main loop which executes periodically.

Overview of asynchronously processed samples

Overview of asynchronously processed samples

The top bar shows the execution of the main loop whereas the bottom bar represents the asynchronous execution of the processing block. The periods of the main loop and that of the asynchronous processing block are shown in dashed red. In this example the Execution period of the asynchronous processing block is twice the period of the main loop.

The processing of an asynchronous processing block starts with a synchronization step, which copies the input values to local memory of the asynchronous processing block. Calculation of the outputs can take multiple cycles of the main loop, as illustrated in the figure. The amount of available cycles depends on the specified Execution period. After the processing has finished the outputs are written and copied back to main memory. When calculation finishes early the outputs are still written at the configured execution period. The data-dependencies are illustrated with the arrows, where the arrow direction indicates the copying of data.

It can also be that an overload occurs and the asynchronous processing block does not finish its execution before the next period of the processing block starts. This scenario is illustrated in Overview of an asynchronously processed sample which finishes after the end of the period of the asynchronous processing block. As before the period of the asynchronous processing block is twice that of the main loop. In this overload scenario the main loop cannot synchronize output values because they might not be available yet. Therefore, the old values remain visible. The next synchronization of the output values of the processing block is after the next period boundary of the asynchronous processing block. No new processing block execution is started until the period boundary after which the current execution has finished.

Overview of an asynchronously processed sample which finishes after the end of the period of the asynchronous processing block

Overview of an asynchronously processed sample which finishes after the end of the period of the asynchronous processing block

In the case of an overload scenario, such as shown in Overview of an asynchronously processed sample which finishes after the end of the period of the asynchronous processing block, the respective overload events are active.