Example 2 - National Instruments PCI E Series Programmer's Manual

Register-level programmer manual, multifunction i/o boards for pci bus computers, register-level
Hide thumbs Also See for PCI E Series:
Table of Contents

Advertisement

Example 2

© National Instruments Corporation
Interrupt_A_Enable_Register
G0_TC_Interrupt_Enable = 0;
G0_Gate_Interrupt_Enable = 0;
5.
Call
to begin the operation.
G0_Arm()
G0_Command_Register
G0_Arm=1;
6.
Call
G0_Watch()
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, read 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
This is the example for buffered pulsewidth measurement.
The counter uses G_In_TimeBase as G_Source to measure the signal's
pulsewidth on PFI4 (G_Gate), counting the number of edges that occur on
G_Source. At the completion of each pulsewidth interval for G_Gate,
software reads the counter values from the HW_Save_Registers. An
interrupt occurs after each measurement. Readings are done after each
generated interrupt.
For more information about how to install the software interrupt, please see
Example 5 in the
Analog Output
section.
1.
Perform General Purpose Counter and Timer Example 1 Step 1
through 3.
2.
Call
Buffered_Pulse_Width_Measurement()
DAQ-STC for buffered pulse width measurement.
Go_Mode_Register
G0_Load_Source=0;
to read the save registers.
section, or Example 3 in the
4-47
Chapter 4
Programming
Analog Input
to set up the
PCI E Series RLPM

Advertisement

Table of Contents
loading

Table of Contents