
Appendix B
Register-Level Programming
DAQCard-DIO-24 User Manual
B-6
©
National Instruments Corporation
Programming
This section presents programming information for the
DAQCard-DIO-24 and includes program examples written in C.
PC Card Initialization
Before you can access the digital I/O circuitry on the
DAQCard-DIO-24, the card must be activated using Card Services. The
I/O PC Cards are kept inactive until a program has requested that Card
Services activate the card by assigning an interrupt level and an address
space for the card I/O registers. The DAQCard-DIO-24 requires
a 32-byte I/O address window and one interrupt level.
If you are using a PC, there are at least two different ways to activate
the card:
•
If you are using the DAQCard-DIO-24 with National Instruments
software such as NI-DAQ or LabVIEW, the NI-DAQ device driver
requests the card activation. For more information about this
procedure, see the Device Configuration section in your NI-DAQ
User Manual for PC Compatibles.
•
If this option is not feasible for your application, you can develop
your own program to activate the card. However, this is fairly
complicated and requires significantly more programming. If you
develop your own program, consult the PC Card Standard, Socket
Services Specifications, which explains how to activate a card using
system-level calls. Request an I/O window, an interrupt level, and
a configuration. In the configuration, the configuration index
should be set to 01 hex for normal operation.
If you are using a Macintosh, there are at least two different ways to
activate the card:
•
If you are using the DAQCard-DIO-24 with National Instruments
software such as NI-DAQ or LabVIEW, the NI-DAQ device driver
requests the card activation. For more information about this topic,
see the Device Configuration section in the NI-DAQ Software
Reference Manual for Macintosh.
•
You can develop your own program to activate the card. However,
this is fairly complicated, and it requires significantly more
programming. If you develop your own program, consult the PC
Card Standard, Socket Services Specifications, which explains how
to activate a card using system-level calls, and the PC Card