Main Content

Stateflow.SigLoggingInfo

Signal logging properties for states and data

    Description

    Use a Stateflow.SigLoggingInfo object to specify the signal logging properties for a state or data object. For more information, see Log Simulation Output for States and Data.

    Creation

    Each state, atomic subchart, Simulink® based state, and data object has its own Stateflow.SigLoggingInfo object. To access the Stateflow.SigLoggingInfo object, use the LoggingInfo property for the Stateflow.State, Stateflow.AtomicSubchart, Stateflow.SimulinkBasedState, or Stateflow.Data object.

    Properties

    expand all

    Stateflow® API objects have properties that correspond to the values you set in the Stateflow Editor. To access or modify a property, use dot notation. To access or modify multiple properties for multiple API objects, use the get and set functions, respectively. For more information, see Modify Properties and Call Functions of Stateflow Objects.

    Whether to enable signal logging for the state or data object, specified as a numeric or logical 1 (true) or 0 (false).

    Whether to limit the amount of logged data, specified as a numeric or logical 1 (true) or 0 (false). When this property is true, signal logging skips samples by using the interval size specified by the Decimation property. For more information, see Decimation.

    Decimation interval, specified as an integer scalar. This property applies only when the DecimateData property is true. The default value of 2 means that the chart logs every other sample.

    Whether to limit the number of data points to log, specified as a numeric or logical 1 (true) or 0 (false). When this property is true, signal logging limits the number of data points by using the value specified by the MaxPoints property. For more information, see Limit Data Points to Last.

    Maximum number of data points to log, specified as an integer scalar. This property applies only when the LimitDataPoints property is true. The default value of 5000 means the chart logs the last 5000 data points generated by the simulation.

    Source of the signal name used to log the state or data object, specified as one of these values:

    • 'SignalName' — Use the name of the state or data object.

    • 'Custom' — Use the custom signal name specified by the LoggingName property.

    For more information, see Logging Name.

    Custom signal name for the state or data object, specified as a character vector. This property applies only when the NameMode property is 'Custom'.

    Examples

    collapse all

    Access the SigLoggingInfo object for the Stateflow.Data object x.

    log = x.LoggingInfo;

    Enable logging for the data object and specify a custom signal name.

    log.DataLogging = true;
    log.NameMode = 'Custom';
    log.LoggingName = 'My Data';
    Introduced before R2006a