Documentation Center

  • Trial Software
  • Product Updates

Export Signal Data Using Signal Logging

Signal Logging

To capture signal data from a simulation, in most cases use signal logging. Mark the signals that you want to log and enable signal logging for the model. For details, see Configure a Signal for Signal Logging and Enable Signal Logging for a Model.

For a summary of other approaches to capture signal data, see Export Simulation Data.

Signal Logging Workflow

To collect and use signal logging data, perform these tasks.

  1. Mark individual signals for signal logging. See Configure a Signal for Signal Logging.

  2. Enable signal logging for a model. See Enable Signal Logging for a Model.

  3. Simulate the model.

  4. Access the signal logging data. See Access Signal Logging Data.

Log Subsets of Signals

One approach to consider using to test parts of a model as you develop it is to mark a superset of signals for signal logging, and select different subsets of signals to log by overriding signal logging settings. You can use the Signal Logging Selector or a command-line interface. See Override Signal Logging Settings.

Use this approach to log signals in models that use model referencing. See Models with Model Referencing: Overriding Signal Logging Settings.

Additional Signal Logging Options

In conjunction with the basic signal logging workflow, you can specify additional options relating to the data that signal logging collects and to how that data is displayed. You can:

Signal Logging in Rapid Accelerator Mode

Use the Dataset format for signal logging data in Rapid Accelerator mode. Select the format using the Configuration Parameters > Data Import/Export > Signal logging format parameter.

For details, see Specify the Signal Logging Data Format.

Signal logging in Rapid Accelerator mode does not log the following kinds of signals. When you update or simulate a model that contains these signals, Simulink® displays a warning that those signals are not logged.

  • Signals inside Stateflow® charts

  • Signals that use a custom data type

You cannot use signal logging in Rapid Accelerator mode if you set the Configuration Parameters > Solver > Sample time constraint parameter to Ensure sample time independent.

Signal Logging for Array of Buses Signals

Use the Dataset format for logging array of buses signals. Select the format using the Configuration Parameters > Data Import/Export > Signal logging format parameter.

For details, see Specify the Signal Logging Data Format.

Signal Logging Limitations

  • Rapid Accelerator mode supports signal logging, with the requirements and limitations described in Signal Logging in Rapid Accelerator Mode.

  • Top-model software-in-the-loop (SIL) and processor-in-the-loop (PIL) simulation modes support signal logging. For a description of limitations of signal logging using SIL and PIL modes, see Internal Signal Logging Support in the Embedded Coder® documentation.

  • Array of buses signals support signal logging, with the requirements described in Signal Logging for Array of Buses Signals.

  • You cannot log signals in For Each subsystems.

  • You cannot log local data in Stateflow Truth Table blocks.

Was this topic helpful?