MATLAB: How to access simulation output signals in custom criteria callbacks for real-time tests in Simulink Test R2018b

simulink testsltest_simout

How can I access simulation output signals in custom criteria callbacks for real-time tests in Simulink Test R2018b?
I am running real-time test cases on a Speedgoat target machine and I would like to assess some conditions in a custom criteria callback. For normal desktop simulations, the "STMCustomCriteria" object has an "sltest_simout" property where I can access simulation output signals. However, this property is empty when I look at a "STMCustomCriteria" object for real-time tests. How can I access simulation output signals in this case?
test =
STMCustomCriteria with properties:
TestResult: [1×1 sltest.testmanager.TestIterationResult]
*sltest_simout: {1x0 cell}*
sltest_testCase: [1×1 sltest.testmanager.TestCase]
sltest_bdroot: {'RollReference_Requirement1_3'}
sltest_sut: {'RollAutopilotMdlRef/Roll Reference'}
sltest_isharness: 1
sltest_iterationName: ''

Best Answer

The "STMCustomCriteria" object for real-time tests has a "TestResult" property, which is a "<https://www.mathworks.com/help/releases/R2018b/sltest/ref/sltest.testmanager.testiterationresult-class.html?s_tid=doc_ta testIterationResult>" object. The simulation output signals can be accesses using the "<https://www.mathworks.com/help/releases/R2018b/sltest/ref/sltest.testmanager.testiterationresult.getoutputruns.html getOutputRuns>" method of this object.

test =

STMCustomCriteria with properties:

  • TestResult: [1×1 sltest.testmanager.TestCaseResult]*
                  sltest_simout: [1×1 Simulink.SimulationOutput]
         sltest_testCase: [1×1 sltest.testmanager.TestCase]
           sltest_bdroot: {'RollReference_Requirement1_3'}
              sltest_sut: {'RollAutopilotMdlRef/Roll Reference'}
        sltest_isharness: 1
    sltest_iterationName: ''
*testResults = test.TestResult;
simOutResult = getOutputRuns(testResults);*