Step 1: How to Generate a New Simulink Model Interface

Objective

To exchange data with a Simulink® model when no suitable model is available yet, you can generate a Simulink model interface for function ports whose model access is enabled.

Tip

When you configured the bus communication for simulation purposes in lesson 2, you already enabled model access for function ports. Therefore, you do not have to enable model access in this step.


Method: To generate a new Simulink model interface

  1. Switch to the Buses view set, if necessary.

  2. In the Bus Configurations table, select the Restbus_BusConfiguration node.

  3. On the Home ribbon, click Models - Generate New Simulink Model Interface.

    If not already open, MATLAB® opens and a new Simulink model is generated. This might take a while. The generated model looks as follows:

  4. Save the Simulink model in the Models folder of the BusManagerTutorial project as Generated_Restbus_Model_User1.slx.

    Note

    The Generated_Restbus_Model.slx model that is already available in the Models folder is used for the result application of this lesson. Do not overwrite this model.

  5. In MATLAB, set the working directory to the Models folder of the BusManagerTutorial project.


Result

You generated a Simulink model interface for the function ports of the Restbus_BusConfiguration whose model access is enabled. On the root level of the generated Simulink model interface, three subsystems are available:

Subsystem

Description

Restbus_BusConfiguration - In

Contains the model block periphery that provides data to the Restbus_BusConfiguration subsystem.

Restbus_BusConfiguration

Contains two model port blocks:

  • Restbus_BusConfiguration_Out

    This block is a Data Outport block. It receives the data of the Restbus_BusConfiguration - In subsystem and provides it to function inports of the Restbus_BusConfiguration in the ConfigurationDesk application, e.g., to TX Value function ports of the ISignal Value feature.

  • Restbus_BusConfiguration_In

    This block is a Data Inport block. It receives data from function outports of the Restbus_BusConfiguration in the ConfigurationDesk application, e.g., from RX Value function ports of the ISignal Value feature. This data is provided to the Restbus_BusConfiguration - Out subsystem.

Restbus_BusConfiguration - Out

Contains the model block periphery that receives data from the Restbus_BusConfiguration subsystem.


What's next

In the next step, you will add the generated Simulink model to the ConfigurationDesk application.


Redaction