01-09-2014 04:44 PM
I am desperately in need of a simple alogorithm to keep count of all transitions from low-to-high on a digital input pin. My program inputs the desired number of transitions and when the count is exceeded then the program terminates.
thanks!!
Lawrob
01-10-2014 07:13 AM
Assuming you are using LabVIEW, you just keep the count and the current state of the digital input in shift registers. When you detect the change, increment the count.
Another alternative is to use a counter. Read the count every so often. I don't remember if DAQmx resets the count on a read. If it does, just add to the count that is stored in a shift register.
What equipment are you using? What language?
01-10-2014 09:13 AM
Thanks crossrulz,
do you have sample algorithm that highlighs what you just recommended?
Thanks!
Lawrob