LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an otherway in order to count up?

Solved!
Go to solution

Hi there. 

 

I am using the Labview template "Queued Message Handler project template" which I found awesome so far, but now I kind got into a bit of trouble. 

 

1) Like every 60 seconds, I should write to an CSV file. In the simple example I have attached, I just use the "1 button dialog" prompt to simulate that CSV write. 

 

2) This function runs inside one of the cases in the while loop of the "UI Message Loop", which is shown below:

 

ChristianLiinHansen_0-1635151651286.png


So what I would like to achieve is the following: 

 

1) No delaying other loops by using timer etc, but perhaps the thing that I have attached. However, is there not any danger with using the i-counter? What happens, when the application has been running for a couple of days, month and year? 

So I get about 100.000 iterations counted per sec on my PC, and well if the i-counter is 2^32 = 4294967296, it will then take about 11 hours (without delay), before this counter reach max. 

Then what happens then after 11 hours?

 

ChristianLiinHansen_1-1635152267470.png


Update: I found this: https://www.youtube.com/watch?v=_GghNq9UmUg&ab_channel=Sixclear 
What that not just be the idea to solve my problem? 🙂 

0 Kudos
Message 1 of 4
(643 Views)

Please do share the code in Lower Version (LV 2017).

 

Note: You can use Timer Engine  to calculate 60 Sec, instead going with Loop time.

 

Don't use i as your iteration since you don't have control on the count increment.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 4
(632 Views)

In stead of using the iterator, put your own counter value in a shift register or shift register. Make it an U64...

 

It will still wrap, but I wouldn't wait for it...

 

U64 Counter.png

 

0 Kudos
Message 3 of 4
(610 Views)
Solution
Accepted by topic author ChristianLiinHansen

Hi there. 

 

So basically the solution to this problem, was basically just to make a "Timeout" from the event loop. 

Then I am using a global variable" in order to check if the user has pressed a "Connection" button. 
So each (now in this case it is 5sec) timeout simply just do what I want 🙂

ChristianLiinHansen_0-1635325039529.png

 

0 Kudos
Message 4 of 4
(547 Views)