メインコンテンツ

addForSDI

Add an instrument to a target object for data in the Simulation Data Inspector

Since R2026a

Description

addForSDI(target_object.Instruments,instrument_object) adds an instrument to a Target object for data in the Simulation Data Inspector.

example

Examples

collapse all

When you add instruments to Target objects for data in the Simulation Data Inspector, the signal data from the instruments is added to the Simulation Data Inspector from the real-time application.

  1. Create target object and connect to target computer. Open model and configure model for target computer. Build model. Create instrument object and add signal from real-time application.

    objTarg = slrealtime;
    connect(objTarg);
    model = 'slrt_ex_osc';
    openExample(model);
    modelSTF = getSTFName(objTarg);
    set_param(model,"SystemTargetFile",modelSTF);
    slbuild(model);
    mldatxname = 'slrt_ex_osc.mldatx';
    objTargInst = slrealtime.Instrument(mldatxname);
    objTargInst.Name = 'TargetInstrument';
    addSignal(objTargInst,'SigGen');
  2. Add an instrument to the Target object for MATLAB data.

    addForSDI(objTarg.Instruments,objTargInst);

Input Arguments

collapse all

To create the instrument object, use the Instrument function.

Example: hInst

Object that represents target computer, specified as a Target object. The object provides access to methods that manipulate the target computer properties.

Example: tg

Version History

Introduced in R2026a