10-25-2021 04:01 AM
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:
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?
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? 🙂
Solved! Go to Solution.
10-25-2021 04:32 AM
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.
10-25-2021 05:11 AM - edited 10-25-2021 05:15 AM
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...
10-27-2021 03:58 AM
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 🙂