Main Content

startRecording

Starts signal data live streaming and File Log logging

Since R2022a

Description

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 Speedgoat® 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 Real-Time Signal Logging and Streaming Basics.

Tip

The startRecording function, stopRecording function, and related buttons are recording controls for streaming to the Simulation Data Inspector and file log. Other types of streaming (such as streaming to apps or to Simulink Real-Time explorer) are not affected by these functions and buttons.

Tip

Because logging and streaming operations are time-intensive and are executed as background tasks on the target computer, start and stop actions do not occur instantly. For example, there is a delay between enabling the log operation and recording the first samples. To avoid missing samples related to an event, start logging data before a trigger event that you are observing.

example

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