VectorStar™ MS4640A SeriesMicrowave Vector Network Analyzer : Appendix D — Programming Basics with Legacy Software
 
Programming Basics with Legacy Software
Introduction
This appendix provides an overview of programming techniques for controlling the VectorStar Series VNAs with older legacy software. Best practices recommend using the techniques and software described in Appendix A, B, and C for new development. This appendix describes using the NI-VISA driver and C# over GPIB, TCP/IP (using VXI-11), and USB. Programming using TCP/IP Sockets requires some special handling and is not discussed in this document.
Programming Basics
Programmatic control of the VNA allow automating a test sequence, orchestrating a complex measurement involving various pieces of test equipment, gathering a time series of data, or a convenient way of getting data or images transferred from the VNA to a PC for further analysis.
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. Licensed VISA drivers are available from National Instruments and Agilent. National Instruments VISA drivers are available for the following operating systems:
Windows 2000/Vista x64/Vista x86/XP/Windows 7
Mac OS X
Linux
Mandriva
RedHat
SUSE
PharLap
VxWorks
Pocket PC 2003
Windows CE/Mobile
Note 
The NI-VISA software, a product of National Instruments, is not freeware, but rather a licensed software product available for purchase from National Instruments. The type of license required depends whether you are developing or deploying an application. More information on National Instruments and NI-VISA, consult their web site at http://www.ni.com.
 
It’s always a good idea to get the latest driver (Version 4.4.1 as of the release date of this document), but make sure to get the Full Version (not just the runtime) version 4.4 or higher for the best support of the latest .NET 3.5 Framework, USB and TCP/IP. The driver is available from http://www.ni.com or from NI Device Driver CD that comes with NI hardware.
 
Installing NI-VISA 4.4 Driver from the Device Driver CD
Installing NI-VISA 4.4 Driver from the Device Driver CD does not automatically install Development Support for the .NET Framework so it must be selectively installed. Be sure to select “Examples” as well. The VISA Version 4.4 driver supports the .NET Framework 1.1, 2.0 and 3.5.
The Full NI-VISA 4.4.1 installation can also be selected from Developer Support for .NET Framework 3.5.
Full NI-VISA 4.4.1 Installation
Search for “VisaNS” in Visual Studio (Local) Help to find more information about using the VISA driver.
Search for “VisaNS”
Programming Environments
Programming environments that are commonly used with test equipment include LabVIEW, LabWindows/CVI, Microsoft Visual Studio (2003, 2005, 2008), Visual Basic 6, HP Basic, and others. NI-VISA supports the following Windows development environments:
LabVIEW 8.6/8.5/8.2/7.1.1
LabWindows/CVI 8.5/8.1/8.0/7.1
Measurement Studio for Visual Studio 2008/2005/2003 (all versions)
Microsoft Visual Studio 2008/2005/2003/6.0
Microsoft Visual Basic 6.0
The examples below use Visual C# 2008 Express Edition, which uses C# 3.0 and the .NET Framework 3.5. You can download the Express Edition for free from the Microsoft at:
http://www.microsoft.com/express/download
GPIB Mnemonics
The MS4640A Series VNA has a fairly large set of GPIB commands. This includes a set of Native commands, Lightning commands, and for MS464xA Series VNAs, Agilent HP8510 commands. You use the same commands regardless of the communication method employed. Refer to Example 3 in this appendix for using the LIST command to output the full set of supported GPIB mnemonics directly from the VNA.