Main Content

Creating Instrument Objects

Overview

Instrument objects are the toolbox components you use to access your instrument. They provide a gateway to the functionality of your instrument and allow you to control the behavior of your application. The Instrument Control Toolbox™ software supports two types of instrument objects:

  • Interface objects are associated with a specific interface standard, such as VISA. They allow you to communicate with any instrument connected to the interface.

  • Device objects are associated with a MATLAB® instrument driver. They allow you to communicate with your instrument using properties and functions defined in the driver for a specific instrument model.

Interface Objects

An interface object represents a channel of communication. For example, an interface object might represent a device at address 4 on VISA-GPIB, even though there is nothing specific about what kind of instrument this may be.

To create an instrument object, call the constructor for the type of interface (serialport, tcpclient, tcpserver, udpport, or visadev), and provide appropriate interface information, such as address for VISA-GPIB, remote host for TCP/IP, or port number for serial.

For detailed information on interface objects and how to create and use them, see Create Interface Object.

Device Objects

A device object represents an instrument rather than an interface. As part of that representation, a device object must also be aware of the instrument driver.

You create a device object with the icdevice function. A device object requires a MATLAB instrument driver and some form of instrument interface, which can be an interface object, a VISA resource name, or an interface implied in an IVI® configuration.

For detailed information on device objects and how to create and use them, see Device Objects.