LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Timed Structure

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?

maxnoder1995_0-1723886252556.png

 

0 Kudos
Message 1 of 7
(513 Views)

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)

0 Kudos
Message 2 of 7
(490 Views)

The error is expected.

ZYOng_0-1723904291897.png

 

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 3 of 7
(484 Views)

Having a 10 sec loop is silly. Run it at 100 or 1000ms and check if you should stop or continue waiting.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 7
(433 Views)

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


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 7
(403 Views)

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.

0 Kudos
Message 6 of 7
(379 Views)

@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

0 Kudos
Message 7 of 7
(355 Views)