National Instruments VXI Water System User Manual


 
Chapter 7 Using the NI-VXI Software
©
National Instruments Corporation 7-3 VXI/VME-PCI8022 for Solaris
The function MapVXIAddress() returns a pointer for use with
low-level access functions. It is strongly recommended to use the
VXIpeek() and VXIpoke() macros to access the memory instead of
directly dereferencing the pointer. Using these macros makes the
NI-VXI software more portable between platforms, which can be
handled through the macros. Directly dereferencing the pointers does
not give you any speed benefit because the macros reduce to pointer
dereferences at compile time for the PCI-MXI-2. Refer to the
Compiling Your C Program section later in this chapter for more
information on portability issues, and to your NI-VXI software
reference manual for more information on low-level VXIbus or
VMEbus access functions.
Local Resource Access Functions
By using vxiedit or vxitedit, you can set up the PCI-MXI-2 to
share either the system memory on the motherboard or the onboard
memory on the PCI-MXI-2 with the VXI/VME system. Refer to the
NI-VXI Graphical Utilities Reference Manual or the NI-VXI Text
Utilities Reference Manual for more information on setting these
parameters.
Notice that sharing the system memory with the VXI/VME system does
not mean that the entire range of shared system memory is available to
be used for VXI/VME transfers. You need to be cautious in specifying
the portion of memory you want to share, as some areas are already used
for other purposes.
Caution: Use
VXImemAlloc() to allocate a buffer in the system memory that is
reserved for your use only. Using any range of addresses that was not
returned from
VXImemAlloc() to receive data may cause your computer
to crash or behave incorrectly.
The onboard memory on your PCI-MXI-2, on the other hand, is entirely
available to you. You can obtain the VXI address of your onboard
memory using the
GetDevInfo() function. When you have the
VXI/VME address, you can access that memory using high-level or
low-level VXI/VMEbus access functions.
!