User`s guide
3 Signals and Parameters
ThelattercommandcausestheMATLABwindowtodisplayalistofthe
target object properties for the available signals. For example, the signals
for the model
xpc_osc3.mdl are shown below. Note that the Label column
is empty because there are no labelled signals in the mode l. If your signal
has a unique label, its label is displayed in this column. If the label is n ot
unique, the command returns an error. If the signal label is in a referenced
model, the software ignores it.
ShowSignals = on
Signals = INDEX VALUE BLOCK NAME LABEL
0 0.000000 Signal Generator
1 0.000000 Transfer Fcn
2 To get the value of a signal, use the getsignal method. In the MATLAB
Command Window, type
tg.getsignal(0)
where 0 is the signal index. the MATLAB interface displays the value
of signal
1.
ans=
3.731
Note The xPC Target software lists referenced model signals with their full
block path. For example,
xpc_osc5/childmodel/gain.
See also “Signal Tracing with the MATLAB Interface” on page 3-40.
Monitoring Stateflow States
This procedure uses the model old_sf_car.mdl as an example. It describes
one way to set Stateflow states as test points for monitoring.
1 In the MATLAB window, type
old_sf_car
2 In the Simulink window, click Simulation > Configuration Parameters.
3-10