Contents

Map Bus Objects to Models

As models become complex, you need to keep track of which models use which bus objects. From any model or bus object, you should be able to tell what component it needs or is needed by.

A model must load all of its bus objects before you execute the model. For automation and consistency across models, it is important to map bus objects to models.

  • By identifying all of the bus objects a model needs, you can ensure that those objects are loaded before model execution.

  • By identifying all models that use a bus object, you can ensure that changes to a bus object do not cause unexpected changes in any of the models that use that bus object.

To map bus objects to models, consider:

  • Including the bus objects in a data dictionary. You can link the data dictionary to one or more models. For details, see Migrate Single Model to Use Dictionary.

  • Using Simulink® Projects by:

    1. Serializing the files that contain the bus objects as part of a project

    2. Loading that data upon project open

    For details, see Project Management .

  • Capturing the mapping information in an external data source, such as a database.

Use a Rigorous Naming Convention

Using a rigorous and standard naming convention for bus mapping information is a straightforward approach. For example, consider the model and data required for an actuator control function. You could name the model Actuator and name the input and output ports Actuator_bus_in and Actuator_bus_out, respectively. This naming convention makes it clear to what models a particular bus object is related, and vice versa.

Note that this approach can cause issues if the output from one model reference is fed directly to another model reference. In this case, the naming mismatch results in an error.

Related Examples

Was this topic helpful?