get (scope object) - Return property values for scope objects

Syntax

MATLAB® command line

get(scope_object_vector)
get(scope_object_vector, 'scope_object_property')
get(scope_object_vector, scope_object_property_vector)

Arguments

target_object

Name of a target object.

scope_object_vector

Name of a single scope or name of a vector of scope objects.

scope_object_property

Name of a scope object property.

Description

get gets the value of readable scope object properties from a scope object or the same property from each scope object in a vector of scope objects. Scope object properties let you select signals to acquire, set triggering modes, and access signal information from the target application. You can view and change these properties using scope object methods.

The properties for a scope object are listed in the following table. This table includes descriptions of the properties and the properties you can change directly by assigning a value.

Property

Description

Writable

Application

Name of the Simulink® model associated with this scope object.

No

AutoRestart

For scopes of type 'File', enable the file scope to collect data up to the number of samples (NumSamples), then start over again, appending the new data to the end of the signal data file. Clear the AutoRestart check box to have the scope of type 'File' collect data up to Number of samples, then stop.

If the named signal data file already exists when you start the target application, the xPC Target™ software overwrites the old data with the new signal data.

For scopes of type 'Host' or 'Target', this parameter has no effect.

No

Data

Contains the output data for a single data package from a scope.

For scopes of type 'Target' or 'File', this parameter has no effect.

Yes

Decimation

A number n, where every nth sample is acquired in a scope window.

Yes

Filename

Provide a name for the file to contain the signal data. By default, the target PC writes the signal data to a file named C:\data.dat for scope blocks. Note that for scopes of type 'File' created through the MATLAB interface, there is no name initially assigned to FileName. After you start the scope, the xPC Target software assigns a name for the file to acquire the signal data. This name typically consists of the scope object name, ScopeId, and the beginning letters of the first signal added to the scope.

For scopes of type 'Host' or 'Target', this parameter has no effect.

No

Grid

Values are 'on' and 'off'.

For scopes of type 'Host' or 'File', this parameter has no effect.

Yes

Mode

For scopes of type 'Target', indicate how a scope displays the signals. Values are 'Numerical', 'Redraw' (default), 'Sliding', and 'Rolling'.

For scopes of type File, specify when a file allocation table (FAT) entry is updated. Values are 'Lazy' or 'Commit'. Both modes write the signal data to the file. With 'Commit' mode, each file write operation simultaneously updates the FAT entry for the file. This mode is slower, but the file system always knows the actual file size. With 'Lazy' mode, the FAT entry is updated only when the file is closed and not during each file write operation. This mode is faster, but if the system crashes before the file is closed, the file system might not know the actual file size (the file contents, however, will be intact).

For scopes of type Host, this parameter has no effect.

Yes

NumPrePostSamples

For scopes of type 'Host' or 'Target', this parameter is the number of samples collected before or after a trigger event. The default value is 0. Entering a negative value collects samples before the trigger event. Entering a positive value collects samples after the trigger event. If you set TriggerMode to 'FreeRun', this property has no effect on data acquisition.

Yes

NumSamples

Number of contiguous samples captured during the acquisition of a data package. If the scope stops before capturing this number of samples, the scope has the collected data up to the end of data collection, then has zeroes for the remaining uncollected data. Note that you should know what type of data you are collecting, it is possible that your data contains zeroes.

For scopes of type 'File', this parameter works in conjunction with the AutoRestart check box. If the AutoRestart box is selected, the file scope collects data up to Number of Samples, then starts over again, overwriting the buffer. If the AutoRestart box is not selected, the file scope collects data only up to Number of Samples, then stops.

Yes

ScopeId

A numeric index, unique for each scope.

No

Signals

List of signal indices from the target object to display on the scope.

No

StartTime

Time within the total execution time when a scope begins acquiring a data package.

For scopes of type 'Target', this parameter has no effect.

No

Status

Indicate whether data is being acquired, the scope is waiting for a trigger, the scope has been stopped (interrupted), or acquisition is finished. Values are 'Acquiring', 'Ready for being Triggered', 'Interrupted', and 'Finished'.

No

Time

Contains the time data for a single data package from a scope.

No

TriggerLevel

If TriggerMode is 'Signal', indicates the value the signal has to cross to trigger the scope and start acquiring data. The trigger level can be crossed with either a rising or falling signal.

Yes

TriggerMode

Trigger mode for a scope. Valid values are 'FreeRun' (default), 'Software', 'Signal', and 'Scope'.

Yes

TriggerSample

If TriggerMode is 'Scope', then TriggerSample specifies which sample of the triggering scope the current scope should trigger on. For example, if TriggerSample is 0 (default), the current scope triggers on sample 0 (first sample acquired) of the triggering scope. This means that the two scopes will be perfectly synchronized. If TriggerSample is 1, the first sample (sample 0) of the current scope will be at the same instant as sample number 1 (second sample in the acquisition cycle) of the triggering scope.

As a special case, setting TriggerSample to -1 means that the current scope is triggered at the end of the acquisition cycle of the triggering scope. Thus, the first sample of the triggering scope is acquired one sample after the last sample of the triggering scope.

Yes

TriggerScope

If TriggerMode is 'Scope', identifies the scope to use for a trigger. A scope can be set to trigger when another scope is triggered. You do this by setting the slave scope property TriggerScope to the scope index of the master scope.

Yes

TriggerSignal

If TriggerMode is 'Signal', identifies the block output signal to use for triggering the scope. You identify the signal with a signal index from the target object property Signal.

Yes

TriggerSlope

If TriggerMode is 'Signal', indicates whether the trigger is on a rising or falling signal. Values are 'Either' (default), 'Rising', and 'Falling'.

Yes

Type

Determines whether the scope is displayed on the host computer or on the target computer. Values are 'Host', 'Target', and 'File'.

No

WriteSize

Enter the block size, in bytes, of the data chunks. This parameter specifies that a memory buffer, of length number of samples (NumSamples), collect data in multiples of WriteSize. By default, this parameter is 512 bytes, which is the typical disk sector size. Using a block size that is the same as the disk sector size provides optimal performance.

If you experience a system crash, you can expect to lose an amount of data the size of WriteSize.

For scopes of type 'Host' or 'Target', this parameter has no effect.

Yes

YLimit

Minimum and maximum y-axis values. This property can be set to 'auto'.

For scopes of type 'Host' or 'File', this parameter has no effect.

Yes

Examples

List all the readable properties, along with their current values. This is given in the form of a structure whose field names are the property names and whose field values are property values.

get(sc)

List the value for the scope object property Type. Notice that the property name is a string, in quotation marks, and is not case sensitive.

get(sc,'type')
ans = Target

See Also

The xPC Target scope object method set (scope object).

The target object methods set (target application object).

The built-in MATLAB functions get and set.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS