Using ni-vxi, Header files, The datasize.h file – National Instruments NI-VXI User Manual

Page 28: Using ni-vxi -9, Header files -9, The datasize.h file -9

Advertising
background image

Chapter 2 Introduction to the NI-VXI Functions

© National Instruments Corporation

2-9

NI-VXI User Manual

Using NI-VXI

This section presents a general overview of the more commonly used
class of functions available in NI-VXI. Additional information
summarizes how you can use the functions to perform certain tasks and
further describes the general structure of NI-VXI programming.

Header Files

Although

nivxi.h

is the only header file you need to include in your

program for NI-VXI, the software distribution actually includes several
additional header files along with

nivxi.h

. Some of these files have

type definitions and macros that can make using NI-VXI easier, and
make the code more portable across different platforms. The three main
files of interest are

datasize.h

,

busacc.h

, and

devinfo.h

.

The datasize.h File

The

datasize.h

file defines the integer types for use in your

program. For example, INT16 is defined as a 16-bit signed integer, and
UINT32 is defined as a 32-bit unsigned integer. Using these types
benefits you by letting you apply specific type sizes across platforms.
Using undefined types can cause problems when porting your
application between platforms. For example, an int in DOS is a 16-bit
number but a 32-bit number in Solaris or LabWindows/CVI.

In addition to the integers,

datasize.h

defines several types for other

uses such as interrupt handlers. For example,

NIVXI_HVXIINT

is an

interrupt handler type. Merely defining a variable with this type is
sufficient to create the function prototype necessary for your interrupt
handler. Also, different platforms require different flags for use with
interrupt handlers. To simplify this problem,

datasize.h

defines

NIVXI_HQUAL

and

NIVXI_HSPEC

, which are used in the handler

definition and take care of the platform dependencies. See the
Interrupts and Signals section later in this chapter and your

read me

file for more information. In addition, refer to Chapter 3, Software
Overview
for specific information.

Advertising