Main Content

Introduction to Managing Data with Model Reference

This example shows the basic concepts related to managing data with model reference.

Open the Example Model

Open the example model sldemo_mdlref_datamngt.

Example Content

This example uses a top model sldemo_mdlref_datamngt that contains three Model blocks: Counter1, Counter2, and Counter3. These blocks reference the same model sldemo_mdlref_counter_datamngt.

The referenced model implements a limited counter algorithm that:

  • Resets the counter if the first trigger input changes

  • Increments the counter by a specified amount if the second input changes

  • Saturates the counter between the specified upper and lower limits

The referenced model outputs a bus signal that contains:

  • Count: the value of the counter as an 8-bit integer

  • OverflowState: an enumerated value that indicates whether the counter is at the upper limit, lower limit, or in range

See Also

|

Related Topics