Chapter 4
Programming
©
National Instruments Corporation
4-13
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
getvect()
and
setvect()
functions to replace the default
interrupt handler with your ISR. You should disable interrupts during
this step.
3.
Reset the interrupt controller hardware.
4.
Perform your analog input.
5.
After the analog input operation completes, you should re-install the
default interrupt handler.
Example Program
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;
5.
The function
AI_Scan_Start
selects the scan start event.
Joint_Reset_Register
AI configuration start = 1;
Содержание AT-AI-16XE-10
Страница 131: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 2 National Instruments Corporation...
Страница 132: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 3 AT MIO E Series RLPM...
Страница 133: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 4 National Instruments Corporation...
Страница 134: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 5 AT MIO E Series RLPM...
Страница 135: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 6 National Instruments Corporation...
Страница 136: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 7 AT MIO E Series RLPM...
Страница 137: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 8 National Instruments Corporation...
Страница 138: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 9 AT MIO E Series RLPM...
Страница 139: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 10 National Instruments Corporation...
Страница 140: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 11 AT MIO E Series RLPM...
Страница 141: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 12 National Instruments Corporation...
Страница 142: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 13 AT MIO E Series RLPM...
Страница 143: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 14 National Instruments Corporation...
Страница 144: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 15 AT MIO E Series RLPM...
Страница 145: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 16 National Instruments Corporation...
Страница 146: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 17 AT MIO E Series RLPM...