12-19-2013 02:11 PM
using logic gates or what else ?
12-19-2013 02:43 PM - edited 12-19-2013 02:52 PM
My eyes bleed.
Take a look at using an event structure to respond to user interaction. Hey the event even gives you a reference for the button that triggered the event. That might simplify that nested case eyesore.
12-19-2013 03:12 PM - edited 12-19-2013 03:26 PM
how to set the indicator value to null when the program is stop ?
12-19-2013 03:39 PM
@416E64 wrote:
how to set the indicator value to null when the program is stop ?
Which indicator? And what exactly do you mean by "NULL"?
12-19-2013 03:55 PM
Well, if the program should stop once any button is pressed, you could OR all buttons and wire the output to the termination condition.
Still, there are many things wrong with your program. Is this supposed to be a subVI that returns something? Typically a stopped program is pretty useless. It might be better to implement a state machine so the VI goes to an idle state, for example.
Problems:
Here is a quick modification that shows how to eliminate the case pyramid. It stops when "take" or "put" is pressed, but not for the other buttons. Modify as needed.
12-19-2013 04:30 PM - edited 12-19-2013 04:31 PM
thanks again.
now the buttons are used to control the following statement,
but the whole program could not be aborted by the stop button.
12-19-2013 06:14 PM
You probalby need to create an event for the stop button.
Get rid of these unneeded sequences (use the error wire to define dataflow) and local variable (wire across structure boudaries)
place the IO stuff inside the currently visible event case, because it does not need to happen when you press stop.
12-19-2013 10:57 PM
@JÞB wrote:
My eyes bleed.
Take a look at using an event structure to respond to user interaction. Hey the event even gives you a reference for the button that triggered the event. That might simplify that nested case eyesore.
I would not use a while loop 🙂 (assuming no other event needs to be triggered)
12-19-2013 11:12 PM - edited 12-19-2013 11:13 PM
@P Use the while loop. When you need to expand the UI it'll be done already ( this vi sourced from your New.. Subvi\Frameworks\UI-Events.vit anyway right? so the loop cost you nothing)