xPC Target    

Signal Tracing with MATLAB

Creating a scope object allows you to select and view signals using the scope methods. This section describes how to signal trace using xPC Target functions instead of using the xPC Target graphical user interface.

After you create and download the target application, you can view output signals. This procedure uses the Simulink model xpcosc.mdl as an example, and assumes you have build the target application for this model.

  1. Start running your target application. Type either
  1. The target PC displays the following message.

  1. To get a list of signals, type either
  1. or type

    The MATLAB window displays a list of the target objects properties for the available signals. For example, the signals for the model xpcosc.mdl are shown below.

    The signal names (S0, S1 . . .S6) are properties of the target object. For more information, see Signal Monitoring with MATLAB.

  1. Create a scope to display on the target PC. For example, to create a scope with an identifier of 1 and a scope object name of sc1, type
  2. List the properties of the scope object. For example, to list the properties of the scope object sc1, type
  1. The MATLAB window displays a list of the scope object properties. Notice the scope properties StartTime, Time, and Data are not accessible with a scope of type target.

  1. Add signals to the scope object. For example, to add Integrator1 and Signal Generator, type
  1. The target PC displays the following messages.

    After you add signals to a scope object, the signals are not shown on the target screen until you start the scope.

  1. Start the scope. For example, to start the scope sc1, type either
  1. The target screen plots the signals after collecting each data package. During this time you can observe the behavior of the signals while the scope is running.

  1. Stop the scope. Type either
  1. The signals shown on the target PC stop updating while the target application continues running, and the target PC displays the following message.


  Signal Tracing with xPC Target Remote Control Tool Signal Tracing with xPC Target Scope Blocks