Chapter 4
Developing Your Application
4-4
www.ni.com
Programming with VXI
National Instruments provides two different programming interfaces
for accessing your instruments: NI-VISA and NI-VXI. NI-VISA is the
National Instruments implementation of the VISA API as defined by the
VXI
plug&play
standard. It is very useful when you have different types
of instruments in your system (such as VXI, VME, GPIB, and Serial
devices) because the NI-VISA functions have the same interface.
NI-VXI is the National Instruments proprietary interface for programming
VXI/VME instruments. Both NI-VXI and NI-VISA grant you
register-level access of VXI/VME instruments as well as messaging
capability to message-based devices. With either interface you can service
asynchronous events, such as triggers and interrupts, and also assert them.
The best way to learn how to program with NI-VXI or NI-VISA is by
reviewing the example programs included in your software. In the
Examples
directory you will find examples for many different types of
applications. If you are just getting started, you should first learn how to
access registers with high-level calls and send messages with word serial
functions. The NI-VISA examples of these tasks are called
VISAhigh.c
and
VISAws.c
. The NI-VXI examples are called
VXIhigh.c
and
VXIws.c
. You should use the other examples as you try more advanced
techniques. Consult the
NI-VISA User Manual
or the
NI-VXI User Manual
for additional information on these topics.
Note
The NI-VXI User Manual resides in the
NIVXI\manuals
directory, and the
NI-VISA User Manual is in the
VXIpnp\
os
\NIvisa\manuals
directory, where
os
would be either
Win95
or
WinNT
. Use the Acrobat Reader program to open and navigate
through the manuals.
Table 4-1 summarizes the topics addressed by the example programs.
Table 4-1.
NI-VXI/VISA Examples
Coverage
NI-VISA
Example
NI-VXI Example
Message-Based Access
VISAws.c
VXIws.c
High-Level Register Access
VISAhigh.c
VXIhigh.c
Low-Level Register Access
VISAlow.c
VXIlow.c
Sharing Memory
VISAmem.c
VXImem.c