Can I Use an Analog Input for a Count Edges or Encoder Task Using DAQmx? Primary Software: Driver Software>>NI-DAQmxPrimary Software Version: 7.1 Primary Software Fixed Version: N/A Secondary Software: LabVIEW Development Systems>>Base Package Hardware: Multifunction DAQ (MIO)
Problem: I need to create a count edges or an encoder task but I do not have any available counters. Can I use an analog input (or resolver signal) to create a task for counting edges or for reading an encoder? Solution: You can analyze data from an analog input task to count edges or read an encoder, however using a counter is preferred if one is available. Counters perform hardware edge detection/counting which provides better accuracy than the solution discussed in this document. The analog input method described below may be beneficial in the following situations:
To count the edges of your signal, first set up a continuous buffered acquisition analog input task. You will want to sample as quickly as possible to obtain a clear representation of the signal. Compare each sample to a set threshold to analyze for edge detection. When the signal crosses the threshold (sequential samples lie on either side of the threshold), increment or decrement your count value depending on the specified count direction. In the attached LabVIEW example, count direction is software controlled, however it can be easily modified for external control using another analog input (for example if you want to connect a quadrature encoder). Note: there are two limitations when using this software method:
Related Links: KnowledgeBase 2I5DAAXA: Is It Possible to Count Non-TTL Pulses with an E Series Data Acquisition Board? Attachments:
Report Date: 03/12/2007 Last Updated: 09/25/2007 Document ID: 47B5TIMK |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
