Step 3: How to Propagate Changes to a Simulink Model

Objective

To synchronize the model interfaces of the ConfigurationDesk application and a Simulink® model, you can propagate changes you make in the ConfigurationDesk application to the Simulink model and vice versa.


Part 1: To enable model access for function ports of the Restbus_BusConfiguration

  1. In the Bus Configuration Ports table, right-click the Related TX ECUs column header and select Set Column Filter on the context menu.

    The Column Filter Expressions for Column: Related TX ECUs dialog opens.

  2. In the dialog, specify left as the Filter expression.

  3. Make sure that only the Regular expression checkbox is selected and click OK.

    The Bus Configuration Ports table displays only the function ports of elements that are transmitted by the DoorLeftEcu.

    Note

    The filter is active until you clear it explicitly. This applies even when you close ConfigurationDesk or the Bus Manager (stand-alone).

  4. Select both DoorLeftClosedISignal Value function ports and set Model Access to Enabled.


Interim result

You enabled model access for a TX and an RX function port. You can now adapt the model port blocks of the ConfigurationDesk application and in the Simulink model accordingly. Continue with the next part.


Part 2: To adapt the model port blocks

  1. In the Bus Configuration Ports table, make sure that both DoorLeftClosedISignal Value function ports are still selected.

  2. In the Bus Configuration Ports table, right-click the Related TX ECUs column header and select Clear Column Filter on the context menu.

    All function ports are displayed and the DoorLeftClosedISignal Value function ports are still highlighted.

  3. Right-click one of the highlighted function ports and select Show - Show in Bus Configurations Table on the context menu.

    Both function ports are highlighted in the Bus Configurations table.

  4. Select the Model Browser.

  5. In the Model Browser, expand the Restbus_BusConfiguration_In and Restbus_BusConfiguration_Out model port blocks as follows:

    • Restbus_BusConfiguration_In - Out - Simulated ECUs - BusManagerTutorial_ComMatrix - BodyControlEcu - RX - PDUs - DoorLeftStatusIPdu

    • Restbus_BusConfiguration_Out - In - Simulated ECUs - BusManagerTutorial_ComMatrix - DoorLeftEcu - TX - PDUs - DoorLeftStatusIPdu

    For both DoorLeftStatusIPdu nodes, the DoorLeftLockedISignal node is displayed.

  6. Select the Message Viewer.

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

  8. On the Home ribbon, click .

    For the DoorLeftClosedISignal Value function ports, suitable model ports are created and mapped to the function ports. The model ports are added to the model port blocks:

    • In the Model Browser, two new DoorLeftClosedISignal nodes are available that contain the model ports on their lowest level.

    • The Connected Model Ports column of the Bus Configurations table displays the model ports that are mapped to the DoorLeftClosedISignal Value function ports.

    • The Message Viewer provides information on the changes that are made in the Simulink model.


Interim result

You adapted the model port blocks of the ConfigurationDesk application and the Simulink model to the changes you made for the function ports of the Restbus_BusConfiguration. You can now explore the effects in the Simulink model. Continue with the next part.


Part 3: To explore the effects of propagation in the Simulink model

  1. Select the Generated_Restbus_Model_User1 Simulink model.

  2. In the Simulink model, open the Restbus_BusConfiguration subsystem.

  3. In the subsystem, double-click the Restbus_BusConfiguration_Out model port block.

    The block dialog opens.

  4. In the block dialog, select the Signal Configuration tab.

    The In port of the Restbus_BusConfiguration_Out model port block is displayed. This port is a structured data port which contains further hierarchically structured ports and signals.

    For the DoorLeftStatusIPdu port of the DoorLeftEcu port, the DoorLeftClosedISignal port is available. This port and its lower-level elements were added to the block by the propagate operation.

    The value of the DoorLeftClosedISignal Value signal is provided to the TX DoorLeftClosedISignal Value function port in the ConfigurationDesk application.

  5. Close the dialog.

  6. Open the block dialog of the Restbus_BusConfiguration_In model port block.

  7. In the block dialog, select the Signal Configuration tab.

    For the Restbus_BusConfiguration_In model port block, the DoorLeftClosedISignal Value signal is added to the RX DoorLeftStatusIPdu of the BodyControlEcu. This signal receives the value from the RX DoorLeftClosedISignal Value function port of the ConfigurationDesk application.

  8. Close the dialog.

  9. In the Simulink model, press Ctrl+D to execute the Update Diagram functionality.

    The Diagnostic Viewer opens, displaying an error for the Restbus_BusConfiguration_Out model port block: For the DoorLeftClosedISignal, no input bus signal is available.

    The Restbus_BusConfiguration_Out model port block receives data from the model block periphery of the Restbus_BusConfiguration - In subsystem. Because the model block periphery is not affected by propagating changes to Simulink, it is not updated automatically.

    To prevent errors in Simulink, you must at least model the required input bus signals manually.

  10. Close the Diagnostic Viewer.


Result

You enabled model access for further function ports of the Restbus_BusConfiguration and propagated the changes to Simulink. This automatically updates the model port blocks in the ConfigurationDesk application and in Simulink. However, the model block periphery in the Simulink model is not updated.


What's next

In the next step, you will model the required input bus signal in the Simulink model.


Redaction