Instrument Control Toolbox | ![]() ![]() |
The GPIB Interface
The GPIB interface is supported through a VISA-GPIB object. The features associated with a VISA-GPIB object are similar to the features associated with a GPIB object. Therefore, only functions and properties that are unique to VISA's GPIB interface are discussed in this section. These unique features are associated with
Refer to Controlling GPIB Instruments to learn about the GPIB interface, writing and reading text and binary data, using events and callbacks, using triggers, and so on.
Note
The VISA-GPIB object does not support the spoll function, or the BusManagementStatus , CompareBits , and HandshakeStatus properties.
|
Creating a VISA-GPIB Object
You create a VISA-GPIB object with the visa
function. Each VISA-GPIB object is associated with
visa
requires the vendor name and the resource name as input arguments. The vendor name can be agilent
, ni
, or tek
. The resource name consists of the GPIB board index, the instrument primary address, and the instrument secondary address. You can find the VISA-GPIB resource name for a given instrument with the configuration tool provided by your vendor, or with the instrhwinfo
function. As described in Configuring Properties During Object Creation, you can also configure properties during object creation.
For example, to create a VISA-GPIB object associated with a National Instruments controller with board index 0, and a Tektronix TDS 210 digital oscilloscope with primary address 1 and secondary address 0:
The VISA-GPIB object vg
now exists in the MATLAB workspace. You can display the class of vg
with the whos
command.
After you create the VISA-GPIB object, the properties listed below are automatically assigned values. These properties provide descriptive information about the object based on its class type and address information.
Property Name |
Description |
Name |
Specify a descriptive name for the VISA-GPIB object. |
RsrcName |
Indicate the resource name for a VISA instrument. |
Type |
Indicate the object type. |
You can display the values of these properties for vg
with the get
function.
The VISA-GPIB Object Display
The VISA-GPIB object provides you with a convenient display that summarizes important address and state information. You can invoke the display summary these three ways:
You can also display summary information via the Workspace browser by right-clicking an instrument object and selecting Explore -> Display Summary from the context menu.
The display summary for the VISA-GPIB object vg
is given below.
VISA-GPIB Object Using NI Adaptor : VISA-GPIB0-1 Communication Address BoardIndex: 0 PrimaryAddress: 1 SecondaryAddress: 0 Communication State Status: closed RecordStatus: off Read/Write State TransferStatus: idle BytesAvailable: 0 ValuesReceived: 0 ValuesSent: 0
![]() | Using Vendor Tools to Identify and Test Your Resources | The VISA-GPIB Address | ![]() |