Chapter 4
Programming
©
National Instruments Corporation
4-49
if (buffer is not done and buffer is not full) then
{
current buffer value =save_1;
increase buffer pointer;
}
if (all the points have been written into the buffer) then
{
G0_Command_Register
G0_Disarm=1;
indicate buffer done;
}
Interrupt_A_Ack_Register
G0_Gate_Interrupt_Ack <=1;
/*read G_Status_Register and check for the G0_Gate_Error_St bit if
the bit is set means the hardware saves are too fast */
if (G0_Gate_Error_St==1)
{
Interrupt_A_Ack_Register
G0_Gate_Error_Confirm <=1;
}
if (G0_TC_St==1){
/*rollover error - counter value is not correct */
confirm user rollover has occurred.
Interrupt_A_Ack_Register
G0_TC_Interrupt_Ack<=1;
}
5.
Call
ISR
in a do-while loop.
do
{
call Buffered_Pulse_Width_Measurement_ISR();
} while (the buffer is not done);
print out the buffer values.
Example 3
This is the example for continuous pulse train generation.
It generates continuous pulses on the
G_Out
pin with a three clock delay
from the trigger, pulse interval of four clocks, and pulsewidth of three
clocks.
G_in_timebase
(20 MHz) is
G_source
. The waveform