Example 3 - National Instruments PCI E Series Programmer's Manual

Register-level programmer manual, multifunction i/o boards for pci bus computers, register-level
Hide thumbs Also See for PCI E Series:
Table of Contents

Advertisement

Chapter 4
Programming

Example 3

PCI E Series RLPM
9.
Call
AI_Arming
AI_Command_1_Register
AI SC arm = 1;
AI SI arm = 1;
AI SI2 arm = 1;
AI DIV arm = 1;
10. The function
AI_Start_The_Acquisition
process.
AI_Command_2_Register
AI START1 Pulse = 1;
11. Poll the AI FIFO not empty flag in the AI_Status_1_Register until not
empty and read the ADC FIFO data in the ADC_FIFO_Data_Register.
Do
{
If (AI FIFO not empty) then
read FIFO data;
} while (20 samples have not been read)
Example 3 performs the same acquisition as Example 2, but with
interrupts.
Acquire 5 scans at a scan interval of 1 ms. The scan list contains channels
5, 4, 1, and 0 respectively. The channels are configured as RSE at a gain of
1. Within each scan, the sample interval should be 100 µs. Dithering should
remain off during the operation. No external multiplexers are used. Use
interrupts to acquire the data.
Only minor modifications to Analog Input Example 2 are needed for this
example. Instead of installing the interrupt service routine (ISR) as an
interrupt, this example emulates the operation of the interrupt by polling the
status register in the DAQ-STC. When the status register indicates an
interrupt, the main loop transfers control to the ISR. To use the example
ISR as an actual interrupt, learn how to install software interrupts on your
system. Generally, the procedure is as follows:
1.
Determine the software interrupt number corresponding to the IRQ
line you are using.
2.
Use the OS specific functions such as
DOS to replace the default interrupt handler with your ISR. You should
disable interrupts during this step.
3.
Reset the interrupt controller hardware.
to arm the analog input counter.
getvect()
4-14
starts the acquisition
and
setvect()
© National Instruments Corporation
for

Advertisement

Table of Contents
loading

Table of Contents