GPIB Instrument Control Tutorial - NI (2024)

Prerequisites

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.

Cables

GPIB Instrument Control Device

Install NI Software and Drivers

Install the latest compatible version ofLabVIEW, theNI-VISAdriver, and theNI-488.2driver. Refer to the following for compatibility information.

Install GPIB Controller

If you are using an NI GPIB controller or a NI GPIB-ENET device, refer to theGPIB Hardware Installation Guideto install the hardware.

Configure Hardware in MAX

In Measurement and Automation Explorer (MAX), NI-VISA detects the instrument and creates the VISA resource that you use to communicate with the instrument.

  1. Open MAX from the Start menu.
  2. ExpandDevices and Interfaces. You should see the VISA resource name of the NI GPIB controller listed asGPIB<controller>::INSTRwhere <controller> is the controller number. If not specified, the controller number defaults to 0.

If you are unable to see the controller, refer toCannot Detect NI GPIB-USB HS Device in MAX.

  1. After the controller has been successfully recognized, securely connect the GPIB instrument to the controller via a GPIB cable and power it on.
  2. In MAX, select the GPIB controller and selectScan for Instruments. NI-VISA will attempt to identify the connected GPIB instrument by conducting a FindLstn() test and a *IDN? query. The instrument VISA resource name should appear under the GPIB controller resource asGPIB::<primary address>::INSTR.

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 theTest Communicationsection below.

IfScan for Instrumentsis missing, refer toNI MAX GPIB Scan for Instruments Missing.

If you experience issues withScan for Instruments, refer toCan’t See GPIB Instrument Using Scan for Instruments in MAX.

GPIB Instrument Control Tutorial - NI (1)

Figure 1. Scanning for Instruments in MAX

  1. After your instrument has been successfully recognized, select the instrument in MAX and then theVISA Propertiestab at the bottom of the window. You can configure the VISA Alias of the instrument for easier identification.

Test Communication

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 selectCommunicate with Instrument.

  1. The NI-488.2 Communicator should launch.
  2. Type a supported command in theSend Stringfield. Refer to manufacturer documentation for a list of valid commands.
  3. Select one of the following:

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.

  1. In MAX, navigate to theToolstab >>NI-488.2>>Interactive Control.
  2. Enterhelpto launch IBIC help documentation and refer to your instrument’s manual for supported commands.

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.

Install Instrument Driver

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 toChoosing 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.

Run an Example

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 toNI-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.

Instrument Driver Examples

If you installed an instrument driver, refer to the following articles for instructions on running examples:

  • Using Plug-and-Play Instrument Drivers in LabVIEW
  • Using IVI Drivers in LabVIEW or LabWindows™/CVI™

NI-488.2 or NI-VISA Driver Example

If you are using NI-488.2 or NI-VISA, refer to the shipping examplesSimple GPIB.vi.orGPIB with VISA Functions.vi.

  1. To locate the examples, open LabVIEW and navigate to theHelptab >>Find Examples>>Hardware Input and Output>>GPIB.
  2. Ensure the proper VISA resource name is selected.
  3. Run the VI.

For more information on the NI-488.2 functions, refer toLabVIEW Help: GPIB Functions .

For more information on the NI-VISA functions, refer toLabVIEW Help: VISA Functions and VIs .

For a comparison on the NI-488.2 and NI-VISA functions, refer toNI-VISA Help: Comparison Between NI-VISA and NI-488.2 APIs.

GPIB Instrument Control Tutorial - NI (2024)

FAQs

What are the lines of GPIB control? ›

GPIB Cables are the physical link connecting all of the devices on the bus. There are eight data lines in a GPIB cable that send data from one device to another. There are also eight control lines that manage traffic on the data lines and control other interface operations.

What is the maximum number of devices in GPIB? ›

A GPIB system can contain up to 14 Listeners at a given time. Typically, the Controller is a Talker while one or more instruments on the GPIB are Listeners. Controllers — The Controller specifies which devices are Talkers or Listeners.

How to test GPIB cable? ›

Troubleshooting the GPIB Interface

Select Hardware in the tree view of the software to view the system details. Verify that the GPIB address is the same as the GPIB address used by your instrument. Press the Test IO Connections button to test the hardware connections.

How to setup GPIB? ›

Setting the GPIB
  1. Press System > Misc Setup > GPIB Setup> Talker/Listener Address.
  2. Enter the address using the ENTRY block keys on the front panel.

