Main Content

removeInstrument

Remove selected instrument object from target object

Since R2020b

Description

removeInstrument(target_object,instrument_object) removes the connection to the selected instrument object from the target object.

example

Examples

collapse all

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. Remove the selected instrument object from target object.

tg = slrealtime;
mdlSTF = getSTFName(tg);
mdlName = 'slrt_ex_pendulum_100Hz';
openExample(mdlName);
set_param(mdlName,"SystemTargetFile",mdlSTF);
slbuild(mdlName);
hInst = slrealtime.Instrument('slrt_ex_pendulum_100Hz.mldatx');
hInst.addSignal('slrt_ex_pendulum_100Hz/cartposition',1)
load(tg,mdlName);
addInstrument(tg,hInst);
start(tg);
removeInstrument(tg,hInst);

Input Arguments

collapse all

Provides access to methods that manipulate the target computer properties.

Example: tg

To create the instrument object, use the Instrument function.

Example: hInst

Version History

Introduced in R2020b