84
Chapter 2
Programming Fundamentals
C Programming Examples using VTL
C Programming Examples using VTL
The programming examples that are provided are written using the C
programming language and the HP/Agilent 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 “VISA Transition Library”, part number
E2090-90026.) The following topics are included:
“Typical Example Program Contents” on page 84
“Linking to VTL Libraries” on page 85
“Compiling and Linking a VTL Program” on page 86
“Example Program” on page 88
“Including the VISA Declarations File” on page 88
“Opening a Session” on page 89
“Device Sessions” on page 89
“Addressing a Session” on page 91
“Closing a Session” on page 92
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.
Summary of Contents for E4406A VSA Series
Page 4: ...4 ...
Page 59: ...59 2 Programming Fundamentals ...
Page 124: ...124 Chapter2 Programming Fundamentals Using the LAN to Control the Analyzer ...
Page 125: ...125 3 Programming Examples ...
Page 164: ...164 Chapter3 Programming Examples Using Java Programming Over Socket LAN ...
Page 165: ...165 4 Programming Command Cross References ...
Page 379: ...379 6 Error Messages ...
Page 412: ...412 Chapter6 Error Messages Error Message Descriptions ...