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.
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.
Switch to the Buses view set, if necessary.
In the Bus Configurations table, select the Restbus_BusConfiguration node.
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:

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

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.
In MATLAB, set the working directory to the Models folder of the BusManagerTutorial project.

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 | Contains the model block periphery that receives data from the Restbus_BusConfiguration subsystem. |
In the next step, you will add the generated Simulink model to the ConfigurationDesk application.