Chapter 3
Developing Your Application
PCI-Based MXI-2 Interfaces for Windows 2000/NT/Me/98
3-8
ni.com
•
To optimize move performance on virtual memory systems, lock the
user buffer in memory yourself so the move operation does not need to
lock the buffer.
•
To optimize move performance on paged memory systems, use a
contiguous buffer so the move operation does not need to build a
scatter-gather list for the user buffer.
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 on your computer or from DRAM added to the
PCI-MXI-2 or VXI-MXI-2 if you have any installed. Right-click on 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).
Note that the
viMemAlloc()
function allocates RAM from the
workstation’s system RAM, not from the onboard RAM on the controller.
To access onboard RAM on the controller, use it as if it is VXI
memory—that is, by using high-level or low-level VXIbus access
functions. Use MAX to view the VXI address space and base address of the
controller’s RAM, 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/Me/98 application.
Note
LabWindows/CVI automatically defines the correct symbol. You do not need to
define
VXINT
when using LabWindows/CVI.