xPC Target    

Defining xPC Target Scope Block Parameters

Scope block parameters define the signals to trace on the scope, trigger modes, and the axis range.

This procedure uses the Simulink model xpcosc.mdl as an example, and assumes you have added an xPC Target scope block to your model. To add a scope block, see Adding xPC Target Scope Blocks.

  1. Double-click the scope block labeled Scope (xPC).

    The Block Parameters dialog box for the scope block opens.

  1. In the Scope Number box, enter a unique number to identify the scope. This number is used to identify the xPC Target scope block and the scope screen on the host or target computers.
  2. From the Scope Type list, choose either Host or Target.
  3. From the Scope Mode list, choose either Numerical, Graphical (redraw), Graphical (sliding), or Graphical (rolling).

    If you selected Host for the Scope Type, then you can only choose either Numerical or Graphical (redraw) for the Scope Mode.

  1. Select the Grid check box to display grid lines on the scope.
  2. In the Y-axis Limits box, enter a row vector with two elements where the first element is the lower limit of the y-axis and the second element is the upper limit. If you enter 0 for both elements, then the scaling is set to auto.
  3. Select the Start Scope after download check box, to start a scope when the target application is downloaded. With a target scope, the scope window open automatically. With a host scope, you need to open the window by typing xpcscope.
  4. In the Number of Samples box, enter the number of values acquired in a data package before redrawing the graph. In the Interleave box, enter a value to collect data at each sample time (1) or to collect data at less than every sample time (2 or greater).
  5. From the Target Mode list, choose either FreeRun, Software Trigger, Signal Trigger, or Scope Trigger.

    If you selected Signal Trigger, then in the Trigger Signal box, enter the index of a signal. In the Trigger Level text box, enter a value for the signal to cross before triggering. And from the Trigger Slope list choose either, rising, or falling.

    If you choose Scope Trigger, then in the Trigger Scope Number box, enter the block number of a scope block. If you use this feature, you must also add a second scope block to your Simulink model.

  1. Click OK.

Your next task is to build and run the target application. As soon as the target application is built and downloaded, a scope and scope object are automatically created. However, the scope object is not assigned to a MATLAB variable.


 Adding xPC Target Scope Blocks Target PC Command Line Interface