Chapter 4
Programming
4-12
©
National Instruments Corporation
12. Call the function
Clear_FIFO
to clear the ADC FIFO.
Write_Strobe_1_Register
Write strobe 1 = 1;
13. Now start the acquisition with
AI_Start_The_Acquisition
.
AI_Command_1_Register
Convert Pulse = 1;
14. 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 (FIFO not read)
Example 2
Example 2 illustrates the manner in which to program the STC for
scanning.
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
polled input to acquire the data.
1.
Perform Analog Input Example 1 Step 1.
2.
Perform Analog Input Example 1 Step 2 for each channel in the scan
list. Only channel 0 has Last channel set to 1.
3.
Perform Analog Input Example 1 Steps 3-9.
4.
Call the function
Number_of_Scans
to load the number of scans.
Joint_Reset_Register
AI configuration start = 1;
AI_SC_Load_A_Registers (24 bits)
Number of posttrigger scans -1 = 4;
AI_Command_1_Register
AI SC Load = 1;
Joint_Reset_Register
AI configuration start = 0;
AI configuration end = 1;