
Chapter 3
Developing Your Application
3-6
ni.com
For the Microsoft C compiler:
/DVXINT /DBINARY_COMPATIBLE
For the Borland C compiler:
-DVXINT; BINARY_COMPATIBLE;
You also need to link in the appropriate import library for your code. If you
are using a Microsoft C compiler, use the
nivxint.lib
in the
Program
Files\National Instruments\VXI\NIVXI API\Win32\msc\
directory. If you are using a Borland C compiler, use the
nivxint.lib
in the
...\win32\borlandc\
directory.
Refer to the documentation that came with your compiler package for
detailed instructions about using the compiler and the various tools (linker,
debugger, and so on). Your compiler documentation is an important and
useful source of information for writing, compiling, and debugging
C programs.
Window Mapping
The MITE architecture allows a lot of flexibility in low-level mapping
of VXI address spaces. In particular, the CPU interface of the MITE has
windows that can be dynamically resized and relocated from CPU space
to VXI space. The low-level functions have extensions that reflect this
feature. Refer to the NI-VXI online help for information about these
functions in NI-VXI. The NI-VISA online help and the
NI-VISA
Programmer Reference Manual
cover this information for NI-VISA
applications. As mentioned earlier, you can use the Acrobat Reader 3.0
to view and navigate through this manual.
The functions
MapVXIAddress()
and
viMapAddress()
check whether
a window that can be shared already maps to the desired address space and
location. If so, they return a pointer to that window. If the desired space is
not already mapped, they set up a new MITE window to the VXI address
and return a pointer to the new window.
The
MapVXIAddressSize()
function is the standard mechanism for
specifying how large a window the driver should map on a call to
MapVXIAddress()
. The default size of a mapped window when using
NI-VXI is 64 KB. In VISA, you specify the window size directly in
viMapAddress()
.
The success of this allocation depends on the availability of three factors:
•
Address space in the User Window
•
Number of MITE windows
•
Memory for allocating data structures for the map