Add instrument object to target object
adds an instrument object to the target object. Make sure that you add a signal to the
instrument object before you add the instrument to the target object or no signal is
addInstrument() function binds the instrument to a
real-time application, Simulink®
Real-Time™ validates the signal names in the instrument. To reduce the time it takes to
validate an instrument, add the instrument once to the target computer and run the real-time
application as many times as needed. The instrument remains added to the target computer
even after the real-time application stops and is reloaded.
Alternatively, you can add the instrument each time the real-time application runs. If
using this approach, remove the instrument when the real-time application closes. For
example, if adding code to an App Designer app, in the
you could add a
adds an instrument object to the target object and updates the target connection, even if
the real-time application is running. Make sure that you add a signal to the instrument
object before you add the instrument to the target object or no signal is streamed.
Create a target object. Build the real-time application. Create the instrument object. Add a signal to the instrument object. Load the real-time application. Add an instrument object to the target object. Start real-time application.
tg = slrealtime('TargetPC1'); slbuild('slrt_ex_tank'); hInst = slrealtime.Instrument('slrt_ex_tank'); hInst.addSignal('slrt_ex_tank/Controller',1) load(tg,'slrt_ex_tank'); addInstrument(tg,hInst); start(tg);