Main Content

Enable File Log

Enable or disable file logging of signals on target computer

  • Enable File Log block

Libraries:
Simulink Real-Time / Logging

Description

The Enable File Log block enables the file logging service on the Speedgoat® target computer so that File Log blocks in the model start recording data when the input port value is true. When the input port value is false, the block disables file logging on the target computer, and the File Log blocks do not record data.

The Enable File Log block creates a separate log file on the target computer each time the enable control signal is enabled. If the enable control signal is disabled at the start of simulation, the block creates an empty log file on the target computer.

If a model includes an Enable File Log block, the startRecording function and stopRecording function only control signal streaming, not File Log logging. In this case, the AutoImportFileLog option does not import data into the Simulation Data Inspector when you use the stopRecording function or click the Stop Recording button.

When the AutoImportFileLog option is enabled, only the last completed file log is auto imported at simulation stop. You can import the completed file logs manually; even while the simulation is running and even while writing to a new log file.

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

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.

Examples

Ports

Input

expand all

Provides enable or disable control over File Log block operation. When the enable input is triggered by a boolean signal in the model, there are logs created on the target computer. Retention of these logs depends on the FileLogMaxRuns setting.

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2020b