VectorStar™ MS4640A SeriesMicrowave Vector Network Analyzer : Appendix A — Programming with LabVIEW : Overview
 
Overview
Programming Basics
There are many cases where a user may want programmatic control of the VNA. Examples include automating a test sequence, manufacturing testing, orchestrating a complex measurement involving various pieces of test equipment, gathering a time series of data, or as a convenient way of getting data, files or images transferred from the VNA to a pc for further analysis.
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 4 for using the LIST command to output the full set of supported GPIB mnemonics directly from the VNA. For LabVIEW programmers the best way to contol VectorStar is with the native MS464X LabVIEW driver. But if you’re familiar with Lightning, VectorStar also supports Lightning commands you can use the Lightning 37XXX LabVIEW driver to control VectorStar. This document uses a combination of MS464X driver VIs and VISA Reads and Writes to send commands to the VNA and to get data from the VNA. With this combination method, we use the driver to accomplish many procedures.
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, Mac OS X, Linux and others. 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) for the best support of the latest .NET 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 and is installed along with LabVIEW. The MS464X LabVIEW drivers uses VISA to communicate.
VISA uses connection strings to set up communication with the VNA over various protocols. Here are some connection string examples:
//VXI-11 Connection string
"TCPIP0::192.168.1.7::INSTR";
 
//GPIB Connection string
"GPIB0::6::INSTR";
 
//USB Connection string (vendor::product::serial_number)
"USB0::0x0B5B::0xFFD0::MS4647A-12345::INSTR";
The beauty of using VISA is that the only thing that needs to be changed for any of these possible communication protocols is the connection string. The rest of the code should be exactly the same (except for SOCKETS which are not covered in this document). For TCP/IP we recommend using VXI-11 since it better implements the IEEE 488.2 standard and all status checking. The Getting Started section of the Programming Examples shows how to set up for communication over VXI-11 (TCP/IP).
Programming Environments
Programming environments that are commonly used with test equipment include LabVIEW, LabWindows/CVI, Microsoft Visual Studio, Visual Basic 6, HP Basic, and so on.
For the examples below, we’ll use LabVIEW Version 8.6 with the VectorStar MS464X LabVIEW driver.