VectorStar™ MS4640A SeriesMicrowave Vector Network Analyzer : Appendix C — Programming with VISA/C# : Overview
 
Overview
Programming Basics
There are many cases where a user may want programmatic control of the VNA. Examples include automating a test sequence, orchestrating a complex measurement involving various pieces of test equipment, gathering a time series of data, or as a convenient way of getting data or images transferred from the VNA to a PC for further analysis.
What is VISA?
VISA (Virtual Instrument System Architecture) is an I/O software standard for communicating with test instruments like VectorStar over any of the bus architectures which VectorStar supports. A VISA driver is available from both National Instruments and Agilent. National Instruments VISA drivers are available for the following operating systems: Windows (all versions), Mac OS X, Linux, Mandriva, RedHat, SUSE, PharLap, VxWorks, Pocket PC 2003, and Windows CE/Mobile. It’s always a good idea to get the latest driver (Version 5.1.1), but make sure to get the Full Version (not just the runtime) version 5.0 or higher for the best support of the latest .NET 4.0 Framework, USB and TCP/IP. The driver is available from http://www.ni.com/visa/ or from NI Device Driver CD that comes with NI hardware.
Install NI-VISA Driver
Installing NI-VISA 5.1.1 Driver.
 
NI-VISA Installation
From the Full NI-VISA 5.1.1 installation, you can also select to install Developer Support for .NET Frameworks 2.0, 3.5 and 4.0. It does not automatically install Development Support for the .NET Frameworks so you have to select these to install. Make sure to select “Examples” also. The VISA Version 5.1.1 driver supports the .NET Framework 2.0, 3.5 and 4.0.
 
VisaNS Search
Search for “VisaNS” in Visual Studio (Local) help to find more information about using the VISA driver.
Programming Environments
Programming environments that are commonly used with test equipment include LabVIEW, LabWindows/CVI, Microsoft Visual Studio (2005, 2008, 2010), Visual Basic 6, HP Basic, and so on. NI-VISA supports the following Windows development environments:
LabVIEW
LabWindows/CVI
Measurement Studio for Visual Studio
Microsoft Visual Studio 2010/2008/2005/2003/6.0
Microsoft Visual Basic 6.0
For the examples below, we’ll use Visual C# 2010 Express Edition. You can download the latest Express Edition for free from the Microsoft website http://www.microsoft.com/express/download.
GPIB Mnemonics
VectorStar has a fairly large set of GPIB commands. This includes a set of Native commands, Lightning commands and Agilent 8510 commands. You use the same commands regardless of the communication method employed. See Example 3 for using the LIST command to output the full set of supported GPIB mnemonics directly from the VNA.