Key Features

  • IVI, VXIplug&play, and native MATLAB instrument driver support
  • GPIB and VISA (GPIB, GPIB-VXI, VXI, USB, TCP/IP, and serial) support
  • TCP/IP, UDP, I2C, MODBUS Serial RTU and TCP/IP, and Bluetooth serial protocol support
  • Instrument Control app for identifying, configuring, and communicating with instruments
  • Simulink® blocks for sending and receiving live data between instruments and Simulink models
  • Functions for reading and writing binary and ASCII data to and from instruments
  • Synchronous and asynchronous (blocking and nonblocking) read-and-write operations
Typical test setup showing Instrument Control Toolbox controlling and communicating with a power supply and oscilloscope. Resulting data is read into MATLAB for analysis and visualization.

Communicating with Instruments

Instrument Control Toolbox can communicate with instruments by a variety of methods, including:

  • Instrument drivers
  • Communication protocols
  • Instrument Control app
  • Quick-Control Oscilloscope
  • Quick-Control Function Generator
  • Quick Control RF Signal Generator
  • Simulink blocks

The toolbox provides functions for creating objects that contain properties related to the instrument and to the instrument control session.

Instrument Drivers

Instrument drivers let you communicate with instruments independently of device protocols. As a result, you can use common MATLAB terminology for communication without learning instrument-specific commands, such as Standard Commands for Programmable Instruments (SCPI).

The toolbox lets you work with VXIplug&play, IVI, and MATLAB instrument drivers. VXIplug&play and IVI instrument drivers often ship with your instrument; they are also available from instrument manufacturer Web sites. If needed, you can create MATLAB instrument drivers with driver development tools included in the toolbox.

Communication Protocols

Instrument Control Toolbox supports communication protocols, including GPIB, serial, TCP/IP, and UDP, for direct communication with instruments. You can also communicate with instruments using VISA over GPIB, VXI, USB, TCP/IP, and serial buses. The toolbox provides a set of functions for creating and working with instruments. These functions let you write commands to an instrument or read data from it for use in MATLAB. The toolbox supports common text commands, such as SCPI. The transferred data can be binary or ASCII.

The toolbox also supports client and server socket communication over TCP/IP and UDP; in addition, it supports the Bluetooth serial protocol for communication with Bluetooth devices.

Test & Measurement Tool

The Test & Measurement Tool enables you to communicate with and configure instruments without writing code. It lets programmers and nonprogrammers:

  • Search for available hardware
  • Connect to an instrument
  • Configure instrument settings
  • Write data to an instrument
  • Read data from an instrument

The Test & Measurement Tool automatically generates MATLAB code from an instrument control session. By saving this code to a MATLAB file, you can execute the same commands programmatically.

The Test & Measurement Tool (bottom) searching for available hardware and drivers(top). It communicates with and controls instruments without the need to write code and can automatically generate MATLAB code from your session.

Quick-Control Oscilloscope

Instrument Control Toolbox provides Quick-Control Oscilloscope to automatically determine the best driver and interface technology, enabling quick analysis of captured data. By creating a Quick-Control Oscilloscope object, you can easily control and acquire data into MATLAB.

The Quick-Control Oscilloscope object provides the most common functions for controlling and acquiring data from oscilloscopes so that you do not need to know any details about the underlying instrument driver. In addition to connecting to and collecting data from an instrument, other toolbox functions let you configure enabled channels, acquisition time, vertical range and offset, coupling, trigger level, and trigger slope.

Quick-Control Oscilloscope object that collects data and changes settings without requiring knowledge of instrument drivers.

Quick-Control Function Generator

Instrument Control Toolbox provides Quick-Control Function Generator to enable quick configuration and download of data to be sent out by the generator. The Quick-Control Function Generator object provides the most common functions for controlling function generators so that you do not need to know any details about the underlying instrument driver. In addition to connecting to the instrument and enabling the output, other toolbox functions let you download arbitrary waveforms into the instrument’s memory and configure the frequency, amplitude, and modulation characteristics of standard waveforms.

Simulink Blocks

