xPC Target    

Signal Logging with xPC Target Graphical Interface

Exporting data with the xPC Target scope window does not require you to add outport blocks to your Simulink model and activate the logging of signals. You can select which signals to collect, and you can capture unexpected outputs during a run.

This procedure uses a scope window as a graphical interface to move data from the last data package collected to the MATLAB workspace. For information on exporting data using outport blocks, a scope object and the properties Data and Time, see Chapter 8, Scope Object Reference..

After you complete a run with a scope, you can move data from the last data package collected to the MATLAB workspace. This procedure uses the Simulink model xpcosc.mdl as an example, and assumes you have completed a run with the target application.

  1. In the xPC Target Scope window, and from the Plot menu, click Variable Name for Export.

    The Variable Name for Export dialog box opens.

  1. In the Data and Time text boxes, enter the name of the MATLAB variables to contain the data from the scope data package. Click the Apply button, and then click the Close button.

    The default name for the time vector is scopen_time, and the default name for the signal vector is scopen_data where n is the scope number.

  1. In the Scope window, click the Export button. You can export data regardless of whether a scope is started or stopped.
  2. In the MATLAB window, type

    MATLAB displays a list of variables and their description. For example

    You can now save or further analyze the data using the MATLAB variables.

  1. Type

    MATLAB plots the variables scope1_time and scope1_data in a new widnow


 Signal Logging Signal Logging with MATLAB Commands