92
Chapter 2
Programming Fundamentals
C Programming Examples using VTL
The following is an example of opening a device session with the GPIB
device at primary address23.
ViSession defaultRM, vi;
.
.
viOpenDefaultRM (&defaultRM);
viOpen (defaultRM, “GPIB0::23::INSTR”, VI_NULL,VI_NULL,&vi);
.
.
viClose(vi);
viClose (defaultRM);
Closing a Session
The
viClose
function must be used to close each session. You can close
the specific device session, which will free all data structures that had
been allocated for the session. If you close the default resource manager
session, all sessions opened using that resource manager will be closed.
Since system resources are also used when searching for resources
(
viFindRsrc
) or waiting for events (
viWaitOnEvent
), the
viClose
function needs to be called to free up find lists and event contexts.
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 ...