Specifications

Chapter 18 283
PSA Programming Examples
Using C for Saving and Recalling Instrument State Data
PSA Programming Examples
Using C for Saving and Recalling Instrument
State Data
This C programming example (State.c) can be found on the
Documentation CD.
/***************************************************************************
* State.c
* Agilent Technologies 2001
*
* PSA Series Transmitter Tester using VISA for I/O
* This program shows how to save and recall a state of the instrument
*
*******************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include "visa.h"
void main ()
{
/*program variables*/
ViSession defaultRM, viVSA;
ViStatus viStatus= 0;
/*open session to GPIB device at address 18 */
viStatus=viOpenDefaultRM (&defaultRM);
viStatus=viOpen (defaultRM, "GPIB0::18::INSTR", VI_NULL,VI_NULL, &viVSA);
/*check opening session sucess*/
if(viStatus)
{
printf("Could not open a session to GPIB device at address 18!\n");
exit(0);
}