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
Содержание 54620A
Страница 6: ...6 ...
Страница 9: ...1 Introduction to Programming ...
Страница 21: ...2 Programming Getting Started ...
Страница 35: ...3 Programming over HP IB ...
Страница 40: ...40 ...
Страница 41: ...4 Programming over RS 232 C ...
Страница 48: ...48 ...
Страница 49: ...5 Programming and Documentation Conventions ...
Страница 53: ...Programming and Documentation Conventions The command tree 53 ...
Страница 60: ...60 ...
Страница 61: ...6 Status Reporting ...
Страница 63: ...Status Reporting Data Structures Figure 4 Status Reporting 63 ...
Страница 68: ...68 ...
Страница 69: ...7 Installing and Using the Programmer s Reference ...
Страница 76: ...76 ...
Страница 77: ...8 Programmer s Quick Reference ...