Chapter 4
Programming
4-44
©
National Instruments Corporation
Joint_Reset_Register
AO configuration start = 0;
AO configuration end = 1;
3.
Call
Kick_Start_FIFO
to initialize the virtual FIFO boards.
if (VirtualFIFO)
AO_DAC_FIFO_Data = 0;
4.
Call
AO_Arming
to arm the counters and preload the DAC with the
first analog output value.
AO_Mode_3_Register
AO not an UPDATE = 1;
AO_Mode_3_Register
AO not an UPDATE = 0;
if (!VirtualFIFO)
Wait until DACs have been preloaded.
AO_Command_1_Register = 0x554;
5.
Program the DAQ-STC to generate interrupts on the FIFO condition.
Interrupt_B_Enable_Register
AO FIFO interrupt enable = 1;
Interrupt_Control_Register
Interrupt B output select = IRQ number;
Interrupt B enable = 1;
6.
Install the interrupt service routine to handle the interrupt.
service_interrupt()
Do
{
If (AO FIFO not full) {
AO_DAC_FIFO_Data = data;
increment data index counter;
}
} while (AO FIFO not full && total point have not been written)
7.
Call
AO_Start_The_Acquisition
to pulse the software START1
trigger.
AO_Command_2_Register
AO START1 pulse = 1;
8.
Poll the AO FIFO half full flag in the AO_Status_1_Register until half
full and call the ISR.
If (AO FIFO half full) then
call service_interrupt;