Main Content

getLoggedSignals

Class: sltest.testmanager.LoggedSignalSet
Namespace: sltest.testmanager

Return logged signals contained in a set

Description

objs = getLoggedSignals(lgset) returns a vector of the sltest.testmanager.LoggedSignal objects contained in an sltest.testmanager.LoggedSignalSet object.

example

Input Arguments

expand all

Logged signal set object contained in a test case.

Examples

expand all

Open the model for this example.

openExample("sldemo_absbrake")

Create test file, test suite, and test case structure. Specify the model to use with the test case.

tf = sltest.testmanager.TestFile("rmSigs_testfile");
ts = sltest.testmanager.TestSuite(tf,"mSigs_testsuite");
tc = sltest.testmanager.TestCase(ts,baseline="rmsigs_testcase");

setProperty(tc,Model="sldemo_absbrake");

Create a signal set.

lgset = addLoggedSignalSet(tc);

Open the Vehicle Dynamics block and then the Vehicle block. Select the Vehicle Speed block. Then, enter gcb to obtain the full block path. Use the returned path to create a Simulink.BlockPath object. Then, add signals to the signal set.

blkpath=["sldemo_absbrake/" + ...
    "Vehicle Dynamics/Vehicle  /Vehicle Speed"];
bPath = Simulink.BlockPath(blkpath);

sig1 = lgset.addLoggedSignal(bPath,1);
sig2 = lgset.addLoggedSignal(bPath,2);

Remove the signal and check that the signal has been removed.

remove(sig2);
sigs = lgset.getLoggedSignals
sigs = 
  LoggedSignal with properties:

           Name: 'Vehicle Velocity'
         Source: 'sldemo_absbrake/Vehicle Dynamics/Vehicle  /Vehicle Speed'
      PortIndex: 1
         Active: 1
    PlotIndices: []

Version History

Introduced in R2019a