主要内容

get

Query Instrument object properties

Since R2026a

Description

propertyValue = get(instrument_object,propertyName) returns the value of the specified property for the specified Instrument object.

propertyStruct = get(instrument_object) returns a structure containing all properties and property values for the specified Instrument object.

get(instrument_object) returns a structure containing all properties and property values for the specified Instrument object.

example

Examples

collapse all

Use the get function to query property values from an Instrument object.

  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';
    objInst = slrealtime.Instrument(mldatxname);
    addSignal(objInst,'SigGen');
  2. Get the ModelName property value from the Instrument object.

    propertyValueModelName = get(objInst,'ModelName')
    propertyValueModelName =
    
        'slrt_ex_osc'
  3. Get a structure of properties and values from the Instrument object.

    propertiesObjInst = get(objInst)
    propertiesObjInst = 
    
      struct with fields:
    
                     Enable: 1
                       Name: []
               AxesTimeSpan: Inf
        AxesTimeSpanOverrun: 'scroll'
                Application: '<path omitted>\slrt_ex_osc.mldatx'
                  ModelName: 'slrt_ex_osc'

Input Arguments

collapse all

To create the instrument object, use the Instrument function.

Example: hInst

The names of Instrument object properties.

Example: myPropertyName

Output Arguments

collapse all

A value of an Instrument object property.

Example: myPropertyValue

A structure of Instrument object properties and value.

Example: myPropertyValue

Version History

Introduced in R2026a