108
Chapter 4
Programming Examples
X-Series Spectrum Analyzer Mode Programing Examples
X-Series Spectrum Analyzer Mode Programing
Examples
The following examples work with Spectrum Analyzer mode. These
examples use one of the following programming languages: Visual
Basic
®
6, Visual Basic.NET
®
, MS Excel
®
, C++, ANSI C, C#.NET, and
Agilent VEE Pro.
These examples are available in either the “
progexamples
” directory on
the Agilent Technologies Spectrum Analyzer documentation CD-ROM
or the “
progexamples
” directory in the analyzer. The file names for
each example is listed at the end of the example description. The
examples can also be found on the Agilent Technologies, Inc. web site at
URL:
http://www.agilent.com/find/sa_programming
NOTE
These examples have all been tested and validated as functional in the
Spectrum Analyzer mode. They have not been tested in all other modes.
However, they should work in all other modes except where exceptions
are noted.
Programming using Visual Basic
®
6, Visual Basic.NET
®
and MS
Excel
®
:
•
Transfer Screen Images
from your Spectrum Analyzer using Visual
Basic 6
This example program stores the current screen image on the
instrument flash memory as “
D:\PICTURE.PNG
”. It then transfers
the image over GPIB or LAN and stores the image on your PC in the
current directory as “
PICTURE.PNG
”. The file “
D:\PICTURE.PNG
” is
then deleted on the instrument flash memory.
File name:
_screen.bas
•
Binary Block Trace
data transfer from your Spectrum Analyzer
using Visual Basic 6
This example program queries the IDN string from the instrument
and then reads the trace data in Spectrum Analysis mode in binary
format (Real,32 or Real,64 or Int,32). The data is then stored to a file
“bintrace.txt”
. This data transfer method is faster than the
default ASCII transfer mode, because less data is sent over the bus.
File name:
bintrace.bas
Programming using C++, ANSI C and C#.NET:
•
Serial Poll for Sweep Complete
using C++