02-24-2021 07:34 AM
Hello,
I have a certainly very common problem, which is that I use FOR loops in an event structure, and a long process starts when entering the FOR loops. I would like to be able to manually stop the FOR loop (via a "stop for loop" button) and therefore finish the event execution faster (in case, for instance, I realize I set wrong parameters before running the execution of the event). I attached a basic example as my real code is used for controlling light sources, cameras, stage motors etc and is far too complicated).
I am sure the problem comes from bad programming and that a for or while loop should never occur in an event loop. I would therefore much appreciate if you could either give me an option to solve my problem in my current azrchitecture, or if you could suggest another architecture. Note that my real Event stucture contains much more event cases, and that the Time Out event isn't empty. Note also that I only have Labview 2017 and won't be able to open exemples generated with newer versions. thank you in advance for your help ! Best regards.
Solved! Go to Solution.
02-24-2021 07:51 AM - edited 02-24-2021 07:54 AM
Hi Sophie,
@sophiebiovision wrote:
I have a certainly very common problem, which is that I use FOR loops in an event structure, and a long process starts when entering the FOR loops.
This problem is only common to LabVIEW beginners…
There is a LabVIEW help for the event structure. In this article is a link to "Caveats of the event structure", which is important to read!
Solution:
Btw.
02-24-2021 07:53 AM
after sendin my post I found that when going to Edit events and unclicking Lock Panel for the "start" event then my stop loop button becomes active !
That will suit me I think, but don't hesitate and propose other option if you think this one isn't proper. I suppose it might be dangerous as any accidental action on the front panel might cause to stop the event when I don't want it to be stopped. anyway, Ill work with this solution for the moment.
Best
02-24-2021 01:29 PM
@sophiebiovision wrote:
after sendin my post I found that when going to Edit events and unclicking Lock Panel for the "start" event then my stop loop button becomes active !
That will suit me I think, but don't hesitate and propose other option if you think this one isn't proper. I suppose it might be dangerous as any accidental action on the front panel might cause to stop the event when I don't want it to be stopped. anyway, Ill work with this solution for the moment.
Best
Oh, no - the "Great Lock the Front Panel Debate!" In a nutshell, though, while it has it's very specific uses, I generally don't advocate for its use, as it encourages bad habits, and if abused without understanding - as it seems in your case - could lead to confusing and unintended consequences.
02-24-2021 03:35 PM
In addition to what has been said already.