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 referenced model. However, you must convert the Async Interrupt and Function-Call blocks into a subsystem and then convert the subsystem into a referenced model.

This example shows how to complete a conversion.

Model for showing how to convert Async Interrupt and Function-Call blocks into a subsystem, which can then be converted to a referenced model

  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.

    Model for showing how to convert Async Interrupt and Count blocks into a subsystem

  2. To prepare for converting the new subsystem to a Model block, set these model configuration parameters in the top model.

    • Set Multitask data transfer to error.

    • Set Multitask conditionally executed subsystem to error.

    • Set Bus signal treated as vector to error.

    • Set Context-dependent inputs to error.

    • Set Multitask data store to error.

    • Set 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.

    Model that shows how to convert a subsystem to an atomic subsystem

    Model that includes converted subsystem

  4. Convert the subsystem to a Model block. Right-click the subsystem and select Subsystem & Model Reference > Convert Subsystem to > Referenced Model. The Model Reference Conversion Advisor opens.

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

    Model showing subsystem replaced with Model block

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

    Async Interrupt block moved from referenced model to top model before Model block

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

    Asynchronous Task Specification block inserted in referenced model

  8. In the referenced model, 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.

    Source Block Parameters dialog box of referenced model

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

    Saved version of updated model

Related Topics