Consult the pinout or documentation for your GPIB instrument and make sure you have the correct cables and GPIB instrument control device to connect the instrument to the computer.
Install the latest compatible version of LabVIEW, the NI-VISA driver, and the NI-488.2 driver. Refer to the following for compatibility information.
If you are using an NI GPIB controller or a NI GPIB-ENET device, refer to the GPIB Hardware Installation Guide to install the hardware.
In Measurement and Automation Explorer (MAX), NI-VISA detects the instrument and creates the VISA resource that you use to communicate with the instrument.
If you are unable to see the controller, refer to Cannot Detect NI GPIB-USB HS Device in MAX.
Note: If your instrument is not SCPI compliant, it will not appear in MAX. Check the instrument’s user manual for supported commands and continue to the Test Communication section below.
If Scan for Instruments is missing, refer to NI MAX GPIB Scan for Instruments Missing.
If you experience issues with Scan for Instruments, refer to Can’t See GPIB Instrument Using Scan for Instruments in MAX.
After set-up and configuration, use an interactive control to verify communication with the instrument and test different instrument commands.
If your device is SCPI compliant, select its VISA resource and select Communicate with Instrument.
Query – writes the command to the instrument and reads the response back.
Write – writes the command to the instrument.
Read – reads the response from the instrument.
If your device is not SCPI compliant, use GPIB Interactive Control (IBIC) for more advanced communication.
If you are able to communicate with the instrument in IBIC, then you should also be able to communicate with the instrument from any other programming language, such as G code or C.
After completing your configuration and verifying communication with the instrument, you need an easy way to transition from interactive mode to programming mode.The best way to achieve this is by using instrument drivers.
Refer to Choosing the Right Interface to Control Instruments in LabVIEW to determine which instrument driver type is best for your application. Follow the links in the document to install and use the instrument driver.
The instrument driver, NI-488.2, and NI-VISA driver will install examples and the API required to communicate with your instrument. Use these examples as programming references and an easy way to start using your instrument. For more information on whether to use the NI-488.2 or NI-VISA API, refer to NI-VISA Help: GPIB Summary.
Note: Close MAX before you start running a LabVIEW example. Having MAX Test Panels open and running a LabVIEW example simultaneously will result in an access resource error.
If you installed an instrument driver, refer to the following articles for instructions on running examples:
If you are using NI-488.2 or NI-VISA, refer to the shipping examples Simple GPIB.vi. or GPIB with VISA Functions.vi.
For more information on the NI-488.2 functions, refer to LabVIEW Help: GPIB Functions.
For more information on the NI-VISA functions, refer to LabVIEW Help: VISA Functions and VIs.
For a comparison on the NI-488.2 and NI-VISA functions, refer to NI-VISA Help: Comparison Between NI-VISA and NI-488.2 APIs.
More GPIB Resources
Other Instrument Control Tutorials
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.