User manual

© National Instruments Corporation F-1 VXI-MXI-2 User Manual
DMA Programming
Examples
F
Appendix
This appendix contains two example programs for using the DMA
controllers on the VXI-MXI-2. If you are using a version of the
National Instruments NI-VXI software that has remote DMA controller
functionality, this information is not necessary because you can make
use of the VXI-MXI-2 module’s DMA controllers from the NI-VXI
high-level function calls.
Overview of Programming Examples
The DMA controllers each have registers that define the source and
destination of the data. Data is always transferred from the source to the
destination during a DMA operation. The DMA controllers can transfer
data between devices located on different buses—VMEbus, MXIbus,
and DRAM onboard the VXI-MXI-2—as well as between devices
located on the same bus. The only limitation regarding location of the
devices is that MXIbus synchronous burst transfers cannot be used for
either the source or destination when both devices are located on the
MXIbus. The source and destination can each use differing data widths,
address spaces, and transfer types (single or block) during a DMA
operation. Detailed descriptions of each DMA register can be found in
the VXIbus A24/A32 Registers section of Chapter 5, Register
Descriptions.
The only difference between the two examples in this appendix is that
Example 1 does not make use of the DMA interrupt; Example 2 does
show this functionality. The examples use pseudo code that mostly
resembles the C language. Constant numbers in the examples preceded
by
0x
are in hexadecimal notation. Both examples contain the two
functions write and read. These are meant to represent the method
for performing VMEbus or MXIbus data transfers to (write) and from
(read) devices.