beautypg.com

System configuration tools, System configuration tools -11 – National Instruments NI-VXI User Manual

Page 30

background image

Chapter 2 Introduction to the NI-VXI Functions

© National Instruments Corporation

2-11

NI-VXI User Manual

An important note about these two functions is that the internal
structure maintains a record of the number of calls to

InitVXIlibrary()

and

CloseVXIlibrary().

Although

InitVXIlibrary()

needs to be called only once, the structure of

your program may cause the function to be called multiple times. A
successful call to

InitVXIlibrary()

returns either a zero or a one. A

zero indicates that the structure has been created, and a one indicates
that the structure was created by an earlier call so no action was taken
(other than incrementing the count of the number of

InitVXIlibrary()

calls).

When

CloseVXIlibrary()

returns a successful code, it also returns

either a zero or a one. A zero indicates that the structure has been
successfully destroyed, and a one indicates that there are still
outstanding calls to

InitVXIlibrary()

that must be closed before

the structure is destroyed. The outcome of all of this is that when
exiting a program, you should call

CloseVXIlibrary

() the same

number of times that you have called

InitVXIlibrary()

.

Caution:

In environments where all applications share NI-VXI, and hence the
internal structure (such as Microsoft Windows), it can be dangerous for
any one application to call

CloseVXIlibrary()

until it returns zero

because this can close out the structure from under another application. It
is vital to keep track of the number of times you have called

InitVXIlibrary()

.

System Configuration Tools

The System Configuration Functions section of Chapter 3, Software
Overview
, describes functions that a program can use to access
information about the system. This is obtained either through
configuration information or from information obtained by

RESMAN

.

Armed with these functions, a program can be more flexible to changes
within the system.

Note:

The examples in this manual do not check for either warnings or errors in
most of the functions’ return codes. This step is omitted only to simplify
the example programs. We strongly recommend that you include error
checking in your own programs.