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.
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.
ShowSignals = On Signals = PROP. VALUE BLOCK NAME S0 0.000000 Integrator1 S1 0.000000 Signal Generator S2 0.000000 Gain S3 0.000000 Integrator S4 0.000000 Gain1 S5 0.000000 Gain2 S6 0.000000 Sum
The signal names (S0, S1 . . .S6) are properties of the target object. For more information, see Signal Monitoring with MATLAB.
1
and a scope object name of sc1
, type
sc1
, type
StartTime
, Time
, and Data
are not accessible with a scope of type target.
xPC Scope Object Application = xpcosc ScopeId = 1 Status = Interrupted Type = Target NumSamples = 250 Decimation = 1 TriggerMode = FreeRun TriggerSignal = -1 TriggerSample = -1 TriggerLevel = 0 TriggerSlope = Either TriggerScope = 1 Mode = Redraw (Graphical) YLimit = Auto Grid = On StartTime = Not accessible Data = Not accessible Time = Not accessible Signals = no Signals defined
After you add signals to a scope object, the signals are not shown on the target screen until you start the scope.
![]() | Signal Tracing with xPC Target Remote Control Tool | Signal Tracing with xPC Target Scope Blocks | ![]() |