User`s guide
3 Signals and Parameters
3-6
Signal Monitoring with MATLAB
This procedure uses the model xpc_osc3.mdl as an example, and assumes you
created and downloaded the target application to the target PC. It also
assumes that you have assigned
tg to the appropriate target PC.
1 To get a list of signals, type either
set(tg, 'ShowSignals', 'On') or tg.ShowSignals='On'
The latter command causes the MATLAB window to display a list of the
target object properties for the available signals. For example, the signals
for the model
xpc_osc3.mdl are shown below.
ShowSignals = On
Signals = INDEX VALUE BLOCK NAME
0 0.000000 Transfer Fcn
1 0.000000 Signal Generator
2 To get the value of a signal, use the getsignal method. In the MATLAB
Command Window, type
tg.getsignal(1)
where 1 is the signal index. MATLAB displays the value of signal 1.
ans=
3.731
See also “Signal Tracing with MATLAB” on page 3-26.
Monitoring Stateflow States
This procedure uses the model sf_car.mdl as an example. It describes one way
to test-point Stateflow states for monitoring.
1 In the MATLAB window, type
sf_car
2 In the Simulink window, and from the Simulation menu, click
Configuration Parameters.
The Configuration Parameters dialog box is displayed for the model.