| xPC Target™ | ![]() |
MATLAB® command line
set(target_object)
set(target_object, 'property_name1', 'property_value1',
'property_name2', 'property_value2', . . .)
target_object.set('property_name1', 'property_value1')
set(target_object, property_name_vector,
property_value_vector)
target_object.property_name = property_valueTarget PC command line - Commands are limited to the target object properties stoptime, sampletime, and parameters.
parameter_name = parameter_value stoptime = floating_point_number sampletime = floating_point_number
target_object | Name of a target object. |
'property_name' | Name of a target object property. Always use quotation marks. |
property_value | Value for a target object property. Always use quotation marks for character strings; quotation marks are optional for numbers. |
set sets the properties of the target object. Not all properties are user writable.
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 writable properties for a target object are listed in the following table. This table includes a description of the properties:
Property | Description | Writable |
|---|---|---|
LogMode | Controls which data points are logged:
| Yes |
SampleTime | Time between samples. This value equals the step size, in seconds, for updating the model equations and posting the outputs. See User Interaction in the xPC Target™ Getting Started Guide for limitations on target property changes to sample times. | Yes |
ShowParameters | Flag set to view or hide the list of parameters from your Simulink® blocks. This list is shown when you display the properties for a target object. Values are 'on' and 'off'. | Yes |
Flag set to view or hide the list of signals from your Simulink blocks. This list is shown when you display the properties for a target object. Values are 'on' and 'off'. | Yes | |
StopTime | Time when the target application stops running. Values are in seconds. The original value is set in the Simulation menu Configuration Parameters dialog. When the ExecTime reaches the StopTime, the application stops running. | Yes |
ViewMode | Display either all scopes or a single scope on the target PC. Value is 'all' or a single scope index. This property is active only if the environment property TargetScope is set to enabled. | Yes |
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 value of the properties after the indicated settings have been made.
Get a list of writable properties for a scope object.
set(tg)
ans =
StopTime: {}
SampleTime: {}
ViewMode: {}
LogMode: {}
ShowParameters: {}
ShowSignals: {}Change the property ShowSignals to on.
tg.set('showsignals', 'on') or set(tg, 'showsignals', 'on')As an alternative to the method set, use the target object property ShowSignals. In the MATLAB window, type
tg.showsignals ='on'
xPC Target™ target object method get (target application object).
Scope object methods get (scope object) and set (scope object).
Built-in MATLAB functions get and set.
xPC Target M-file demo scripts listed in xPC Target™ Demos.
![]() | set (scope object) | setparam | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |