You can create a file scope on the target computer using
These scopes have the full capabilities of the Scope block
File mode, but do not persist past the
This procedure uses the model
xpcosc. You must have already completed the
xpcosc. Set property Stop time
inf. On the Real-Time tab, select Run on Target > Stop Time and set Stop Time to
Connect to the target computer. On the Real-Time tab, toggle the Disconnected indicator to Connected.
Build and download the real-time application to the target computer. On the Real-Time tab, click Run on Target.
Open Simulink Real-Time Explorer. On the Real-Time tab, click Prepare > SLRT Explorer.
To configure a file scope:
In the Scopes pane, expand the xpcosc node.
To add a file scope, select File Scopes, and then click the Add Scope button on the toolbar.
Expand Scope 1, and then click the Properties button on the toolbar.
In the Scope Properties pane, click Signals.
Add signals from the Applications Signals workspace.
In the Applications pane, expand both the real-time application node and the node Model Hierarchy.
Select the model node and then click the View Signals button on the toolbar.
In the Signals workspace, to add signal
Generator to Scope1, drag signal
Generator to the Scope1 properties
Integrator1 to Scope
1 in the same way.
In the Scope Properties pane, click File.
Enter a name in the File name text
box, for example
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.
To start execution, click the real-time application and then click the Start button on the 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.
To start Scope 1, click Scope 1 in the Scopes pane, and then click the Start Scope button on the toolbar.
To stop Scope 1, click Scope 1 in the Scopes pane, and then click the Stop Scope button on the toolbar.
For file scopes, before adding or removing signals, stop the scope first.
To stop execution, click the real-time application, and then click the Stop button on the toolbar.
To view the file that you generated, in the Targets pane, expand the target computer and then double-click File System.
C:\. The dialog box looks
like this figure.
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.
You can create a file scope from the list of scope types by clicking Add Scope next to scope type File Scopes.
To rename file
SCOPE1.DAT, right-click the
file name, select Rename, type the new
name in the text box, and then click Enter.
To delete file
SCOPE1.DAT, right-click the
file name and select Delete.
To make both workspaces visible at the same time, drag one workspace tab down until the icon appears in the middle of the dialog box. Continue to drag the workspace until the cursor reaches the required quadrant, and then release the mouse button.
To save your Simulink Real-Time Explorer layout, click File > Save Layout. In a later session, you can click File > Restore Layout to restore your layout.