Simulink.SimulationData.LoggingInfo

Signal logging override settings

Description

This object specifies a set of signal logging override settings.

Use a Simulink.SimulationData.LoggingInfo object to specify the signal logging override settings for a signal. You can use this object for the LoggingInfo property of a Simulink.SimulationData.SignalLoggingInfo object.

Property Summary

Name

Description

DataLogging

Signal logging mode.

NameMode

Source of signal logging name.

LoggingName

Custom signal logging name.

DecimateData

Use subset of sample points.

Decimation

Decimation value (n): Simulink® logs every nth data point.

LimitDataPoints

Limit number of data points to log.

MaxPoints

Maximum number of data points to log (N). The set of logged data points is the last N data points generated by the simulation.

Method Summary

Name

Description

LoggingInfo

Create a set of signal logging override settings for a signal.

Properties

DataLogging

Description

Signal logging mode.

Indicates whether logging is enabled for this signal.

Data Type

logical value — {true} | false

Access

RW

NameMode

Description

Source of signal logging name.

Indicates whether the signal logging name is a custom name ('true') or whether the signal logging name is the same as the signal name ('false').

Data Type

logical value — true | {false}

Access

RW

LoggingName

Description

Custom signal logging name

The custom signal logging name to use for this signal, if the NameMode property is true.

Data Type

character vector

Access

RW

DecimateData

Description

Log a subset of sample points, selecting data points at a specified interval. The first sample point is always logged.

Data Type

logical value — true | {false}

Access

RW

Decimation

Description

Decimation value (n). If the DecimateData property is true, then Simulink logs every nth data point.

Data Type

positive integer

Access

RW

LimitDataPoints

Description

Limit the number of data points to log.

Data Type

logical value — true | {false}

Access

RW

MaxPoints

Description

Maximum number of data points to log (N). If the LimitDataPoints property is true, then the set of logged data points includes the last N data points generated by the simulation.

Data Type

positive integer

Access

RW

Methods

LoggingInfo

Purpose

Create a Simulink.SimulationData.LoggingInfo object.

Syntax

logging_info_object = Simulink.SimulationData.LoggingInfo()
logging_info_object = Simulink.SimulationData.LoggingInfo(object)

Input Arguments

object

A signal logging override settings object whose property values the constructor uses for the new Simulink.SimulationData.LoggingInfo object. The signal logging override object that you specify must be one of the following types of objects:

  • Simulink.SimulationData.LoggingInfo object

  • Simulink.LoggingInfo object

Output Arguments

logging_info_object

A Simulink.SimulationData.LoggingInfo object.

Description

logging_info_object = Simulink.SimulationData.LoggingInfo() creates a Simulink.SimulationData.LoggingInfo object that has default property values.

logging_info_object = Simulink.SimulationData.LoggingInfo(object) creates a Simulink.SimulationData.LoggingInfo object that copies the property values from the signal logging override object that you specify with the object argument.

Examples

The following example creates a Simulink.SimulationData.LoggingInfo object with default settings, changes the DecimateData and Decimation properties, and uses the object for the LoggingInfo property of a Simulink.SimulationData.SignalLoggingInfo object mi.

open_system(docpath(fullfile(docroot, 'toolbox', 'simulink', 'examples', 'ex_mdlref_counter_bus')));
open_system(docpath(fullfile(docroot, 'toolbox', 'simulink', 'examples', 'ex_bus_logging')));
log_info = Simulink.SimulationData.LoggingInfo();
log_info.DecimateData = true;
log_info.Decimation = 2;
mi = Simulink.SimulationData.SignalLoggingInfo('ex_bus_logging');
mi.LoggingInfo = log_info
Simulink.SimulationData.SignalLoggingInfo
  Package: Simulink.SimulationData

  BlockPath:
    'ex_bus_logging'

  OutputPortIndex: 1

  LoggingInfo:
        DataLogging: 1
           NameMode: 0
        LoggingName: ''
       DecimateData: 1
         Decimation: 2
    LimitDataPoints: 0
          MaxPoints: 5000

Introduced in R2012b