"Michael Sachs" wrote in message news:...
> You can change the boolean's mechanical action to a latched type and then it
> will pop back up.
> The event structure has a timeout input that defaults to infinite. If the
> event loop is waiting for an event or timeout then your outer while loop
> will not cycle. Use the hightlight execution lightbulb on the diagram to
> see what the data flow is doing.
>
> Mike Sachs
> Intelligent Systems
>
> "Cheng" wrote in message
> news:afm3kd$7pu$1@merrimack.Dartmouth.EDU...
> > I put an "event structure" inside of a while loop. My target is to keep
> the
> > VI running and make selections to run different subVI. But I got two
> > questions:
> >
> > 1. how to use two button on front panel? I mean, when I press one button,
> > step 1 runs, when I press the other button, step 2 runs. Is event
> structure
> > the best way to do that? another side quesition is that how I can make the
> > button jump back after I pressed it? It kept in the "down" position and I
> > have to press it again to release it.
> >
> > 2. When I test the VI, I found the while loop can't stop. The boolean
> input
> > of false won't stop the VI. I wonder if there is a rule that the event
> > structure must run at least once? or any other hidden properties I didn't
> > notice?
> >
> > thank you very much!
> >
> > cheng
> >
> >
Hi Cheng,
that's not quite the whole story. The event structure breaks down
into two types. Those that get actioned between the start of the event
(i.e. mouse down) and the result of that event (i.e. the button
registers true) which are filtered events, and the other type (like
mouse up) which occur after the event and the result of the event.
With filtered events you can modify the result of the event as it
happens. Whichever you choose to use, you need to do one of two things
to get the button to pop back up (setting to latch when pressed on
it's own won't work) - you can either read the FPTerm within the event
itself with this set to Latch when pressed, or (my prefered method) is
to use the CtrlRef that's available inside the event, and use the
ActiveX method Reset to Default. This way the FPTerm for the button
can be left somewhere else, and it's more obvious what the program is
doing at this point.
Your while loop is actually a do {} while loop, i.e. it must execute
at least once before it checks to see if it should iterate again.
Mike's suggestion of follow the hi-light execution is the best
solution.
Hope that helps
Sash.