01-21-2012 12:35 PM
Hello,
Using LabVIEW and monitoring a device that counts upto 4095 (2 ^12-1) and then rollsover. Each time it rolls over I need to increment a counter I guess. Would also need to decrement and track numbers.
So 1,2,3,4,....4095 rollover 4096 + 1,2,3,4,....8190 rollover......
Looked on the forum without result or clues.
Thanks for your time........
01-21-2012 12:46 PM
Use a shift regsiter and compare the current and previous. If the current is smaller than the previous, increment a counter in another shift register.
(Sorry, I cliecked the "me too" by accindent I don't know how to revert)
01-21-2012 01:23 PM
Thanks for the reply. Still have the issue with the rollover. Please view the attached. What am I missing?
01-21-2012 02:19 PM - edited 01-21-2012 02:20 PM
How exactly are you calling this subVI? Can you attach an example?
(Why is your counter value orange. It should be an integer, right?)
Here's the simplest possibility. Maybe you can adapt it to your problem...
01-21-2012 02:46 PM - edited 01-21-2012 02:54 PM
Here's a simple version using a subVI.
The main VI increments a value with a random positive number that rolls over at 4095. The subVI counts rollovers. Modify as needed.
01-25-2012 09:38 AM
Thanks for the vi. Why the sub vi tracking rollovers? Isn't that the rollover part of the Q&R function? Should of realized to use the Q&R?
My problem exists with the lack of catching 4095 as the rollover amount. Data shows readings of difference of 1 to 2 bits. Any ideas?
DG
01-25-2012 10:23 AM
My second vi right above does the rollover detection. I use Q&R to "simulate" a value that rolls over. Try it!