Agilent Technologies E4406A VSA Satellite Radio User Manual


 
132 Chapter 3
Programming Examples
Saving Binary Trace Data in an ASCII File
Saving Binary Trace Data in an ASCII File
This is the C programming example Trace.c
/***************************************************************************
*Trace.c
*Agilent Technologies 2001
*
*E4406A VSA Series Transmitter Tester using VISA for I/O
*This Program shows how to get and save a binary trace data
*
*Set up VSA commands so they can be done FAST (all in one transaction).
*Reset the device and clear status.
*Set the input port to the internal 50MHz reference source.
*Zoom the spectrum display and tune the analyzer to 50MHz.
*Set the ouput format to a binary format.
*Set binary byte order to SWAP (for PC).
*Trigger a spectrum measurement and fetch the trace data.
*Open a session to GPIB device at address 18.
*Get the number of bytes in length of postceeding trace data.
*Put this in sBuffer.
*Put the trace data into sBuffer and convert it from ASCII to integer.
*Calculate the number of points given the number of byte in the trace.
*REAL 64 binary format means each number is represented by 8 bytes.
*Save trace data to an ASCII file.
*Close the session.
*
*****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "visa.h"
void main ()
{
/*program variable*/