02-21-2008 10:35 AM
02-21-2008 10:39 AM
02-21-2008 10:54 AM - edited 02-21-2008 10:58 AM
sthu wrote:
I am currently running a VI, which calls a Sub VI, I have created. The Sub VI consists of an event structure, which is triggered when a button is pressed (button value change). As there are parameters that are set by the user, that parameters need to be set before the whole VI is running. Therefore I created a flat sequence, which contains a while loop in first frame, which is stopped if the value of the button is true (same button that triggers the event structure).
What now happens is that sometimes the button keeps its value from the last call of the VI. Therefore the while loops is ended even though no button has been pressed.
I tried to create another frame in the flat sequence before the other frames, that initializes the value of the buttons - but it didn't solve the problem. Any idea what might be going on? To me it doesn't make any sense, since there is no way, that the value of the button might be true, because it is set to false in the frame before the while loop.
02-21-2008 11:05 AM
Hi sthu,
I dont know how your rest of the code looks like but you can try these steps:
1. Completely remove the 1st Frame and the while loop in the second frame.
2. Put the event structure inside a while loop - this ensures the timeout event is executed until the buttons are clicked.
3. When the buttons are clicked, route the (TRUE) boolean value to the while loop condition through the event structure.
Also ensure the mechanical property of the buttons are set to "Latch When released". If this does not work, write the FLASE value to the buttons after exiting the while loop.
Hope it helps.
Vikas
02-27-2008 12:20 PM
02-27-2008 05:39 PM
What is "that's"? You should make sure to quote what yo are replying to. 😉
sthu wrote:
unfortunately, that's not a possibility.
02-27-2008 05:46 PM
sthu wrote:
I hope everthing is a little clearer now.
sthu wrote:
- button also triggers event structure, which will be excecuted when all needed data is processed by previous step
- every time when the button is pressed, trigger the event structure again
02-28-2008 03:42 AM
I completely agree with altenbach, you dont need a polling loop.. the event structure handles only one operation at a time.. so, you can ensure the Operation A, dependent on Operation B, is NOT executed before completing B. You can "disable and grey" the button that does Operation A until the user presses the button for Opn B first - or something similar.
And yes, a code would be helpful.
Vikas
02-28-2008 02:15 PM