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:
Host
or Target
.
Numerical
, Graphical redraw
, Graphical sliding
, or Graphical rolling
.
Host
for the Scope Type, then you can only select either Numerical
or Graphical redraw
for the Scope Mode.
0
for both elements, then the scaling is set to auto.
target
, the scope window opens automatically. With a scope of type host
, you need to open the window by typing xpcscope
.
1
) or to collect data at less than every sample time (2
or greater).
FreeRun
, Software Triggering
, Signal Triggering
, or Scope Triggering
.
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.
Your next task is to simulate the model. See Simulating the Model.
Note
As soon as the target application is built and downloaded, the xPC Target kernel creates a scope. If you want to change xPC Target Scope parameters after building the target application or while it is running, you need to assign it to a MATLAB variable. To assign the scope object, use the target object method getscope .Also, if you use the target object method remscope to remove a scope created during the build and download process, and then you restart the target application, the xPC Target kernel recreates the scope.
|
![]() | Adding an xPC Target Scope Block | Simulating the Model | ![]() |