08-17-2024 04:19 AM
When I click the "OK" button the error -816 pops up in both "Error" and "Error 3". Is this the correct way to handle this error? Just clean it? And is it even supposed to happen?
08-17-2024 09:14 AM - edited 08-17-2024 09:16 AM
I am sure there is more to your architecture, by why don't you just wire the stop button to the conditional terminal of the timed loop?
But yes, if you abort a timed structure, you get that error and the following code might need to know that in order to interpret the results correctly. If you don't care about that error, just clear it.
(Many here cannot open VIs saved in LabVIEW 2024, so consider "save for previous" (2020 or below) before attaching)
08-17-2024 09:18 AM
The error is expected.
08-21-2024 06:59 AM
Having a 10 sec loop is silly. Run it at 100 or 1000ms and check if you should stop or continue waiting.
08-22-2024 08:10 AM - edited 08-22-2024 08:12 AM
@Yamaeda wrote:
Having a 10 sec loop is silly. Run it at 100 or 1000ms and check if you should stop or continue waiting.
Look at that again! Why oh why would a User Dialog be inside a Timed Loop. It's closer to insane than silly! As a general rule: if the timing is so important that a new execution system, with elevated priority, must be spawned (a timed loop does exactly that,) then; the UI Thread should be avoided since it forces a Thread switch to the Single Thread reserved to interact with the User. Note: the User's actions are completely beyond the control of the Operating System!
Think about it! Then ask "What is this code REALLY supposed to do?" 99.9% of the time, if you have a UI Object in a Timed Loop you have coded erroneously.
08-22-2024 10:20 AM
I have functionality (not specifically User Event) that must be executed every ten seconds. All in all, I asked how to deal with the error in the right way and whether it should appear at all. This is just a small example of something bigger.
08-23-2024 06:59 AM - edited 08-23-2024 07:00 AM
@maxnoder1995 wrote:
I have functionality (not specifically User Event) that must be executed every ten seconds. All in all, I asked how to deal with the error in the right way and whether it should appear at all. This is just a small example of something bigger.
That sounds to me like a parallel asynchronous loop, running at a period of 10 seconds, and communicating (via Queues, Channel Wires, or some other structure) with the rest of your program.
Bob Schor