The busacc.h file, The devinfo.h file, The beginning and end of an ni-vxi program – National Instruments NI-VXI User Manual

Page 29: The busacc.h file -10 the devinfo.h file -10, The beginning and end of an ni-vxi program -10

Advertising
background image

Chapter 2 Introduction to the NI-VXI Functions

NI-VXI User Manual

2-10

© National Instruments Corporation

The busacc.h File

The

busacc.h

file defines constants and macros for use with the

high/low-level and slave memory access functions (see the Master
Memory Access
and Slave Memory Access sections later in this
chapter). To make the code more readable,

busacc.h

defines such

elements as memory space, privilege mode, and byte order as
constants, and it defines macros to combine these constants into the
necessary access parameters. Examine the header file for more
information on the available macros and constants. You can see these
tools in use by reviewing the example programs on memory accesses
that appear later in this chapter and also the example programs
included with your software.

The devinfo.h File

The

devinfo.h

file contains a data type that is used with the

GetDevInfo()

function described in the System Configuration

Functions section in Chapter 3, Software Overview. The purpose of this
function is to return various information about the system.

GetDevInfo()

can return the information either a piece at a time, or in

one large data structure. The header file

devinfo.h

contains the type

UserLAEntry

, which defines the data structure that the function uses.

Refer to the header file for the exact definition of the data structure.

The Beginning and End of an NI-VXI Program

All NI-VXI programs must call

InitVXIlibrary()

to initialize the

driver before using any other functions. You must call

CloseVXIlibrary()

before exiting from your program to free

resources associated with NI-VXI. The first function creates the
internal structure needed to make the NI-VXI interface operational.
When

InitVXIlibrary()

completes its initialization procedures,

other functions can access information obtained by

RESMAN

, the

VXIbus Resource Manager, as well as use other NI-VXI features such
as interrupt handlers and windows for memory access. The second
function destroys this structure and frees the associated memory. All
programs using NI-VXI must call

InitVXIlibrary()

before any

other NI-VXI function. In addition, your program should include a call
to

CloseVXIlibrary()

before exiting.

Advertising