![Stanford Research Systems SR780 Operating Manual And Programming Reference Download Page 483](http://html.mh-extra.com/html/stanford-research-systems/sr780/sr780_operating-manual-and-programming-reference_1359462483.webp)
Example
Program
5-117
SR780 Network Signal Analyzer
printf ("\n\nWait for octave settle...");
GetSr780 ("DSPS?");
//clear any sticky bits in the Display status word
//and then wait until the settle bits become set
do { GetSr780 ("DSPS?"); } while ( (atoi(recv)&0x0404) != 0x0404 );
printf ("done\n\n");
TxSr780 ("SVTR 0,5");
//save DisplayA to Trace5
TxSr780 ("RCTR 1,5");
//recall Trace5 to DisplayB
GetSr780 ("DSPN? 1"); nlen = atoi(recv);
//query the length of DisplayB
printf ("DisplayB length = %d\n",nlen);
/* ***************************************************** */
/* ****** Download an octave trace ****** */
// Make Trace5 a constant -27 dBVpk for all bins.
// Convert -27 dBVpk to Volts (10^(-27/20))=0.04467
// Trace5 is already defined as an Octave measurement
// so the downloaded points are assumed to be Volts squared!
octreal = 0.04467*0.04467;
//(44.67 mV)^2 real part
octimag = 0.0;
//no imaginary part
//This section needs to be modified for your GPIB interface
printf ("Loading Trace 5...");
TxGpib (sr780,"TASC? 5,34");
//use TxGpib (no wait for IFC RDY)
//TASC downloads ASCII data,
//use TLOD to download binary data.
transmit("mla talk 10",&status);
//make SR780 a talker, pc a listener
rarray (&ack, 4, &length, &status);
//binary read 4 bytes (long int)
//return value should be 1
printf ("%d bytes recvd [val=%ld]...",length,ack);
// TASC (TLOD) replaces the data in an existing Trace (5).
// The Trace measurement and length are not changed!
// Download 34 bins of data (real, imaginary) with commas to separate,
// and EOI at the end.
// First 33 bins are the spectrum, last bin is the Total Power bin.
// All points are complex.
// For an octave measurement, the imaginary parts are all zero.
transmit("mta listen 10",&status);
//make SR780 a listener, pc a talker
for (i=0; i<33; i++) {
//download 33 octave bins
sprintf (cmd,"DATA '%lf, '", octreal);
//real part
transmit (cmd,&status);
sprintf (cmd,"DATA '%lf, '", octimag);
//imaginary part
transmit (cmd,&status);
}
// last bin is the total power bin
sprintf (cmd,"DATA '%lf, '", octreal*33);
//real part of total power bin
transmit (cmd,&status);
sprintf (cmd,"DATA '%lf' END", 0.0);
//imag part of total power bin,
transmit (cmd,&status);
//last value, terminate with EOI!
WaitIFC ();
//serial poll until IFC set, ok to continue
printf ("done\n");
TxSr780 ("RCTR 1,5");
//recall Trace 5 to DisplayB to view the new data
/* ***************************************************** */
/* ****** Define a User Function ****** */
// define Func1 = Oct(1)/Trace5
TxSr780 ("USRO 1,14,-5,45");
//14=Oct(1), -5=divide, 45=Trace5
TxSr780 ("MEAS 0,25");
//DisplayA measures UserFunc1
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: ......