With
E-series boards, a single counter cannot detect both
rising and
falling edges of a signal. To detect both edges of your signal, you will need to use both counters on your device. Wire the
A phase to both GPCTR0 source and GPCTR1 source pins. In your program, create an event counting task for each counter. Enable one counter to count
rising edges and the other to count
falling edges using the following steps.
- Using DAQmx: The Count Edges instance of the DAQmx Create Virtual Channel VI contains the edge parameter, which can be used to configure your counter task to count either rising or falling edges. Select either rising or falling, then add the counts from each counter together to form a total count, reflecting the actual X2 position measurement.
- Using Traditional DAQ: Use the Set Attribute VI in LabVIEW to configure your counter task to count either rising or falling edges. Select source polarity as the attribute ID, and low to high or high to low with the source polarity parameter. Then, in your program, add the counts from each counter together to form a total count, reflecting the actual X2 position measurement.
- Note: M and X Series boards have the ability to count both the rising and falling edges of a signal, as well as support for X1, X2 and X4 encoders. To learn more information about using M Series devices with quadrature encoders, please see the DAQ M Series User Manual below (page 7-14). To learn more about using X Series devices with quadrature encoders, please see the DAQ X Series User Manual below (page 7-21).