LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

emergency button during time delay

Hi,

I want to stop the program during its exectution, especially during a time delay. But the stop button seems not to work properly. i tried with a stop button and also a push button.
There are lots of loops, the best way is to look at my structure in attachment.

Is there a way stop the exec of my program?

thanks,
Laurent
0 Kudos
Message 1 of 7
(3,845 Views)
Hi Laurent,

you wildly mix (unwired) terminals, "value" property nodes and local variables - WHY?

Your vi will not work properly as long as you want to check the stop button in the event loop while locking the front panel while execution of the event structure!
You should separate front panel handling (i.e. event structure) and execution of (long lasting) measurements into their own loops, connected by message queues. This way you can always react to user interaction...

One more flaw: in your current implementation the "stop"-local is (probably) read before/at the start of the execution of the 20sec delay. You cannot stop the delay in between.

To break the 20sec delay you should create a while loop running 100 times waiting for 200msec. In each iteration you can check the stop button and end the while loop...

Message Edited by GerdW on 09-18-2007 09:52 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(3,842 Views)
I'm rather novice in fact, especially with event structures
I understand what you mean, but how can i seperate the event structure and long lasting.
Could you apply the necessary corrections to make it work?

thanks
0 Kudos
Message 3 of 7
(3,839 Views)
There is one very ellegant way to do this that you can easily include in any Producer/Consumer framework (and derived architectures!). Here is a screenshot of the "schematics" of the solution:



hope this helps,
Norbert B.

Message Edited by Norbert B on 09-18-2007 03:08 AM

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 4 of 7
(3,834 Views)
Hi Laurent,
it is often said in this forum not to execute time- consuming code inside an event case. This can cause the user interface not to behave as expected (e.g. no reaction on mouseclicks at all). The other thing is the design of the state  "signal RF ON", which has a time delay of 20 secs. In this time the program can't react on your button inputs. One soution could be, to add another state, let's say "keep RF ON", loop this case 1000 times with 20ms delay and every loop count the button is polled.
It could look like this:

  

Hope this helps,
greets, Dave

P.S. to examine the execution of your program use the little lightbulb from the button bar and activate in the option dialog at the "debugging"- page "Show data flow..." and "Auto probe during...". This often give you a good impression, how the program works.

Message Edited by daveTW on 09-18-2007 10:24 AM

Greets, Dave
Download All
0 Kudos
Message 5 of 7
(3,833 Views)
Hi Laurent,

you should:
- rtfm Smiley Wink
- look at the LabView examples on (message) queues
- look here in the forum on "queues" or "master-slave"

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,826 Views)
Thank you, now it works

Smiley Happy


0 Kudos
Message 7 of 7
(3,814 Views)