You can acquire signal data into a file on the target computer. To do so, you can include a real-time file scope in your Simulink® Real-Time™ model. Alternatively, after you build the real-time application and download it to the target computer, you can add a file scope to that application.
For example, to add a file scope named
the real-time application, and to add signal
In the MATLAB® window, type:
tg = slrt; sc = addscope(tg, 'file')
The Simulink Real-Time software creates a file scope for the real-time application.
To add signal
Before starting the scope, copy previously acquired data to the development computer. When the file scope starts, the software overwrites previously acquired data in files of the specified name or name pattern. A partially overwritten file or a file that is opened but left unwritten loses its original contents.
To start the scope, type:
To start the real-time application, type:
Real-Time software adds signal 4 to the file scope.
When you start the scope and the real-time application, the scope
saves the signal data for signal 4 to a file, by default named
For more information on file scopes, see Configure Real-Time File Scope Blocks.
To retrieve the file programmatically from the target computer for analysis, see Using SimulinkRealTime.fileSystem Objects.
To acquire signal data into multiple files, see Acquire Signal Data into Dynamically Named Files.