Main Content

Specify Signal Values to Log

In some situations, you may not need to log signal values for every time step in a simulation. You can use several strategies to specify which signal data to log during simulation. Depending on your requirements, you can use more than one strategy for limiting the size of logged data. You can specify signal values to log using:

  • Decimation — Log everyn信号值。

  • Limit data points to last — Only log the lastnsignal values.

  • Logging intervals — Specify specific time intervals in which to log data.

Carefully consider data requirements before you reduce the number of signal values logged in a simulation. Limiting data can skip critical time points, and decimation can cause aliasing if the effective sample rate is too low.

Decimation

Decimation reduces the effective sample rate for logged data. To reduce the number of data points logged, specify a decimation factor greater than one. For example, a decimation of factor of2logs every other data point, reducing the number of logged points and effective sample rate by half. How you apply the decimation factor depends on the logged data you want to decimate.

Logging Method How to Specify Decimation
Signal logging

Use the Signal Properties dialog box or the Instrumentation Properties dialog box. SelectDecimationand specify the decimation factor.

访问the Signal Properties dialog, right-click a signal and selectProperties.

访问the Instrumentation Properties dialog, right-click the logging badge for a signal and selectProperties.

The decimation factor applies only to the selected signal. You can specify different decimation factors for different signals.

输出和状态日志

Use theDecimationparameter in the model configuration parameters on theData Import/Exportpane, underAdditional parameters.

The specified decimation factor applies for all logged outputs and states.

Data store logging

To Workspaceblock

To Fileblock

Use theDecimationblock parameter.

The decimation factor applies only to that block.

Log LastnSignal Values

当你只want to save or analyze the data from the end of a simulation, you can configure logging to capture only the lastnsignal values. How you specify the number of data points to log depends on how the data is logged.

Logging Method How to Limit Logging to LastnPoints
Signal logging

Use the Signal Properties dialog box or the Instrumentation Properties dialog box. SelectLimit data points to lastand specify the number of sample values to log.

访问the Signal Properties dialog box, right-click a signal and selectProperties.

访问the Instrumentation Properties dialog box, right-click the logging badge for a signal and selectProperties.

The setting applies only to the selected signal.

输出和状态日志

Select theLimit data points to lastparameter in the model configuration parameters on theData Import/Exportpane, underAdditional parametersand specify the number of signal values to log.

The setting applies for all logged outputs and states.

Data store logging

To Workspaceblock

Use theLimit data points to lastblock parameter.

The setting applies only to that block.

当你只log the last simulation values, dashboard blocks and the Simulation Data Inspector do not display data during simulation.

Specify Logging Intervals

当你只want to save and analyze data for particular time intervals, you can specify the time intervals in which to log data. Using logging intervals allows you to save specific data without changing or adding complexity to your model.

Specify logging intervals using theLogging intervalsparameter on the model configuration parametersData Import/Exportpane, underAdditional parameters. Specify the logging intervals as ann-by-2 matrix wherenis the number of intervals, the number in the first column indicates the start of the logging interval, and the number in the second column indicates the end. For example, when theLogging intervalssetting is specified as(2、4、7、9), logged data is saved between times2and4and again between times7and9.

The specified logging intervals apply to:

  • Time, states, and output logging.

  • Signal logging.

  • Data logged using theTo Workspaceblock.

  • Data logged using theTo Fileblock.

  • Data logged to the workspace using theRecordblock.

Logging intervals do not apply to final state logging, data logged using scopes, or data logged to the Simulation Data Inspector.

When you use logging intervals, dashboard blocks only update the displayed value of a connected signal during the specified logging intervals.

See Also

Model Settings

Blocks

Tools

Related Topics