About Instrument Control
Passing Information Between the MATLAB Workspace and Your Instrument
Instrument Control Toolbox™ software consists of two distinct components: MATLAB® functions and interface driver adaptors. These components allow you to pass information between the MATLAB workspace and your instrument. For example, the following diagram shows how information passes from the MATLAB software to an instrument via the GPIB driver and the GPIB controller.
This diagram illustrates how information flows from component to component. Information consists of
Property values
You define the behavior of your instrument control application by configuring property values. In general, you can think of a property as a characteristic of the toolbox or of the instrument that can be configured to suit your needs.
Data
You can write data to the instrument and read data from the instrument. Data can be binary (numerical) or formatted as text. Writing text often involves writing string commands that change hardware settings, or prepare the instrument to return data or status information, while writing binary data involves writing numerical values such as calibration or waveform data.
Events
An event occurs after a condition is met and might result in one or more callbacks. Events can be generated only after you configure the associated properties. For example, you can use events to analyze data after a certain number of bytes are read from the instrument, or display a message to the MATLAB command line after an error occurs.
MATLAB Functions
To perform any task within your instrument control application, you must call MATLAB functions from the MATLAB workspace. Among other things, these functions allow you to:
Create instrument objects, which provide a gateway to your instrument's capabilities and allow you to control the behavior of your application.
Connect the object to the instrument.
Configure property values.
Write data to the instrument, and read data from the instrument.
Examine your hardware resources and evaluate your application status.
For a listing of all Instrument Control Toolbox software functions, refer to the functions documentation. You can also display the toolbox functions by typing
help instrument
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.
Interface Driver Adaptor
The interface driver adaptor (or just adaptor) is the link between the toolbox and the interface driver. The adaptor's main purpose is to pass information between the MATLAB workspace and the interface driver. Interface drivers are provided by your instrument vendor. For example, if you are communicating with an instrument using a National Instruments™ GPIB controller, then an interface driver such as NI-488.2 must be installed on your platform. Note that interface drivers are not installed as part of the Instrument Control Toolbox software.
Instrument Control Toolbox software provides adaptors for the GPIB interface and the VISA standard. The serial port, TCP/IP, and UDP interfaces do not require an adaptor.
Interface Adaptors
Interface | Adaptor Name |
---|---|
GPIB |
|
Serial port | N/A |
TCP/IP | N/A |
UDP | N/A |
VISA standard |
|