Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Configuring and Returning Properties

Configuring Property Names and Property Values

You establish the desired instrument object behavior by configuring property values. You can configure property values using the set function or the dot notation, or by specifying property name/property value pairs during object creation. You can return property values using the get function or the dot notation.

Interface objects possess two types of properties: base properties and interface-specific properties. (These properties pertain only to the interface object itself and to the interface, not to the instrument.) Base properties are supported for all interface objects (serial port, GPIB, VISA-VXI, and so on), while interface-specific properties are supported only for objects of a given interface type. For example, the BaudRate property is supported only for serial port and VISA-serial objects.

Device objects also possess two types of properties: base properties and device-specific properties. While device objects possess base properties pertaining to the object and interface, they also possess any number of device-specific properties as defined in the instrument driver for configuring the instrument. For example, a device object representing an oscilloscope might posses such properties as DisplayContrast, InputRange, and MeasurementMode. When you set these properties you are directly configuring the oscilloscope settings.

Note

To get a list of options you can use on a function, press the Tab key after entering a function on the MATLAB® command line. The list expands, and you can scroll to choose a property or value. For information about using this advanced tab completion feature, see Using Tab Completion for Functions.

Returning Property Names and Property Values

Once the instrument object is created, you can use the set function to return all its configurable properties to a variable or to the command line. Additionally, if a property has a finite set of character vector values, set returns these values.

Note

To get a list of options you can use on a function, press the Tab key after entering a function on the MATLAB command line. The list expands, and you can scroll to choose a property or value. For information about using this advanced tab completion feature, see Using Tab Completion for Functions.

Property Inspector

The Property Inspector enables you to inspect and set properties for one or more instrument objects. It provides a list of all properties and displays their current values.

Settable properties in the list are associated with an editing device that is appropriate for the values accepted by the particular property. For example, a callback configuration GUI to set ErrorFcn, a pop-up menu to set RecordMode, and a text field to specify the TimerPeriod. The values for read-only properties are grayed out.

You open the Property Inspector with the inspect function. Alternatively, you can open the Property Inspector via the Workspace browser by right-clicking an instrument object and selecting Call Property Inspector from the context menu, or by double-clicking the object.

Was this topic helpful?