What are the four typical control bus lines? ›

Control Lines:

Used to carry the control signals and timing signals. Control signals indicate the type of operation. Timing Signals are used to synchronize the memory and IO operations with a CPU clock. Typical Control Lines may include Memory Read/Write, IO Read/Write, Bus Request/Grant, etc.

What are the three types of bus line? ›

There are three types of bus lines: Data bus, Address bus, and Control bus. Communication over each bus line is performed in cooperation with another. The data bus is a signal line for exchanging the data between the CPU and the memory, and between the CPU and I/O, and handles the data stored in the specified location.

Is GPIB obsolete? ›

GPIB/IEEE 488 is very well established and qualified in the test and measurement industry and there is no indication that it will be obsolete in the near future. However, there are indications that it will most likely be replaced slowly by other standard means of interfacing over many years.

What are the limitations of GPIB? ›

The GPIB standard normally permits up to 15 devices to be configured within one system. Each of these devices has a unique bus address, a number from 0 to 30. Address limits can be circumvented directly by the use of bus expanders or indirectly through the use of an isolator or an extender.

What is the maximum speed of GPIB? ›

GPIB uses eight data lines to transfer 1 byte of data at a time at a speed of up to 1 MB/s.

How to troubleshoot GPIB? ›

GPIB Troubleshooting
  1. Start the Visa Assistant: ...
  2. Check for all expected GPIB devices: ...
  3. Check for basic operation of each GPIB devices:
  4. Check for detectable options on a given device: ...
  5. Check communication with the Dynamic Accuracy Test Set or Gain Compression Test Set:

What is the SRQ in GPIB? ›

The Service Request Line (SRQ) on the GPIB is designed to signal the Controller when a service request is pending. The Controller must then determine which device asserted the SRQ line and respond accordingly.

What is the maximum cable length for GPIB? ›

The IEEE 488 standard specifies that the total cable length for a GPIB system cannot exceed 20 m and the maximum number of devices is 15. A pair of NI GPIB-140A/2 bus extenders can extend the cable length to 2 km without compromising the integrity of the GPIB or requiring any application modifications.

What are the types of GPIB? ›

There are two basic types of GPIB converters: GPIB interfaces and GPIB controllers.

What is GPIB interface not addressed correctly? ›

GPIB Controller not addressed correctly. This error occurs when the board is the Controller-In-Charge and is not properly addressed before starting a transfer. For example, ibrd returns EADR if the interface is not addressed as a listener.

What is GPIB communication? ›

The GPIB is a digital, 24-conductor parallel bus. The GPIB uses an 8-bit parallel, byte-serial, asynchronous data transfer scheme, which means that whole bytes are sequentially handshaked across the bus at a speed that the slowest participant in the transfer determines.

What are the types of GPIB messages? ›

There are two types of messages on the General Purpose Interface Bus (GPIB): command messages and data messages. Every GPIB Controller and every GPIB instrument has a unique identity on the bus; this identity is known as its address.

What are the system bus lines? ›

A system bus is a single computer bus that connects the major components of a computer system, combining the functions of a data bus to carry information, an address bus to determine where it should be sent or read from, and a control bus to determine its operation.

What are the different types of GPIB connector? ›

These cable types differ by shielding type (e.g. single- or double- shielded) and connector (e.g. right-angle, standard).
  • X2 – Double-shielded cable with shielded plug/receptacles.
  • X4 – Double-shielded standard GPIB to right-angle GPIB cable.
  • X5 – Double-shielded standard GPIB to single-end male GPIB cable.
Sep 27, 2023

What are the bus lines in computer architecture? ›

A bus, in computing and digital technology, is an electronic pathway through which data can be transferred. This pathway uses signals that move at different speeds and are sent through different channels to communicate information between components within a computer or network.

References

Top Articles
Latest Posts
Article information

Author: Neely Ledner

Last Updated:

Views: 5884

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Neely Ledner

Birthday: 1998-06-09

Address: 443 Barrows Terrace, New Jodyberg, CO 57462-5329

Phone: +2433516856029

Job: Central Legal Facilitator

Hobby: Backpacking, Jogging, Magic, Driving, Macrame, Embroidery, Foraging

Introduction: My name is Neely Ledner, I am a bright, determined, beautiful, adventurous, adventurous, spotless, calm person who loves writing and wants to share my knowledge and understanding with you.