Test Cases and Signals in Simulink Element

You can create signals in the SystemTest™ software and use them to test a Simulink® model. The Test Case Editor provides a graphical way of creating, editing, and visualizing signal data in SystemTest. You can then map signals in the Simulink element using a Test Case Data test vector.

Here is an example of one possible high-level workflow of using test cases and signals in your test via the Simulink element. You will create a Test Case Data test vector, set up signals in the Test Case Editor, and then map Inport blocks to the signals in a Simulink element.

  1. In the Test Vectors pane, click the New button.

  2. Select Test Case Data as the test vector type. Click OK to create it.

    For more information, see Create a Test Case Data Test Vector

  3. In the Test Vectors pane, select the Test Case Data test vector you just created.

  4. Click the Open Test Case Editor button to open the tool.

  5. In the Test Case Editor, add one or more test cases using the Add Test Case button.

    For more information, see Create Test Cases.

  6. Select a test case and add one or more signals to it using the Add Signal button. If you plan to map these signals to Inport blocks in your model, you could create the signals with the same names as the blocks. They are not required to be the same name, but making them the same name allows the Mapping Assistant to work (in a later step).

    See Add Signals to Test Cases for more information on this step.

  7. For each signal, append the desired segment or segments to create the signal to use, and configure its attributes as needed.

    See Add Signals to Test Cases for more information on this step.

  8. Once you have created and edited the test case or cases and signals that you need, close the Test Case Editor by clicking the OK button at the bottom of the window. When you close the tool, the SystemTest software saves the data in the Test Case Data test vector.

  9. Return to the SystemTest desktop. You can now use the Test Case Data test vector and the signals it contains in your test, via the Simulink element, the Limit Check element, and the General Plot element.

  10. Use an existing Simulink element or add one by clicking the New > Test Element button and selecting Simulink.

  11. On the Properties pane, browse for your Simulink model using the Browse button next to the Simulink model field.

    Suppose you are using the following model, which has four Inport blocks that represent throttle angle, engine speed, exhaust gas, and manifold pressure of an automobile fuel controller.

  12. In this case, you want to map signals you created in the Test Case Editor to these four Inports in your model. Use the Override Inport Block Signals with SystemTest Data section of the Simulink element.

    You must use the Individual Inport blocks are mapped using option. Note that you cannot use the All Inport blocks are mapped using option. You can map the individual Inports by selecting the signal under the expanded test vector that matches the Inport block in each row of the table, as shown here.

    You could also use the Mappings Assistant (click the Mappings Assistant button to open it) and select them all at once by selecting the Test Case Data test vector in the A test case data test vector's signals override option, as shown next.

    When you click OK in the Mappings Assistant, the signals are entered into the SystemTest Data column in the table, and the test uses the signals' time by default.

  13. Set up any other elements for the test.

  14. Run the test.

    Note:   When using a Test Case Data test vector to simulate your model as described in this example, the Interpolate data option in the Simulink Block Parameters of your model's Inport blocks will be turned on. This allows data coming from signals containing segment types like Ramp and Custom to accurately reflect their value when sampled.

    After the test runs, the Interpolate data option will be restored in your model.

Was this topic helpful?