09-24-2008 09:48 AM
Good day to all
I have built the event loop (see attachment)
but for some reason it only work once.
i start from start/stop=start=false and heating="1" then i push the start/stop button once and chose "nothing. keep outgassing" (right button).
The second time IM pushing the stop button noting happens.
the loop doesn't even notices it.
any ideas will be appreciated
thanks shai
09-24-2008 09:52 AM - edited 09-24-2008 09:53 AM
You give it TWO things to do:
1... Wait for a Button Push.
2... Read local variables, and decide whether to continue the loop.
Guess which one will execute first?
If you want to read the local variables AFTER the event executes, you have to FORCE it to do it that way. Otherwise, it sees work that needs doing, and does it.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-24-2008 11:27 AM
You have a classical race condition due to the over-use of local variables. It really would help if you could attach the VI so we can see the rest of the hidden code.
Where are the terminals???
Anyway, for the visible code you would wire from the "heating" terminal inside the loop to the termination condition. This ensures that the termination condition does not get read prematurely.
(Overall, I would also recommend to use straight logic instead of convoluted logic. It is very confusing to make sense of the code if you look at the "old value" instead of the "new value" and use "continue if true" instead of "stop if true". Why don't you look at the new value and simply swap the cases? You might also want to keep the "heating" and "cooling" states in a shift register.)
09-24-2008 01:56 PM
hi
can u send me the vi or flow chart for the vi.......
my assumption is : you are using local variables.... to control it...so every time the vi starts you have to intialise to some values..that deponds upon your requirement.
any how post the vi or flow chart...