Main Content

Modeling Reusable Components Using Multiply Instanced Simulink Functions

In this example, the model slexCounterFunctionMdlRef contains a Simulink function update(), which maintains a counter. Multiple instancing provides the ability to reuse this logic as CounterA and CounterB in this application model.


The qualified calling notation CounterA.update and CounterB.update is used to distinguish the two different instances of the counter logic. Note that each instance may be called from multiple caller blocks as illustrated in this example.