xPC Target    

Entering Parameters for an xPC Target Scope Block

xPC Target Scope block parameters define the signals to trace on the scope and trigger modes. When the target application is downloaded to the target PC, the xPC Target kernel automatically creates the scope on the target PC. No additional definitions are necessary.

After you add an xPC Target Scope block to your Simulink model, you can enter parameters for this block. To add an xPC Target Scope block, see Adding an xPC Target Scope Block. This procedure uses the model xpc_osc2.mdl as an example:

  1. In the MATLAB Command Window type
  1. The Simulink block diagram opens for the model xpc_osc2.mdl.

  1. Double-click the block labeled Scope (xPC).
  1. The Block Parameters: Scope(xPC) dialog box opens.

  1. In the Scope Number box, enter a unique number to identify the scope.
  1. This number is used to identify the xPC Target Scope block and the scope screen on the host or target computers.

  1. From the Scope Type list, select either Host or Target.
  2. From the Scope Mode list, select either Numerical, Graphical redraw, Graphical sliding, or Graphical rolling.
  1. If you selected Host for the Scope Type, then you can only select 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 scope of type target, the scope window opens automatically. With a scope of type host, you need to open the window by typing xpcscope.
  4. In the Number of Samples box, enter the number of values to be 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 Trigger Mode list, select either FreeRun, Software Triggering, Signal Triggering, or Scope Triggering.
  1. If you Signal Triggering, then in the Trigger Signal box, enter the index of a signal. In the Trigger Level box, enter a value for the signal to cross before triggering. From the Trigger Slope list, select either rising or falling.

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

    If you want the scope to trigger on a specific sample of the other scope, enter a value in the Sample to trigger on box. The default value is 0 and indicates that the triggering scope and the triggered (current) scope start simultaneously. For more information on this field, see Using the Property TriggerSample to Capture Data in the xPC Target User Guide documentation.

  1. Click OK.
  2. From the File menu, click Save. The model is saved as xpc_osc2.mdl.

Your next task is to simulate the model. See Simulating the Model.


  Adding an xPC Target Scope Block Simulating the Model