Chapter 3
Developing Your Application
3-8
ni.com
The DMA channels can transfer data between a VXI device and local
memory, or between VXI devices. The DMA channel can handle
contiguous or noncontiguous local memory. If it is handling noncontiguous
memory, it can perform scatter-gather operations on the noncontiguous
memory.
The
VXImove()
and
viMove/XX()
functions automatically use
appropriate bus protocols and transfer types to efficiently perform the data
transfer specified in the function. You can also use configuration options
in MAX to instruct the NI-VXI/VISA software to use DMA channels for
particular types of operations and to designate what protocols the channel
should use. In addition, you can programmatically control which protocols
to use in NI-VXI. See the NI-VXI online help for complete descriptions of
VXImove()
and other high-level functions. Notice that previously written
NI-VXI and NI-VISA code uses the DMA capabilities of the MITE without
modification.
To take full advantage of the throughput of the DMA channels, you should
perform 32-bit transfers where both the source and the destination are
longword aligned. If you need to transfer character data between devices of
different byte orders—for example, between a big-endian device and an
Intel 80
x
86-based Windows NT PC—transfer the data as longwords but
adjust the byte-ordering parameters in
VXImove()
to get the correct data
in the most efficient manner.
NI-VXI examples:
/* Transferring 32-bit data to a big-endian A32 device */
VXImove(0x0, userBuffer, 0x3, deviceOffset,
numDataPoints, 4);
/* Transferring 8-bit data to a big-endian A32 device */
VXImove(0x80, userBuffer, 0x3, deviceOffset,
numDataPoints / 4, 4);
Shared Memory
In the
Hardware Configuration
settings of the VXI-8340 series in MAX,
you can share memory on your computer or from DRAM added to the
VXI-8340 series. Right-click on any of the settings or consult the online
help in MAX for more information. You can access shared memory on your
computer using
VXImemAlloc()
in NI-VXI and
viMemAlloc()
in VISA.