You can configure your file scopes to facilitate data logging. You can configure a file scope whether you added a Scope block to your model or added the scope at run time.
This procedure uses the model
must have already completed the procedure in Create File Scopes with Simulink Real-Time Explorer.
Target execution and scopes must be stopped.
Select Scope 1, and then open the Properties pane ( on the Scopes toolbar).
In the Scope 1 Properties pane, click File.
Enter a name in the File name text
box, for example
File names on the target computer are limited to eight characters in length, not counting the file extension. If the name is longer than eight characters, the software truncates it to six characters and adds '~1' to the end of the file name.
If you enter just the file name, the file appears in folder
To put the file in a folder, create the folder separately using the
target computer command line or MATLAB® language.
A fully qualified file name in the operating system on the
target computer can have a maximum of 260 characters. If the file name is longer than
eight-dot-three format (eight character file name, period, three character extension), the
operating system represents the file name in truncated form (for example, six characters followed
'~1'). MATLAB commands can access the file using the fully qualified file
name or the truncated representation of the name. Some block parameters, such as the Scope block
filename parameter, require 8.3 format for the file
If a file with this name exists when you start the file scope, the file scope overwrites the old data with the new data.
Select File mode
The default File mode is
When real-time execution stops without an error, both the
of the Mode box have the same result. Both settings
cause the model to open a file, write signal data to the file, and
close that file at the end of the session. The differences are in
when the software updates the FAT entry for the file.
Commit mode, the FAT
entry and the actual file size are updated during each file write
Lazy mode, the FAT entry
and the actual file size are updated only when the file is closed
and not during each file write operation.
Lazy mode is faster than
However, if the target computer enters an error state, the system
can stop responding before the file is closed. In
the actual file size can be lost, even though the file was written.
You can lose an amount of data equivalent to the setting of the WriteSize parameter.
To have the file scope collect data up to Number of samples and then start over again reading new data, select the AutoRestart check box.
Leave the Dynamic File Mode check box cleared.
Leave Write Size set to the default
Using a block size that is the same as the disk sector size improves performance.
Leave Max write file size set to the default value, which is a multiple of Write Size.
Start execution ( on the Applications toolbar).
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.
Start Scope 1( on the Scopes toolbar). Let it run for up to a minute.
Stop Scope 1 ( on the Scopes toolbar).
Stop execution ( on the Applications toolbar).
To retrieve the file from the target computer, select the file in the target computer File System pane. Drag it to the MATLAB Current Folder pane or to a Windows® Explorer window.
To rename file
SCOPE2.DAT, right-click the
file name, select Rename, type the new
name in the text box, and then click Enter.
To delete file
SCOPE2.DAT, right-click the
file name and select Delete.