Specifications

284 Chapter 18
PSA Programming Examples
Using C for Saving and Recalling Instrument State Data
PSA Programming Examples
/*set the instrument to SA mode*/
viPrintf(viVSA, "INST SA\n");
/*reset the instrument */
viPrintf(viVSA, "*RST\n");
/*set the input port to the internal 50Mhz reference source*/
viPrintf(viVSA, "SENS:FEED AREF\n");
/*tune the analyzer to 50MHZ*/
viPrintf(viVSA, "SENS:FREQ:CENT 50E6\n");
/*change the span*/
viPrintf(viVSA, "SENS:FREQ:SPAN 10 MHZ\n");
/*turn the display line on*/
viPrintf(viVSA, "DISP:WIND:TRACE:Y:DLINE:STATE ON\n");
/*change the resolution bandwidth*/
viPrintf(viVSA, "SENS:SPEC:BAND:RES 100E3\n");
/*change the Y Axis Scale/Div*/
viPrintf(viVSA, "DISP:WIND:TRAC:Y:SCAL:PDIV 5\n");
/*Change the display refernece level*/
viPrintf(viVSA, "DISP:WIND:TRAC:Y:SCAL:RLEV -15\n");
/*trigger the instrument*/
viPrintf(viVSA, "INIT:IMM;*WAI\n");
/*save this state in register 10.
!!!Carefull this will overwrite register 10*/
viPrintf(viVSA, "*SAV 10\n");
/*display message*/