LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run VI using two button in single event structure

Hi,

I am haiving two sub VI which I want to Run.If RUN 1 is pressed then a sub VI should open , remain open and run.If RUN 2 button is pressed then another sub VI should run..In programming event structure is ther , in which I am taking both sub VI inside two seperate while loop.But I am not able to run both sub VI.Plz help

main VI.jpg

0 Kudos
Message 1 of 3
(3,273 Views)

You should learn the concept of producer/consumer and "start asynchronuous call" for VIs.

With these two keywords, you should find plenty of examples, some being quite useful.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 3
(3,257 Views)

See LabVIEW help: Caveats and Recommendations when Using Events in LabVIEW .You need 3 event cases, one for each button: OK Button, OK Button 2 and stop. The Timeout event case is not needed in this particular VI, but you can just leave it there. The event structure has to be inside the while loop, not the other way around.Try with this structure first, without subVI calls, in order to understand how the event structure works. Once you get that working, you can try to call asynchronuously the subVIs in the OK button and the OK button 2 case. The stop case has to take care of the while loop, i.e. stop it when you click the stop button

0 Kudos
Message 3 of 3
(3,240 Views)