VectorStar™ MS4640A SeriesMicrowave Vector Network Analyzer : Appendix B — Programming with LabWindows/CVI : Example 1 – Open a Session to Obtain Instrument Information
 
Example 1 – Open a Session to Obtain Instrument Information
In this first example we’ll simply open a communication session to the VNA and then use two of the driver VIs to get some information about the VNA. The code snippet is below.
 
//==============================================================================
//
// Title: Example 1
// Purpose: Open session to obtain instrument information
//
// Created on: 11/30/2011 by David Judge.
// Copyright: Anritsu. All Rights Reserved.
//
//==============================================================================
 
//==============================================================================
// Include files
#include <ansi_c.h>
#include "au464x.h"
 
 
int main (int argc, char *argv[])
{
ViSession session;
ViStatus status;
ViChar d[256];
ViChar d1[256];
printf("Example 0: Connection and Revision Query\n\n");
//status = au464x _init ("TCPIP0::192.168.1.7::INSTR", VI_TRUE, VI_FALSE, &session);
status = au464x_init ("VectorStar_Test", VI_TRUE, VI_FALSE, &session);
// We could use a VISA connection in string in the au464x_init function above
// but we prefer to use the VISA alias (“VectorStar_Test”) we set up earlier.
status = au464x_revisionQuery (session, d,d1);
au464x_close(session);
printf("Driver Version: %s\n",d);
printf("Firmware Version: %s\n",d1);
printf("\n\nHit return to exit:");
getc(stdin);
return 0;
}
 
 
Example 1 – Output Results
The results of running Example 1. The au464x_revision_query() function returns two strings. The first is the version of the driver and the second is the version of firmware on the VNA.