![HP E4401B Programmer'S Manual Download Page 67](http://html.mh-extra.com/html/hp/e4401b/e4401b_programmers-manual_161548067.webp)
Chapter 3
3-3
Programming Examples
C Programming Examples using VTL
C Programming Examples using VTL
The programming examples that are provided in this guide are written
using the C programming language and the VTL (VISA transition
library). This section includes some basic information about
programming in the C language. Refer to your C programming
language documentation for more details. (This information is taken
from the manual “HP VISA Transition Library”, HP part number
E2090-90026.) The following topics are included:
“Typical Example Program Contents”
“Compiling and Linking a VTL Program”
“Including the VISA Declarations File”
Typical Example Program Contents
The following is a summary of the VTL function calls used in the
example programs.
visa.h
This file is included at the beginning of the file to
provide the function prototypes and constants defined
by VTL.
ViSession
The
ViSession
is a VTL data type. Each object that
will establish a communication channel must be
defined as
ViSession
.
viOpenDefaultRM
You must first open a session with the default
resource manager with the
viOpenDefaultRM
function. This function will initialize the default
resource manager and return a pointer to that resource
manager session.
viOpen
This function establishes a communication channel
with the device specified. A session identifier that can
be used with other VTL functions is returned. This call
must be made for each device you will be using.
viPrintf
viScanf
These are the VTL formatted I/O functions that are
patterned after those used in the C programming
language. The
viPrintf
call sends the IEEE 488.2
*RST
command to the analyzer and puts it in a known
state. The
viPrintf
call is used again to query for the
Summary of Contents for E4401B
Page 6: ...vi ...
Page 14: ...xiv Contents ...
Page 64: ...2 34 Chapter2 HP ESA Status Registers Using the Analyzer Status Registers ...
Page 65: ...3 1 3 Programming Examples ...
Page 151: ...4 1 4 Programming Command Cross References ...
Page 286: ...5 132 Chapter5 Language Reference UNIT Subsystem ...
Page 287: ...6 1 6 HP 8590 HP ESA Spectrum Analyzers Programming Conversion Guide ...
Page 292: ...1 HP 8590 HP ESA Spectrum Analyzers Conversion Guide ...
Page 368: ...7 1 7 Error Messages ...
Page 393: ...7 26 Chapter7 Error Messages 201 to 799 Device Specific Errors ...