Introduction to Programming GPIB-VXI Devices in VISA

NI-VISA

Introduction to Programming GPIB-VXI Devices in VISA

For new GPIB-VXI users, this controller makes VXI message-based devices appear as though they are GPIB devices with secondary addresses. This initially provided an easy transition into VXI for customers with existing GPIB systems, because they could use the same NI-488.2 API to control both types of instruments. However, this proved problematic for VXI register-based devices, because their addresses are not mapped directly into the GPIB system.

For controlling message-based VXI devices through a GPIB-VXI, the biggest difference between a program using NI-488.2 and one using VISA is in the calls made at the beginning and the end. For register-based devices, the differences are more significant. This section first discusses the basic changes common to both types of devices, then discusses some of the changes required for register-based programming.

For message-based programming, an NI-488.2 program would typically call ibdev() with the VXI device's primary and secondary GPIB addresses to get a handle to the specific device. In VISA, a program calls viOpen() with the VXI device's logical address (which is a more natural address because the device is VXI) to get a handle to it. The simplest and most common GPIB-VXI resource string is "GPIB-VXI::<logical address>::INSTR". Once you have a session to the VXI device, the NI-488.2 and VISA calls to communicate with the device are very similar, as covered above in the Comparison between NI-VISA and NI-488.2 APIs section.