138 Chapter 3
ProgrammingExamples
Using Limit Lines
/*Clear the instrument*/
viClear(viESA);
/*Reset the instrument*/
viPrintf(viESA,"*RST\n");
/* Check for the instrument model number and route the 50MHz signal accordingly*/
/*Route50MHzSignal();
/*Display the program heading */
printf("\n\t\t Limit Lines Progr am \n\n" );
/*Set the Y-Axis Units to dBm */
viPrintf(viESA, "UNIT:POW DBM\n" );
/*Set to Frequency Domain Mode*/
viPrintf(viESA,"CALC:LLINE1:CO NT:DOM FREQ\n");
/*Delete any current limit line and define the upper limit line
to have the following frequenc y/amplitude pairs*/
viPrintf(viESA,"CALC:LLINE1:TY PE UPP\n");
/* Turn on display*/
viPrintf(viESA,"CALC:LLINE1:DI SP ON\n");
/*Send the upper limit line data*/
viPrintf(viESA,"CALC:LLINE1:DA TA 40E06,-50,1, 45E06,-20,1, 50E06 ,-15,1,
55E06,-20,1, 60E06,-50,1\n");
/* Turn on display*/
viPrintf(viESA,"CALC:LLINE1:DI SP ON\n");
/*Delete any current limit line and define the lower limit line
to have the following frequenc y/amplitude pairs*/
viPrintf(viESA,"CALC:LLINE2:TY PE LOW\n");
/*Send the lower limit line data*/
viPrintf(viESA,"CALC:LLINE2:DA TA
40E06,-100,1,49.99E06,-100,1,50E06 ,-30,1,50.01E06,-100,1,60E06,-100, 1\n");
/* Turn on display*/
viPrintf(viESA,"CALC:LLINE2:DI SP ON\n");
/*Turn the limit line test function on.*/
viPrintf(viESA,"CALC:LLINE2:STAT ON\n");