User`s guide
6 Target Object Reference
6-16
Getting the Value of a Target Object Property
You can list a property value in the MATLAB window, or assign that value to
a MATLAB variable. With xPC Target you can use either a function syntax or
an object property syntax.
The syntax get(
target_object, property_name) can be replaced by
target_object.propety_name
For example, to access the start time:
1 In the MATLAB window, type
endrun = tg.stoptime
2 Alternately, you could type
endrun = get(tg,’stoptime’) or tg.get(’stoptime’)
Signals are also target object properties. For example, to get the value of the
Integrator1 signal from the model xpcosc:
1 In the MATLAB window, type
outputvalue= tg.S0
2 Alternately, you could type
outputvalue = get(tg, ’s2’) or tg.get(’s2’)
To get a list of readable properties, type
target_object. Without assignment
to a variable, the property values are listed in the MATLAB window.
Note Method names are case-sensitive and need to complete, but property
names are not case-sensitive and need not be complete as long as they are
unique.