User`s guide
Scope Objects
1-3
Scope Objects
xPC Target uses scope objects to represent scopes on the target PC. Use scope
object functions to view and collect signal data.
See Chapter 14, “Function Reference,” for a reference of the scope functions.
What Is a Scope Object?
xPC Target uses scopes and scope objects as an alternative to using Simulink
®
scopes and external mode. A scope can exist as part of a Simulink model system
or outside a model system.
• A scope that is part of a Simulink model system is a scope block. You add an
xPC Target scope block to the model, build an application from that model,
and download that application to the target PC.
• A scope that is outside a model is not a scope block. For example, if you create
a scope with the
addscope method, that scope is not part of a model system.
You add this scope to the model after the model has been downloaded and
initialized.
This difference affects when and how the scope executes to acquire data.
Scope blocks inherit sample times. A scope block in the root model or a normal
subsystem executes at the sample time of its input signals. A scope block in a
conditionally executed (triggered/enabled) subsystem executes whenever the
containing subsystem executes. Note that in the latter case, the scope might
acquire samples at irregular intervals.
A scope that is not part of a model always executes at the base sample time of
the model. Thus, it might acquire repeated samples. For example, if the model
base sample time is 0.001, and you add to the scope a signal whose sample time
is 0.005, the scope will acquire five identical samples for this signal, and then
the next five identical samples, and so on.
Understanding the structure of scope objects will help you to use the MATLAB
command-line interface to view and collect signal data. The topics in this
section are
Refer to Chapter 1, “Target and Scope Objects,” for a description of how to use
these objects, properties, and methods.