06-10-2011 07:52 AM
surely, here they are!
06-14-2011 01:43 AM
Dear Ricky,
Thank you for your reply. I ran the main vi and stop it. After that it was not possible to start it again. I imagine that this has to do with your notification about the mechanical action of the stop vi. Could you please be more specific because unfortunately I didn’t find an appropriate mechanical action mode. By the way, I notice that you have wired the loop iteration indicator with the while loop. It’s the first time I see something like that. Could you please explain why you did it?
Thank you in advance
06-14-2011 03:38 AM
Hi LW42,
You can find a lot of information about the mechanical actions of the buttons on the NI website, here an exemple of how you can search the information there: mechanical actions.
For my sample, if I don't misunderstand what you want to do, you need 2 buttons. The first, the stop button, which is usually inserts into the VI panels to controls the shut-down of the panel and each its subVIs, will be check from the subVI to understand if the user has chose to shut down the applican, the second, the Run, button its uset to launch the subVI and to control its execution.
Look at these:
06-14-2011 07:38 AM
Hello Ricky,
Could you be so kind to submit the vis in 8.6.1 LabVIEW version.
Thanks for the help
06-14-2011 08:48 AM
Of course, here they are!
06-16-2011 02:26 AM
Thanks a lot for the vis.
Best regards
03-18-2016 05:05 PM - edited 03-18-2016 05:06 PM
Elaborating on the original question, I am wondering why your (g_Ricky) example doesn't work if you modify main:
If I run main, the indicator stop2 doesn't work and the value of stop is not passed to the block.
Is this weird or logical?
03-18-2016 05:18 PM
@SteCla wrote:Is this weird or logical?
Logical. The loop in your main cannot iterate until everything inside has completed. This includes the subVI. And since the subVI has a loop, it must complete. This is huge because the stop control is not read again (after you click on it) until the main VI's loop iterates again. But it can't because the loop in the subVI is waiting for a reaction to that stop button being read. What you have is a deadlock.
03-18-2016 06:53 PM
03-18-2016 07:18 PM - edited 03-18-2016 07:20 PM
You could pass in the reference to the control and dynamically register for the value change event.
But I have to advise against this setup that this thread is making. If you have "long" things happening inside of a loop, it limits anything else in the loop from happening. It would likely be better to have this be in a seperate, parallel, loop.