Main Content

Asynchronous Support Limitations

Asynchronous Task Priority

The Simulink® product does not simulate asynchronous task behavior. Although you can specify a task priority for an asynchronous task represented in a model with the Task Sync block, the priority setting is for code generation purposes only and is not honored during simulation.

Convert an Asynchronous Subsystem into a Model Reference

You can use the Asynchronous Task Specification block to specify an asynchronous function-call input to a model reference. However, you must convert the Async Interrupt and Function-Call blocks into a subsystem and then convert the subsystem into a model reference.

Following is an example with step-by-step instructions for conversion.

  1. Convert the Async Interrupt and Count blocks into a subsystem. Select both blocks and right-click Count. From the menu, select Subsystem & Model Reference > Create Subsystem from Selection.

  2. To prepare for converting the new subsystem to a Model block, set the following configuration parameters in the top model. Open the Configuration Parameters dialog box.

    • Under Diagnostics, navigate to the Sample Time pane. Then set model configuration parameter Multitask rate transition to error and Multitask conditionally executed subsystem to error.

    • Under Diagnostics, navigate to the Connectivity pane. Set parameter Bus signal treated as vector to error. Also set Context-dependent inputs to Enable All.

    • Under Diagnostics, navigate to the Data Validity pane and set parameter Multitask data store to error.

    • Set model configuration parameter Underspecified initialization detection to Simplified.

    • If your model is large or complex, run the Model Advisor checks in the folder Migrating to Simplified Initialization Mode Overview and make the suggested changes.

  3. Convert the subsystem to an atomic subsystem. Select the subsystem block parameter Treat as atomic unit.

  4. Convert the subsystem to a Model block. Right-click the subsystem and select Subsystem & Model Reference > Convert Subsystem to > Referenced Model. A window opens with a model reference block inside of it.

  5. Replace the subsystem in the top model with the new model reference block.

  6. Move the Async Interrupt block from the model reference to the top model, before the model reference block.

  7. Insert an Asynchronous Task Specification block in the model reference. Set the priority of the Asynchronous Task Specification block. (For more information on setting the priority, see Asynchronous Task Specification.)

  8. In the model reference, double-click the input port to open its Source Block Parameters dialog box. In the Signal Attributes tab, select the Output function call parameter. Click OK.

  9. Save your model and then update the diagram to verify your settings.

Related Topics