Shared memory, Ni-vxi api notes, Compiler symbols – National Instruments VXI-1394 User Manual

Page 29: Shared memory -8, Ni-vxi api notes -8, Compiler symbols -8

Advertising
background image

Chapter 3

Developing Your Application

VXI-1394 User Manual for Windows

3-8

ni.com

Note

viMemAlloc()

or

VXImemAlloc()

returns 32-bit aligned, page-locked,

continuous buffers which work efficiently with the move operations.

Shared Memory

In the Hardware Configuration settings for your controller in MAX, you
can share memory from your computer to the VXI bus. Right-click any
setting or consult the MAX online help for more information. You can
access shared memory on your computer using

viMemAlloc()

in VISA

(or

VXImemAlloc()

in the NI-VXI API). Use MAX to view the VXI

address where your shared RAM is allocated, or determine this information
programmatically using VISA’s

viGetAttribute()

.

NI-VXI API Notes

The following notes apply only if you are using the NI-VXI API. We
recommend that all new VXI/VME applications use the NI-VISA API,
but you can still develop with the older NI-VXI API for compatibility with
legacy code.

Compiler Symbols

You may need to define certain compiler symbols so that the NI-VXI
library can work properly with your program. The required symbol
indicates your operating system platform; for example,

VXINT

designates

the application as a Windows 2000/NT/XP/Me/98 application.

Note

LabWindows/CVI automatically defines the correct symbol. You do not need to

define

VXINT

when using LabWindows/CVI.

The additional symbol

BINARY_COMPATIBLE

is optional. It ensures that

the resulting application is binary compatible with other National
Instruments VXI controllers using the same operating system. This symbol
may cause a slight performance degradation when you use low-level
VXIbus access functions.

You can define these symbols using

#define

statements in your source

code or using the appropriate option in your compiler (typically either

-D

or

/D

). If you use

#define

statements, they must appear in your code

before the line that includes the NI-VXI API header

nivxi.h

.

Advertising