| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
| On this page… |
|---|
The xPC Target software uses scope objects to represent scopes on the target PC. Use scope object functions to view and collect signal data.
See Function Reference and Functions for a reference of the scope functions.
The xPC Target software 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.
Refer to Target and Scope Objects for a description of how to use these objects, properties, and methods.
A scope object on the host PC represents a scope on the target PC. You use scope objects to observe the signals from your target application during a real-time run or analyze the data after the run is finished.
To create a scope object,
Add an xPC Target scope block to your Simulink model, build the model to create a scope, and then use the target object method getscope to create a scope object.
Use the target object method addscope to create a scope, create a scope object, and assign the scope properties to the scope object.
A scope object has associated properties and methods specific to that object.
To read about scope object types, see Scope Object Types.
You can create scopes of type target, host, or file. Upon creation, The xPC Target software assigns the appropriate scope object data type for the scope type:
xpctarget.xpcsctg for scopes of type target
xpctarget.xpcschost for scopes of type host
xpctarget.xpcfs for scopes of type file
xpctarget.xpcsc encompasses the object properties common to all the scope object data types. The xPC Target software creates this object if you create multiple scopes of different types for one model and combine those scopes, for example, into a scope vector.
Each scope object type has a group of object properties particular to that object type.
The xpcsctg scope object of type target has the following object properties:
The xpcschost scope object of type host has the following object properties:
The xpcfs scope object of type file has the following object properties:
The xpcsc scope object has the following object properties. The other scope objects have these properties in common:
See the scope object function get (scope object) for a description of these object properties.
![]() | Target Objects | Targets and Scopes in the MATLAB Interface | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |