Documentation

SimulinkRealTime.target.getscope

Return scope identified by scope number

Syntax

scope_object_vector = getscope(target_object)
scope_object = getscope(target_object, scope_number)
scope_object_vector = getscope(target_object, scope_number_vector)

Description

example

scope_object_vector = getscope(target_object) returns a vector containing objects representing all of the existing scopes on the target computer.

example

scope_object = getscope(target_object, scope_number) returns the object representing an existing scope that has the given scope number.

example

scope_object_vector = getscope(target_object, scope_number_vector) returns a vector containing objects representing existing scopes that have the given scope numbers.

If you try to get a nonexistent scope, the result is an error.

Examples

collapse all

To view the properties of all scopes on the target, get a vector of scope objects.

Get all scopes on the target computer.

tg = slrt;
scope_object_vector = getscope(tg)
scope_object_vector = 

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 1
   Status               = Interrupted
   Type                 = Target
   NumSamples           = 500
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = 5  : Signal Generator
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 1
   TriggerSample        = 0
   DisplayMode          = Redraw (Graphical)
   YLimit               = Auto
   Grid                 = on
   Signals              = 5  : Signal Generator
                          6  : Sum

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 2
   Status               = Interrupted
   Type                 = Target
   NumSamples           = 250
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = 0  : Gain
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 2
   TriggerSample        = 0
   DisplayMode          = Redraw (Graphical)
   YLimit               = Auto
   Grid                 = on
   Signals              = 0  : Gain
                          1  : Gain1
                          2  : Gain2

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 3
   Status               = Interrupted
   Type                 = Host
   NumSamples           = 250
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = -1 
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 3
   TriggerSample        = 0
   StartTime            = -1.000000
   Data                 = Matrix (250 x 0)
   Time                 = Matrix (250 x 1)
   Signals              = no Signals defined

To change the number of samples, get a scope object, and then change the scope object property NumSamples.

Get a scope object for scope 1.

tg = slrt;
scope_object = getscope(tg,1)
scope_object = 

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 1
   Status               = Interrupted
   Type                 = Target
   NumSamples           = 250
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = 5  : Signal Generator
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 1
   TriggerSample        = 0
   DisplayMode          = Redraw (Graphical)
   YLimit               = Auto
   Grid                 = on
   Signals              = 5  : Signal Generator
                          6  : Sum

Update property NumSamples.

scope_object.NumSamples = 500
scope_object = 

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 1
   Status               = Interrupted
   Type                 = Target
   NumSamples           = 500
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = 5  : Signal Generator
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 1
   TriggerSample        = 0
   DisplayMode          = Redraw (Graphical)
   YLimit               = Auto
   Grid                 = on
   Signals              = 5  : Signal Generator
                          6  : Sum

To view the properties of scopes 1 and 2 on the target computer, get a vector of scope objects.

tg = slrt;
scope_object_vector = getscope(tg, [1,2])
scope_object_vector = 

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 1
   Status               = Interrupted
   Type                 = Target
   NumSamples           = 500
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = 5  : Signal Generator
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 1
   TriggerSample        = 0
   DisplayMode          = Redraw (Graphical)
   YLimit               = Auto
   Grid                 = on
   Signals              = 5  : Signal Generator
                          6  : Sum

Simulink Real-Time Scope
   Application          = xpcosc
   ScopeId              = 2
   Status               = Interrupted
   Type                 = Target
   NumSamples           = 250
   NumPrePostSamples    = 0
   Decimation           = 1
   TriggerMode          = FreeRun
   TriggerSignal        = 0  : Gain
   TriggerLevel         = 0.000000
   TriggerSlope         = Either
   TriggerScope         = 2
   TriggerSample        = 0
   DisplayMode          = Redraw (Graphical)
   YLimit               = Auto
   Grid                 = on
   Signals              = 0  : Gain
                          1  : Gain1
                          2  : Gain2

Input Arguments

collapse all

Object that represents the target computer. Before calling this function, make sure that you start the target computer with the Simulink® Real-Time™ kernel and apply the required Ethernet link settings.

Example: tg

New scope number. This argument is optional. The default value is the next available integer in the target object property Scopes.

If you enter the scope number for an existing scope object, the result is an error.

Example: 1

Vector of new scope numbers. If you enter the scope number for an existing scope object, the result is an error.

Example: [2, 3]

Output Arguments

collapse all

Object representing an existing scope

Vector containing objects representing an existing scope

Introduced in R2014a

Was this topic helpful?