Chapter 4
Programming
4-44
©
National Instruments Corporation
5.
Call G0_Arm() to begin the operation
G0_Command_Register
G0_Arm=1;
6.
Call G0_Watch() to perform a reading on the save registers
do {
G0_Command_Register
G0_Save_Trace=0;
G0_Command_Register
G0_Save_Trace=1;
/* Compare the counter content, if they are not the same do the
reading again */
save_1=G0_Save_Registers (24 bits);
save_2=G0_Save_Registers (24 bits);
if (save_1 != save_2)
save_1=G0_Save_Registers (24 bits);
} while (save_1<=10000); // Count until it exceeds 10000
Example 2
This is the example for buffered pulse width measurement. The counter
uses G_In_TimeBase as G_Source to measure the signal's pulse width on
PFI4 (G_Gate), counting the number of the edges that occur on G_Source.
At the completion of each pulse width interval for G_Gate, the HW save
register latches the counter value for software read. An interrupt informs
the CPU after each measurement. Readings are done after each generated
interrupt.
For more information about how to install software interrupt, please see
Analog Output Example 5 or Analog Input Example 3.
1.
Perform General Purpose Counter and Timer Example 1 Steps 1-3.
2.
Call Buffered_Pulse_Width_Measurement() to setup DAC-STC for
buffered pulse width measurement.
Go_Mode_Register
G0_Load_Source=0;
G0_Load_A_Registers (24 bits)
G0_Load_A=0x0000; //initial counter value
G0_Command_Register
G0_Load=1;
Summary of Contents for AT-AI-16XE-10
Page 131: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 2 National Instruments Corporation...
Page 132: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 3 AT MIO E Series RLPM...
Page 133: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 4 National Instruments Corporation...
Page 134: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 5 AT MIO E Series RLPM...
Page 135: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 6 National Instruments Corporation...
Page 136: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 7 AT MIO E Series RLPM...
Page 137: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 8 National Instruments Corporation...
Page 138: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 9 AT MIO E Series RLPM...
Page 139: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 10 National Instruments Corporation...
Page 140: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 11 AT MIO E Series RLPM...
Page 141: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 12 National Instruments Corporation...
Page 142: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 13 AT MIO E Series RLPM...
Page 143: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 14 National Instruments Corporation...
Page 144: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 15 AT MIO E Series RLPM...
Page 145: ...Appendix A OKI MSM82C55A Data Sheet AT MIO E Series RLPM A 16 National Instruments Corporation...
Page 146: ...Appendix A OKI MSM82C55A Data Sheet National Instruments Corporation A 17 AT MIO E Series RLPM...