How can I override a Test Assessment/Sequence scenario parameter in an observer model using Simulink Test Manager?

15 views (last 30 days)
Consider the model shown in Fig. 1 below.
Fig. 1
Additionally, consider the test harness shown in Fig. 2 for the model shown in Fig. 1.
Fig. 2
where the Test Sequence block contains the 2 scenarios shown in Fig. 3 that are activated according to the "idx_harness" scenario parameter.
Fig. 3
I would like to run a test assessment against the "internal_signal" signal shown in Fig. 1 even though I do not want to output this signal from the model. To do this, I inserted an Observer Reference block into the model shown in Fig. 1, as shown in Fig. 4 below.
Fig. 4
The corresponding Observer model, which is obtained by double-clicking on the "Observer" block in Fig. 4, is shown in Fig. 5.
Fig. 5
The contents of the Test Assessment block shown in Fig. 5 are shown in Fig. 6.
Fig. 6
The Test Assessment block also contains 2 scenarios that are activated according to the value of the "idx_observer" scenario parameter.
I would like to activate different scenarios in the Test Sequence block shown in Fig. 2 and the Test Assessment block shown in Fig. 5 by overriding the values of the "idx_harness" and "idx_observer" parameters inside Simulink Test Manager. Specifically, consider the Simulink Test Manager window shown in Fig. 7.
Fig. 7
When I click on the "Add Parameter" button shown in Fig. 8 to add parameters to override, Simulink Test Manager only detects the "idx_harness" scenario parameter and does not detect the "idx_observer" scenario parameter, as shown in Fig. 9. How can I get Simulink Test Manager to detect the "idx_observer" scenario parameter so that I can override its value?
Fig. 8
Fig. 9

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 1 May 2025
This is a known limitation of Simulink Test Manager. The reason for this is that the observer model is inside its own .slx file, and so the "idx_observer" parameter is not recognized from inside the test harness.
To work around this limitation, proceed as follows:
  1. Open the Test Sequence block in the test harness that is shown in Fig. 2.
  2. As shown in Fig. 10 below, open the "Symbols" tab and then click on the "Add data" button under the "Parameter" section.
     Fig. 10
  3. As shown in Fig. 11 below, enter "idx_observer" into the field that appears and then press the Enter key.
     Fig. 11
  4. Save your changes in the Test Sequence block and then close it.
  5. Back in Simulink Test Manager, follow the same workflow that you used to add a parameter to override it and you should now see the "idx_observer" parameter appear, as shown in Fig. 12 below.
    Fig. 12

More Answers (0)

Products


Release

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!