Instrument Control Toolbox includes instrument control blocks for use with Simulink. Blocks can send live data from a Simulink model to an instrument or query an instrument for live data to be inserted into a model. The toolbox facilitates hardware selection and configuration for use in Simulink models.

Managing a Session

Hardware Discovery, Management, and Configuration

Instrument Control Toolbox provides a set of utility functions that let you determine hardware availability for your test setup. Using these functions, the toolbox scans for all available hardware connected to your system. It also lets you examine or configure IVI configuration store information for IVI drivers. You can add and remove hardware assets and logical names, and you can display available IVI driver information. You can access these management and configuration functions using MATLAB functions or the Test & Measurement Tool.

Capturing Interactive Instrument Sessions

Instrument Control Toolbox includes functions for recording an instrument control session to disk files. You can record:

  • Data written to instruments
  • Data read from instruments
  • Event information
Script illustrating the basic steps of connecting to a device with Instrument Control Toolbox: creation, configuration, and communication. A few lines of code let you acquire test data from an oscilloscope and plot the data in MATLAB.

Support for Synchronous and Asynchronous Modes

Instrument Control Toolbox supports both synchronous and asynchronous read-and-write operations. A synchronous operation blocks access to the command line until the read or write is completed. An asynchronous operation lets you issue additional MATLAB commands while the read or write operation executes.

Event Handling

An event, which occurs at a particular time after a condition is met, may execute a specified function known as a callback. You can use events and callbacks to analyze data as it is received from an instrument, or you can use these functions to display a message in the MATLAB workspace when all the data has been written to the instrument. The toolbox supports many event conditions, such as:

  • Error
  • Timer
  • Bytes available
  • Empty output buffer

Developing Instrument Drivers

Instrument Control Toolbox provides a set of graphical tools for creating and testing MATLAB instrument drivers and for working with IVI and VXIplug&play drivers. To work with VXIplug&play and IVI instrument drivers, you may need to create a MATLAB instrument driver wrapper for the underlying driver using the development tools provided. However, you can use many IVI drivers directly from MATLAB without the need to create a wrapper. You can also download preconfigured wrappers and MATLAB instrument drivers from the MATLAB Central File Exchange.

The MATLAB Instrument Driver Editor lets you create MATLAB instrument drivers and wrappers for VXIplug&play and IVI instrument drivers. It also lets you:

  • Import existing drivers for editing and modification
  • Configure and define instrument-specific properties
  • Document properties and functions
  • Customize the behavior of your instrument

The MATLAB Instrument Driver Testing Tool provides an environment for creating a test to verify the functionality of a MATLAB instrument driver. It also lets you:

  • Verify property behavior
  • Verify function behavior
  • Save the test as a MATLAB code file
  • Export the test results to a MATLAB workspace, figure window, MAT-file, or the MATLAB Variable Editor
  • Save test results as an HTML page
Using the MATLAB Instrument Driver Editor to import an Agilent 546xx driver and extend it to accept multiple coupling types for the main edge trigger.

Supported Devices, Instruments, and Protocols

Instrument Control Toolbox supports instruments and devices that provide IVI, VXIplug&play, or MATLAB instrument drivers. The toolbox also supports control and configuration of LXI instruments for developing test systems. Multiple instrument manufacturers are supported including Keysight, Rohde & Schwarz, and Tektronix.

The toolbox also lets you communicate with any instrument or device using text-based commands over the following supported protocols:

  • GPIB (HPIB, IEEE-488) interfaces from Keysight (Agilent) Technologies, ICS Electronics, Measurement Computing, and National Instruments
  • VISA standard, including interfaces for GPIB, VXI, GPIB-VXI, USB, VISA-PXI, TCP/IP, and serial from Keysight (Agilent) Technologies, National Instruments, and Tektronix.
  • TCP/IP and UDP interfaces, for connecting to networked instruments or remote applications using both client and server sockets
  • Bluetooth serial interface, for connecting to Bluetooth devices
  • I2C interface for communicating with chips and circuit boards using a host adaptor
  • MODBUS interface for communicating with industrial equipment
  • Serial interfaces, including RS-232 and RS-485

See Supported Hardware for complete information on using Instrument Control Toolbox with your hardware.