Reading Trace Data Using 32-Bit Real Format (Rs-232) - Agilent Technologies ESA-E Series Programmer's Manual

Esa spectrum analyzers
Hide thumbs Also See for ESA-E Series:
Table of Contents

Advertisement

Programming Examples
Reading Trace Data Using 32-bit Real Format (RS-232)
Reading Trace Data Using 32-bit Real Format
(RS-232)
/************************************************************ /
/*
Reading Trace Data using 32-bit Real Format (RS-232)
* /
/*
* /
/* This C programming example does the following .
*/
/*
The SCPI instrument commands used are given as
* /
/* reference .
*/
/*
*/
/* -
Opens an RS-232 session at COM1/COM2
* /
/* - Clears the Analyzer
* /
/* - Resets the Analyzer
* /
/*
*RST
* /
/* - Set the input port to the 50 MHz amplitude reference
* /
/*
CAL :SOUR :STAT ON
* /
/* - Query for the number of sweep points (for firmware
* /
/*
revision A .04 .00 and later) . Default is 401 .
*/
/*
SENS :SWE :POIN?
*/
/* -
Calculate the number of bytes in the header
* /
/* - Set the analyzer to single sweep mode
* /
/*
INIT :CONT 0
/* - Sets the analyzer center frequency and span to 50 MHz
* /
/*
SENS :FREQ :CENT 50 MHZ
* /
/*
SENS :FREQ :SPAN 50 MHZ
* /
/* - Specify 10 dB per division for the amplitude scale in
* /
/*
and dBm Units
* /
/*
DISP :WIND :TRAC :Y :SCAL :PDIV 10 dB
* /
/*
UNIT :POW DBM
* /
/* - Set the analyzer trace data to 32-bit Real
* /
/*
FORM :DATA : REAL,32
* /
/* - Set the binary order to swap
* /
/*
FORM :BORD SWAP
* /
/* - Trigger a sweep
* /
/*
INIT :IMM
* /
/* - Check for operation complete
* /
/*
*OPC?
*/
/* -
Calculate the number of bytes in the trace record
* /
/* - Set VISA timeout to 60 seconds, to allow for slower
* /
/*
transfer times caused by higher number of sweep points * /
/*
at low baud rates .
* /
/* -
Set VISA to terminate read after buffer is empty
* /
/* - Query the trace data
* /
/*
TRAC :DATA? TRACE1
*/
Chapter 3
3-39

Advertisement

Table of Contents
loading

Table of Contents