addDataStoreSignal
Class: sltest.testmanager.LoggedSignalSet
Package: sltest.testmanager
Syntax
obj = addDataStoreSignal(lgset,BlockPath)
Description
obj = addDataStoreSignal(
creates and adds an lgset
,BlockPath
)sltest.testmanager.LoggedSignal
object to a set when
the LoggedSignal
object derives from a data store or
Simulink.Signal
object. You must open or load the model to add a
LoggedSignal
from the model.
Input Arguments
lgset
— Logged signal set
sltest.testmanager.LoggedSignalSet
object
Logged signal set object contained in a test case.
BlockPath
— Block path object
Simulink.BlockPath
object
Simulink.BlockPath
object that uniquely identifies a Data Store Write
block and the associated data store memory or associated Simulink.Signal
object.
Examples
Add a Global Data Store to a Signal Set
Open the models for this example.
sldemo_mdlref_dsm sldemo_mdlref_dsm_bot2
Create the test file, test suite and test case structure.
tf = sltest.testmanager.TestFile('mytf'); ts = sltest.testmanager.TestSuite(tf,'myts'); tc = sltest.testmanager.TestCase(ts,'baseline','mytc');
Create a signal set.
mylgset = addLoggedSignalSet(tc);
Identify the global data store paths for these model components. To programmatically determine the path, select each component individually and in the MATLAB command window, enter gcb
:
Select Model block
sldemo_mdlref_dsm_bot2
In
sldemo_mdlref_dsm_bot2
, select the Data Store Write block.
Use the returned paths to create a Simulink.BlockPath
object for the global data store.
bPath = Simulink.BlockPath({'sldemo_mdlref_dsm/A1',... 'sldemo_mdlref_dsm_bot2/DSW'}); sig1 = mylgset.addDataStoreSignal(bPath); sigs = mylgset.getLoggedSignals
sigs = LoggedSignal with properties: Name: 'ErrorCond' Source: 'base workspace' PortIndex: 0 Active: 1 PlotIndices: []
Add Local Data Store Memory to a Signal Set
Open the model for this example.
sldemo_mdlref_dsm sldemo_mdlref_dsm_bot
Create the test file, test suite and test case structure.
tf = sltest.testmanager.TestFile('myTestfile'); ts = sltest.testmanager.TestSuite(tf,'myts'); tc = sltest.testmanager.TestCase(ts,'baseline','mytc');
Create a signal set.
mylgset = addLoggedSignalSet(tc);
Identify the global data store paths for these model components. To programmatically determine the path, select each component individually and in the MATLAB Command Window, enter gcb
:
Select Model block in
sldemo_mdlref_dsm_bot
In
sldemo_mdlref_dsm_bot
, select thePositiveSS
subsystemIn subsystem
PositiveSS
, select the Data Store Write block
Use the returned paths to create a Simulink.BlockPath
object for the local data store.
bPath = Simulink.BlockPath({'sldemo_mdlref_dsm/A',... 'sldemo_mdlref_dsm_bot/PositiveSS',... 'sldemo_mdlref_dsm_bot/PositiveSS/DSW'}); sig2 = mylgset.addDataStoreSignal(bPath); sigs = mylgset.getLoggedSignals
sigs = LoggedSignal with properties: Name: 'RefSignalVal' Source: 'sldemo_mdlref_dsm/A/PositiveSS/DSM' PortIndex: 0 Active: 1 PlotIndices: []
Version History
Introduced in R2019a
Open Example
You have a modified version of this example. Do you want to open this example with your edits?
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)