LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counter issue - keeping track of rollover

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........

0 Kudos
Message 1 of 7
(2,583 Views)

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)

0 Kudos
Message 2 of 7
(2,581 Views)

Thanks for the reply.  Still have the issue with the rollover. Please view the attached.  What am I missing?

0 Kudos
Message 3 of 7
(2,576 Views)

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...

 

0 Kudos
Message 4 of 7
(2,571 Views)

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.

0 Kudos
Message 5 of 7
(2,564 Views)

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

0 Kudos
Message 6 of 7
(2,521 Views)

My second vi right above does the rollover detection. I use Q&R to "simulate" a value that rolls over. Try it!

0 Kudos
Message 7 of 7
(2,515 Views)