This procedure uses the model
open_system(docpath(fullfile(docroot, 'toolbox', 'xpc', 'examples', 'ex_slrt_rt_osc')))).
You must have already completed the setup in Prepare Real-Time Application by Using MATLAB Language.
Signal access by signal index will be removed in a future release. Access signals by signal name instead.
Real-Time™ software lists referenced model
signals with their full block path. For example,
tg.ShowSignals = 'on'
Target: TargetPC1 Connected = Yes Application = xpcosc . . . Scopes = 1 NumSignals = 7 ShowSignals = on Signals = INDEX VALUE Type BLOCK NAME LABEL 0 0.000000 DOUBLE Gain 1 0.000000 DOUBLE Gain1 2 0.000000 DOUBLE Gain2 3 0.000000 DOUBLE Integrator 4 0.000000 DOUBLE Integrator1 5 0.000000 DOUBLE Signal Generator 6 0.000000 DOUBLE Sum . . .
If your signal has a unique label, its label is displayed in
Label column. If the label is not unique, the
command returns an error.
To get the value of a signal, use the
In the Command Window, type:
ans = -3.8771