LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid Tick Count overflow?

Solved!
Go to solution

Hi.

 

I was warned some time ago about using Tick Count as basis for a while structure timeout, since Tick Count overflows every 49 days or so.  Since then I've had a bad taste in my mouth about using it, and I wonder what I can do about it.  I've tested a bit with comparing the Tick Count value with the wanted timeout and subtracting the timeout value from the Tick Count value if it would cause Tick Count to overflow.  But the code gets to be more than a little bit messy, and not very flexible.  Just see the attached VI.  Does anyone have a good solution on how to get around this problem?

 

I found this blog article from a guy who made a 32 to 64 bit conversion VI, and it seems to be right up my ally.  But I haven't been able to duplicate it since I don't recognize all the symbols (especially the little round one connected to the leftmost case structure).

 

0 Kudos
Message 1 of 5
(6,941 Views)
Solution
Accepted by ojohnsen

That wanring should be interpreted such that you should not expect the value to be always increasing.  

 

The difference between two ms tick counts will work out even durring the over-folw becuase that is the way the math works out for a U32. So if you subtract the start from teh current you can still compare that difference with another to see if a certain amout of time has passed.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 5
(6,934 Views)

ojohnsen a écrit:

I found this blog article from a guy who made a 32 to 64 bit conversion VI, and it seems to be right up my ally.  But I haven't been able to duplicate it since I don't recognize all the symbols (especially the little round one connected to the leftmost case structure).


 

It is First Call ?

 

You can use Get Date/Time in seconds for applications that must run for a long time.

Message Edité par JB le 25-03-2010 03:40 PM
Message 3 of 5
(6,929 Views)

Try this simple exercise.

 

Subtract U32.PNG

 

Do you still see any need for extra code?

Message 4 of 5
(6,920 Views)
I have to say, I'm a little bit stumped over that the solution was that simple and obvious (or at least, ought to have been). 🙂  Thanks for your help, guys!
0 Kudos
Message 5 of 5
(6,914 Views)