Appendix B
Register-Level Programming — Programming
PCI-DIO-96/PXI-6508/PCI-6503 User Manual
B-14
ni.com
Programming
This section contains instructions on how to operate your DIO board circuitry, and examples
of the programming steps necessary to execute an operation. If you are not using NI-DAQ,
you must first initialize your board.
Programming your DIO board involves writing to and reading from registers on the board.
The
section contains a listing of these registers. For additional
programming examples, including initialization, refer to the Measurement Hardware Driver
Development Kit (MHDDK) examples. To access the MHDDK, go to
ni.com/info
and
enter the info code
mhddk
.
PCl Local Bus
The PCI-DIO-96, PXI-6508, and PCI-6503 are fully compatible with the
PCI Local Bus
Specification
, Revision 2.1, from the PCI Special Interest Group (SIG). The PXI-6508 is fully
compliant with the National Instruments
PXI Specification
, Revision 1.0. All three boards use
the PCI Local Bus to move data. The PCI Local Bus is a high performance, 32-bit bus with
multiplexed address and data lines. The PCI system arbitrates and assigns resources through
software, freeing you from manually setting switches and jumpers. Bus-related resources
must be configured before you attempt to execute a register-level program. This entails
assigning a base address and interrupt channel to your DIO board.
Programming Examples
The programming examples in this section demonstrate the programming steps needed to
perform several different operations. The instructions are language independent; that is, they
tell you to read or write a given register or to detect if a given bit is set or cleared, without
presenting the actual code. The information given is not intended to be used without proper
modification in a practical solution.
Before you can implement any of the examples into a real application, you must know the
base memory address for your board. To generate and process any interrupts, you must write
and install an applicable interrupt service routine.
Note
In this appendix, all numbers preceded by 0x are hexadecimal.