Chapter 4
Programming
4-40
©
National Instruments Corporation
4.
Call
AO_Updating
to program the update interval.
Use the external UPDATE mode.
Set the UPDATE source to PFI5.
5.
Perform Analog Output Example 3 Steps 4-7.
Example 5
This example generates a waveform using interrupts to write data to the
data FIFO.
Initialize the buffer with 3000 points. Use polled writes to write each point
to the data FIFO. Updates occur every 2 milliseconds. Output the buffer
5 times. Confirm operation with an oscilloscope.
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, you need to 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 output.
5.
After the analog output operation completes, you should re-install the
default interrupt handler.
Example Program
1.
Perform Analog Output Example 2 Steps 1-14.
2.
Call
AO_FIFO
to disable the FIFO retransmit and set the FIFO mode.
Joint_Reset_Register
AO configuration start = 1;
AO_Mode_2_Register
AO FIFO Mode = 1;
AO FIFO retransmit enable = 0;
Содержание 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...