Guy on Simulink

Simulink & Model-Based Design

Asynchronous Function-Call Inputs to Models

In Simulink R2011a, it is possible to pass asynchronous function-call signals through Inports of a model. This enables the asynchronous function call to cross the boundary of Model block. Such function-call signals are typically used in Simulink models to capture interrupt-driven processing that is asynchronous with the time-driven processing in that model.

In this post I want to provide an overview of the effects this enhancement could have on your models.

Model Architecture Decomposition

Simulink models can be structured in multiple ways. If you work in the automotive industry your model probably looks like one of the 2 types shown in this image, taken from the MAAB Control Algorithm Modeling Guidelines.

Model Architecture proposed in MAAB guidelines

Type A

In type A, when you open a model you see a trigger layer. The trigger layer groups algorithmic components into common rates subgroups. This trigger layer can be componentized using Function-Call Model Reference. When opening your model, what you see looks like this:

Type A model - Trigger Layer using Referenced models

Type B

When you open a model of type B, you see the functional structure of the model. In my opinion, type B has many advantages over type A, for instance type B accurately captures both the timing and data dependencies between components more explicitly.

Type B model - Structural Layer

Before R2011a, componentizing the structural layer of a type B model using referenced models was not possible if the model contains asynchronous events. Now that asynchronuous function-call can be passed through input ports of referenced models, this type of componentization becomes possible:

Type B model - Structural Layer

Converting the structural layer to use model reference has the benefit that you have more rigorous componentization of this layer.

How does that work?

To learn more on that topic, I recommend going through the documentation section titled Converting an Asynchronous Subsystem into a Model Reference. After you converted the subsystem into a referenced model and configured it properly, you need to insert the Asynchronous Task Specification block, set its priority to the same as the incoming function-call, and configure the Inport block to output a function call:

Type B model - Structural Layer

Now It's your turn!

Are you going to take advantage of the possibility to pass asynchronous function call through referenced models inputs? Leave a comment here.

|
  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.