Example
Program
5-119
SR780 Network Signal Analyzer
//stb is serial poll byte
char stb;
do {spoll(sr780,&stb,&status);} while (!(stb&128));
//IFC
if (stb&32) {
// If ESB bit set,
// there must be a command error in the Standard Event status word.
// Handle command errors here.
TxGpib (sr780, "*ESR?");
//clear the Standard Event status word
GetGpib (sr780);
printf ("\nEXE error\n");
GetSpace ();
}
}
/* ******************************************************************** */
void GetSr780 (char *getcmd)
// query the sr780 for an answer
// getcmd is the query command string
{
TxSr780 (getcmd);
//send query command
GetGpib (sr780);
//get response into global recv string
}
/* ******************************************************************** */
void WaitAvg (void)
{
// routine to start a linear avg and wait until both displays are done
int result, avgdone;
avgdone=0;
//init avgdone status
GetSr780 ("DSPS?");
//clear sticky bits in Display status word first
TxSr780 ("STRT");
//start lin average measurement
do {
GetSr780 ("DSPS?"); result=atoi(recv);
//read display status word
avgdone = avgdone | (result & 0x0202);
//Check for AVGA and AVGB status bits until both have occurred.
//Remember, they may not be set together in the same query!
//Do not check for both in the same query!
}
while ((avgdone&0x0202)!=0x0202);
// both AVGA and AVGB have occurred
}
/* ******************************************************************** */
double GetData (int disp, int bin)
{
//routine to move the display marker to a bin and return the data value
//move the marker in display disp to bin
sprintf (cmd,"MBIN %d,%d",disp,bin);
TxSr780 (cmd);
sprintf (cmd,"DSPY? %d,%d",disp,bin);
//read the data value at bin
GetSr780 (cmd);
return (atof(recv));
//return the value as a double
}
/* ******************************************************************** */
void GetSpace (void)
/* Wait for space key */
Summary of Contents for SR780
Page 4: ...ii SR780 Network Signal Analyzer ...
Page 10: ...viii SR780 Network Signal Analyzer ...
Page 18: ...1 2 Getting Started SR780 Network Signal Analyzer ...
Page 39: ...Triggering and the Time Record 1 23 SR780 Network Signal Analyzer ...
Page 40: ...1 24 Triggering and the Time Record SR780 Network Signal Analyzer ...
Page 58: ...1 42 Waterfall Display SR780 Network Signal Analyzer ...
Page 70: ...1 54 Saving and Recalling SR780 Network Signal Analyzer ...
Page 167: ...Status Indicators 3 21 SR780 Network Signal Analyzer ...
Page 188: ...4 6 Menus SR780 Network Signal Analyzer ...
Page 193: ...FFT Frequency Menu 4 11 SR780 Network Signal Analyzer Command FEND d f ...
Page 232: ......
Page 236: ...4 54 Source Menu SR780 Network Signal Analyzer Command STYP i ...
Page 266: ...4 84 Playback Input Menu SR780 Network Signal Analyzer ...
Page 272: ...4 90 Trigger Menu SR780 Network Signal Analyzer ...
Page 288: ...4 106 Swept Sine Average Menu SR780 Network Signal Analyzer ...
Page 326: ...144 Exceedance Statistics Menu SR780 Network Signal Analyzer ...
Page 352: ...4 170 Output Menu SR780 Network Signal Analyzer ...
Page 478: ......