Main Content

startRecording

Starts signal data live streaming and File Log logging

Since R2022a

Description

example

startRecording(target_object) starts a simulation run in the Simulation Data Inspector, enables signal data live streaming, and enables signal data File Log logging. Every time that signal logging and streaming is enabled by using the startRecording function, Start Recording button, or enabling the Enable File Log block creates a log run on the target computer.

When a model includes an Enable File Log block, the startRecording function and stopRecording function only control signal streaming and do not control file logging. For such a model, the AutoImportFileLog option does not import file log data into the Simulation Data Inspector on a stopRecording.

When a boolean signal in the model triggers the Enable File Log block, new Logs are created on the target. Retention of these new logs depends on the FileLogMaxRuns setting.

For more information about the file logging workflow, see Signal Logging and Streaming Basics.

Examples

collapse all

Use the startRecording function to start recording on the target computer. You also can use the Start Recording button on the Real-Time tab in the Simulink Editor or in the Simulink Real-Time Explorer.

tg = slrealtime;
load(tg,'slrt_ex_osc')
start(tg);
stopRecording(tg);
startRecording(tg);

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

Version History

Introduced in R2022a

expand all