EasyManua.ls Logo

Keysight E4428C ESG RF - Saving and Recalling States Using VISA and C

Keysight E4428C ESG RF
404 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Keysight Signal Generators Programming Guide 103
Programming Examples
GPIB Programming Interface Examples
stat = viPrintf(inst, "SWEEP:POINTS %d\n", npoints);
// set interface timeout to double the expected sweep time
// sweep takes (~15ms + dwell) per point * number of points
// the timeout should not be shorter then the sweep, set it
// longer
long timeoutMS = long(2*npoints*(.015+dwell)*1000);
// set the VISA timeout
stat = viSetAttribute(inst, VI_ATTR_TMO_VALUE, timeoutMS);
// set continuous trigger mode off
stat = viPrintf(inst, "INIT:CONT OFF\n");
// turn list sweep on
stat = viPrintf(inst, "FREQ:MODE LIST\n");
int sweepNo = 0;
while(intCounter>0 )
{
// start the sweep (initialize)
stat = viPrintf(inst, "INIT\n");
printf("Sweep %d started\n",++sweepNo);
// wait for the sweep completion with *OPC?
int res ;
stat = viPrintf(inst, "*OPC?\n");
stat = viScanf(inst, "%d", &res);
// handle possible errors here (most likely a timeout)
// err_handler( inst, stat );
puts("Sweep ended");
// delay before sending next INIT since instrument
// may not be ready to receive it yet
Sleep(15);
intCounter = intCounter-1;
}
printf("End of Program\n\n");
}
Saving and Recalling States Using VISA and C
In this example, instrument settings are saved in the signal generator’s save register. These settings
can then be recalled separately; either from the keyboard or from the signal generator’s front panel.

Table of Contents

Related product manuals