136 Chapter 3
Programming Examples
Saving ASCII Trace Data in an ASCII File
Saving ASCII Trace Data in an ASCII File
This is the C programming example TraceASC.c
/***************************************************************************
*TraceASC.c
*Agilent Technologies 2001
*
*E4406A VSA Series Transmitter Tester using VISA for I/O
*This Program shows how to get and save an ASCII trace
*The C program does the following:
*Open session to GPIB device at address 18
*Check opening session success
*Set the instrument to Basic Mode
*Reset device
*Set the input port to the internal 50MHz reference source
*Zoom the spectrum display
*Tune the analyzer to 50MHz
*Set the analyzer in single mode
*Trigger a spectrum measurement and wait for it to complete
*Query the spectrum trace information
*Save the info trace to buffer
*Query the spectrum trace data
*Save the spectrum trace data to buffer
*Set the analyzer back to continuous mode
*Save trace data to an ASCII file
*Close session
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "visa.h"
void main ()
{
/*program variable*/