Virtual Instrument Software Architecture (VISA): Basics and Interoperability

The Basics

VISA stands for Virtual Instrument Software Architecture. No surprises here. But let’s try to understand what it is and why it’s talked about so much in Test and Measurement circles.

To put it simply, VISA is a Test and Measurement (T&M) standard for enabling communication between an application and an instrument. This essentially allows an application to access an instrument without having to worry about the specific I/O interface details. Most modern T&M instruments support connectivity via USB, LAN, GPIB and PCI/PCIe and at its lowest level, each of these interfaces handles data and communication in a very different way compared to the other. This necessitates the presence of an intermediate layer that would take care of I/O interface management thus freeing the application from doing the same and in the process making the communication simpler and standardized. VISA standard is now under the purview of IVI Foundation. IVI stands for Interchangeable Virtual Instruments and its details would a be topic for another day.




How VISA is used is fairly straightforward. We install a particular vendor’s VISA libraries and start calling into the VISA DLL (or assembly) and we’re up and running. And example of VISA communication would be the case where we use SCPI commands inside a programming language and talk to an instrument.

Here is an example C++ program that uses VISA communication for sending communicating with an instrument.

#include "stdlib.h"
#include "string.h"

void main()
	char devAddr[20];
	char str[50];
	int str_size = 50;
	char str2[10];
	int str_size2 = 10;
	double real1 = 0.0;

	ViSession rm, instr_handle;

	printf("Enter Device Address\n");
	scanf("%s", devAddr);

	viOpen(rm, devAddr, VI_NULL, VI_NULL, &instr_handle);
	viQueryf(instr_handle, "*IDN?\n", "%#T", &str_size, str);
	printf("IDN: %s\n", str);



So VISA is fairly straightforward to understand and use. However things take a strange turn when we start talking about interoperability between VISA implementations by different vendors.

– Can we use one vendor’s VISA implementation to access instruments of another vendor?
– Can we have two installations of VISA in the same computer without any issues?
– Can I use multiple vendor VISA calls in the same program?

We attempt to answer the above questions and more in the subsequent section.

VISA is a standard, right? Which means we should be able to use any vendor’s VISA libraries to access any other vendor’s instruments. This would have been true in an ideal world but the reality is that all VISA implementations are not the same. Moreover, VISA standard specifies certain fixed paths in the windows file structure where VISA DLLs and other files have to be placed, which means if you attempt to install another vendor’s VISA over an existing one, some files will be overwritten. However, if we’re a little careful,  we can use VISA exactly as per our requirement.

First, the case where you need to have two different VISA implementations on the same PC. For the case where you need to use Keysight (formerly Agilent) and National Instruments VISA on the same PC, you’re in luck. Both the VISA implementations have been designed for interoperability and if you install one and attempt to install the other over it, it will be installed in a “side-by-side” mode, meaning that VISA libraries will be available for both of the vendors and you can access either from your application. You can detect and access Keysight instruments via the Keysight libraries and NI instruments via the NI libraries. This keeps things simple and is the recommended approach.




It is also possible to dynamically load and use either vendor’s VISA DLL in the same program. In addition, it is possible to use Keysight’s VISA to access NI instruments via Agilent TULIP. Similarly, it is possible to use NI VISA to access Keysight instruments via NI Passport. (More on this, coming soon!)

References and Sources:

Virtual Instrument Software Architecture – Wikipedia

Notes on Interoperating With Two VISA Implementations on the Same Computer

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>