| xPC Target™ | ![]() |
MATLAB® command line
set(scope_object_vector)
set(scope_object_vector, property_name1, property_value1,
property_name2, property_value2, . . .)
scope_object_vector.set('property_name1', property_value1,
..)
set(scope_object, 'property_name', property_value, . . .) scope_object | Name of a scope object or a vector of scope objects. |
'property_name' | Name of a scope object property. Always use quotation marks. |
property_value | Value for a scope object property. Always use quotation marks for character strings; quotation marks are optional for numbers. |
Method for scope objects. Sets the properties of the scope object. Not all properties are user writable. 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.
Properties must be entered in pairs or, using the alternate syntax, as one-dimensional cell arrays of the same size. This means they must both be row vectors or both column vectors, and the corresponding values for properties in property_name_vector are stored in property_value_vector.
The function set typically does not return a value. However, if called with an explicit return argument, for example, a = set(target_object, property_name, property_value), it returns the values of the properties after the indicated settings have been made.
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 |
|---|---|---|
Name of the Simulink® model associated with this scope object. | No | |
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 software overwrites the old data with the new signal data. For scopes of type 'Host' or 'Target', this parameter has no effect. | No | |
Contains the output data for a single data package from a scope. For scopes of type 'Target' or 'File', this parameter has no effect. | No | |
A number n, where every nth sample is acquired in a scope window. | Yes | |
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 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 | |
Values are 'on' and 'off'. For scopes of type 'Host' or 'File', this parameter has no effect. | Yes | |
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 | |
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 | |
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 | |
A numeric index, unique for each scope. | No | |
List of signal indices from the target object to display on the scope. | Yes | |
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 | |
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 | |
Contains the time data for a single data package from a scope. | No | |
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 | |
Trigger mode for a scope. Valid values are 'FreeRun' (default), 'Software', 'Signal', and 'Scope'. | Yes | |
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 | |
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 | |
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 | |
If TriggerMode is 'Signal', indicates whether the trigger is on a rising or falling signal. Values are 'Either' (default), 'Rising', and 'Falling'. | Yes | |
Determines whether the scope is displayed on the host computer or on the target computer. Values are 'Host', 'Target', and 'File'. | Yes | |
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 | |
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 |
Get a list of writable properties for a scope object.
sc1 = getscope(tg,1)
set(sc1)
ans=
NumSamples: {}
Decimation: {}
TriggerMode: {5x1 cell}
TriggerSignal: {}
TriggerLevel: {}
TriggerSlope: {4x1 cell}
TriggerScope: {}
TriggerSample: {}
Signals: {}
NumPrePostSamples: {}
Mode: {5x1 cell}
YLimit: {}
Grid: {} The property value for the scope object sc1 is changed to on:
sc1.set('grid', 'on') or set(sc1, 'grid', 'on')The xPC Target™ scope object method get (scope object). The target object methods set (target application object) and get (target application object). The built-in MATLAB functions get and set.
![]() | set (env object) | set (target application object) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |