Program overview
The first few lines of the program include header files that define function
prototypes for standard C libraries and specialized libraries that handle the
HP-IB interface. The program then defines variables for the interface select
code (
isc
), analyzer address (
analyzer
), and error handling.
The
errorhandle()
function takes two strings defining the program
function and analyzer command string. If the global
error
variable is
non-zero, it prints (to the controller screen) an error message that includes
this information. It then forces the program to exit.
The
sendstringcmd()
function encapsulates data tranmission to the
instrument with error handling. First it calls the HP-IB library function
IOOUTPUTS
to send the specified command string (passed through
cmd
) to
the analyzer. The result of the
IOOUTPUTS
call is returned to the error
variable, so the
errorhandle
function is called to process the error (if one
occurred).
The
main()
function initializes the interface select code and analyzer
address variables. It then calls HP-IB library functions
IORESET
,
IOTIMEOUT
,
and
IOCLEAR
to initialize the HP-IB card (and check for proper initialization).
Then the
sendstringcmd
function is called several times to reset the
analyzer, set the trigger mode to normal, define an edge trigger on the rising
edge of channel 0, and invoke the autoscale feature.
Programming Getting Started
Program overview
27
Summary of Contents for 54620A
Page 6: ...6 ...
Page 9: ...1 Introduction to Programming ...
Page 21: ...2 Programming Getting Started ...
Page 35: ...3 Programming over HP IB ...
Page 40: ...40 ...
Page 41: ...4 Programming over RS 232 C ...
Page 48: ...48 ...
Page 49: ...5 Programming and Documentation Conventions ...
Page 53: ...Programming and Documentation Conventions The command tree 53 ...
Page 60: ...60 ...
Page 61: ...6 Status Reporting ...
Page 63: ...Status Reporting Data Structures Figure 4 Status Reporting 63 ...
Page 68: ...68 ...
Page 69: ...7 Installing and Using the Programmer s Reference ...
Page 76: ...76 ...