LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Button Interaction (Loops, Sys Exec. VI)

Solved!
Go to solution

Hello, 

 

I have 2 while loops that are continuously recording data into excel files and I want them to both stop controlled by one stop button (see attached for my attempt at this). I have the property set to "switch when released" and the problem is when I press the stop button while the VI is running, nothing stops, both loops keep recording data as shown by the indicators. How should I wire this differently to suit my purpose?

 

Another question is I am not sure how to wire the System Exec VI such that when I press the aforementioned stop button, the System Exec VI runs my input and executes a .exe. I've read the help forum on system exec and am still unsure of how to do such a thing.

 

Any help is appreciated, thank you!

Download All
0 Kudos
Message 1 of 3
(2,121 Views)
Solution
Accepted by topic author laps682

The reason your stop button isn't working is simple:  Data flow!

 

I suggest you turn on highlight execution and run your VI. You should notice little green squares leave your "stop" button and go to your loops, and then be fed into the conditionals.  Those squares represent data going from your stop button and being read by the loop.

 

The problem here is that the way you have this configured, the stop button is only read once when you start your program.  It is never read again, and so your loop always sees "false".  There are lots of different ways for you to transfer data from parallel loops:  local variables, queues, notifiers, channel wires, etc.  You just need to pick one that fits best what you are trying to do!

 

I know this isn't what you want to hear, but a data flow mistake shows a serious lack of knowledge in the fundamentals of LabVIEW.  I strongly suggest you spend some time learning the LabVIEW basics.  There are several good (free) resources online for you to go through.  A few hours of effort now will save you lots of headache later.

 

While learning, feel free to post any questions here and you will get an answer... especially if you ask "Explain this to me" rather than "Why doesn't this work".

Message 2 of 3
(2,117 Views)

Thank you for the response!


I will be sure to study these resources; I am relatively new to LabVIEW and am sure they will help a lot!

0 Kudos
Message 3 of 3
(2,092 Views)