xPC Target    
addscope

Create one or more scopes on the target PC

Syntax

MATLAB command line

Creating a scope and scope object without assigning to a MATLAB variable.

Creating a scope, scope object, and assign to a MATLAB variable.

Target PC command line -- When using this command on the target PC, it is limited to adding a scope of type target.

Arguments

target_object
Name of a target object. The default target name is tg.
scope_type
Values are 'host' or 'target'. This argument is optional with host as the default value.
scope_number
Vector of new scope indices. This argument is optional with the next available integer in the target object property Scopes as the default value.
If you enter a scope index for an existing scope object, the result is an error.

Description

Method of a target object. Creates a scope on the target PC, a scope object on the host PC, and updates the target object property Scopes. This method returns a scope object vector. If the result is not assigned to a variable, the scope object properties are listed in the MATLAB window. If you try to add a scope with the same index as an existing scope, the result is an error.

A scope acquires data from the target application and displays that data on the target PC or uploads the data to the host PC.

All scopes of type target or host run on the target PC.

Scope of type target -- Data collected is displayed on the target screen and acquisition of the next data package is initiated by the kernel.

Scope of type host -- Collects data and waits for a command from the host PC for uploading the data. The data is then displayed using the host scope GUI (xpcscope) or other MATLAB functions.

Examples

Create a scope and scope object sc1 using the method addscope. A target scope is created on the target PC with an index of 1, a scope object is created on the host PC, and it is assigned to the variable sc1. The target object property Scopes is changed from No scopes defined to 1.

Create a scope with the method addscope and then to create a scope object, corresponding to this scope, using the method getscope. A target scope is created on the target PC with an index of 1, a scope object is created on the host PC, but it is not assigned to a variable. The target object property Scopes is changed from No scopes defined to 1.

Create two scopes using a vector of scope objects scvector. Two target scopes are created on the target PC with scope indices of 1 and 2, and two scope objects are created on the host PC that represent the scopes on the target PC. The target object property Scopes is changed from No scopes defined to 1,2.

See Also

The xPC Target target object methods remscope, getscope. The xPC Target GUI function xpcscope. The xPC target M-file demo scripts listed in xPC Target Demos.


  Using the Method Syntax with Target Objects close