Chapter 3 129
Programming Examples
Using Markers
Using Markers
This is the C programming example Markers.c.
/***************************************************************************
*Markers.c
*Agilent Technologies 2001
*
*E4406A VSA Series Transmitter Tester using VISA for I/O
*The C program does the following:
*Open session to GPIB device at address 18
*Check opening session success
*set the instrument to Basic Mode
*Preset the instrument
*Set the input port to the internal 50Mhz reference source
*Tune the analyzer to 50MHZ
*Put the analyzer in a single mode
*Zoom the spectrum display
*Trigger a spectrum measurement
*Poll the operation complete query
*Assign marker 1 to the average trace of the spectrum
*Put the marker 1 on the signal peak
*Query the 50 MHz signal amplitude
*Get the 50 MHz signal amplitude
*Assign marker 2 to the average trace of the spectrum
*Assign the marker function NOISE to marker 2
*Position marker 2 on the noise floor
*Query NOISE marker
*Get the NOISE marker reading
*Put the analyzer back to continuous mode
*Calculate the difference between the marker peak and the NOISE marker
*Print result to the standard output
*Close session
*******************************************************************************/
#include <stdio.h>
#include <stdlib.h>