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.
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.
To prepare for converting the new subsystem to a Model block, set these model configuration parameters in the top model.
Set Multitask rate transition to
Set Multitask conditionally executed subsystem to
Set Bus signal treated as vector to
Set Context-dependent inputs to
Set Multitask data store to
Set Underspecified initialization detection to
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.
Convert the subsystem to an atomic subsystem. Select the subsystem block parameter Treat as atomic unit.
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.
Replace the subsystem in the top model with the new Model block.
Move the Async Interrupt block from the referenced model to the top model, before the Model block.
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.)
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.
Save your model and then update the diagram to verify your settings.