Simulink.SimulationData.LoggingInfo - Signal logging override settings - MATLAB (original) (raw)
Main Content
Signal logging override settings
Description
Use a Simulink.SimulationData.LoggingInfo
object to specify theLoggingInfo
property of aSimulink.SimulationData.SignalLoggingInfo
object. You can use this object to set signal logging override settings such as decimation, logging name, and the number of data points.
Creation
Syntax
Description
logInfoObj = Simulink.SimulationData.LoggingInfo
creates aSimulink.SimulationData.LoggingInfo
object with default property values.
logInfoObj = Simulink.SimulationData.LoggingInfo([logInfo](#mw%5Ffbef8798-46f5-4bd7-b4aa-da74df75b6c9))
creates a Simulink.SimulationData.LoggingInfo
object that copies the property values from the signal logging override object that you specify with thelogInfo
argument.
Input Arguments
Signal logging override setting object whose property values the constructor uses for the new Simulink.SimulationData.LoggingInfo
object, specified as a Simulink.SimulationData.LoggingInfo
object orSimulink.LoggingInfo
object.
Properties
Signal logging mode, specified as a numeric or logical 1
(true
) or 0
(false
).
true
–– Logging is enabled for this signal.false
–– Logging is not enabled for this signal.
Source of signal logging name, specified as a numeric or logical1
(true
) or 0
(false
).
true
— Signal logging name is a custom name.false
— Signal logging name is the same as the signal name.
Custom signal logging name to use for the signal if theNameMode
property is true
, specified as a string or character vector.
Option to log a subset of sample points, specified as a numeric or logical1
(true
) or 0
(false
).
true
— Log a subset of sample points selecting data points at a specified interval. The first sample point is always logged.false
— Log all sample points.
Decimation value (n
), specified as a positive integer. If theDecimateData
property is true
, then the software logs every n
th data point.
Option to limit number of logged data points, specified as a numeric or logical1
(true
) or 0
(false
).
true
— Limit the number of logged data points. The limit is the last number of data points generated by the simulation as specified by theMaxPoints
property.false
— Log all data points.
Maximum number of data points to log (N
), specified as a positive integer. If the LimitDataPoints
property istrue
, then the set of logged data points includes the lastN
data points generated by the simulation.
Examples
You can use a Simulink.SimulationData.LoggingInfo
object to create a set of signal logging override settings for a signal. For example, you can change the decimation settings to log a subset of sample points in a signal.
Open the IterativeCounter
project. The project opens the CounterSystem
model at startup. By default, this model does not decimate data. For more information about this model, see Specify Bus Properties at Component Interfaces.
openProject("IterativeCounter");
You can override signal logging settings so the software logs only a subset of sample points in the BatchData
array by specifying a decimation factor in the LoggingInfo
property of a signal logging override object. First, create a Simulink.SimulationData.LoggingInfo
object with default settings.
logInfo = Simulink.SimulationData.LoggingInfo;
Change the DecimateData
and Decimation
properties to log every tenth data point, starting with the first sample point.
logInfo.DecimateData = true; logInfo.Decimation = 10;
Create a Simulink.SimulationData.SignalLoggingInfo
object for the BatchData
array. Then, to log only the subset of data points in the BatchData
array, set the LoggingInfo
property of the signal logging override object to logInfo
.
blkPath = 'CounterSystem/Concatenate'; sigInfo = Simulink.SimulationData.SignalLoggingInfo(blkPath); sigInfo.LoggingInfo = logInfo;
Create an empty Simulink.SimulationData.ModelLoggingInfo
object. Then, assign the signal logging override settings sigInfo
to the model logging information object.
mdl = 'CounterSystem'; mdlInfo = Simulink.SimulationData.ModelLoggingInfo(mdl); mdlInfo.Signals = sigInfo;
Apply the model override object settings using the set_param
function.
set_param(mdl,DataLoggingOverride=mdlInfo)
Version History
Introduced in R2012b
See Also
Objects
- Simulink.SimulationData.ModelLoggingInfo | Simulink.SimulationData.SignalLoggingInfo | Simulink.BlockPath | Simulink.SimulationData.Signal | Simulink.SimulationData.DataStoreMemory
Functions
- Simulink.SimulationData.ModelLoggingInfo.createFromModel | findSignal | setLogAsSpecifiedInModel | getLogAsSpecifiedInModel | verifySignalAndModelPaths