LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subvi in event structure

Hello,
I am writing a vi to control a solar tracker. There will be a bunch of front panel displays (for date, time, sun position, etc) and 3 buttons: track, stow and stop. I was thinking of having 2 parallel while loops: the 1st would update the front panel displays and the 2nd would contain an event structure to handle button presses. I would like the tracker to TRACK when (track button is pressed AND the sun is up AND the windspeed is < windspeed limit AND the stop button is not pressed). I have written a subvi that lets the tracker track when the sun is up and stow when the sun is not up. I would like to run this subvi when the track button is pressed but it is my understanding that the program will not be able to respond to another event until the code in the previous event has been completed. The "track" subvi will be operating continously, however so how will I be able to respond to another event? Other events would be things such as: "stop button pressed", "wind speed is above limit", etc. Thanks.
0 Kudos
Message 1 of 3
(2,882 Views)
hi mtber,

One possible solutions is using multiple queue style state machines. You would have multiple queues one at the top level of your GUI vi and others would be in your sub vi's. The top level UI events then could write messages on it's own queue or on the sub vi's queues which ever is appropriate.  These sub vi's would run in parallel with you top level loop and all would exit (loops stop) whenever say the "stop" button is pushed or panel close event etc. Labview ships with some examples of queue state machines check them out. Hope this helps

cheers,

--Russ
0 Kudos
Message 2 of 3
(2,873 Views)

Hello mtber,

I know its a long time since you left this post, but i am currently physically building a solar tracker with linear actuators and LED based optical sensors, I would like to control it also from labview but have not started to write the control program, any help you could give would be greatfully appreciated or code examples,

Thank you

paul.clarke@slcontrols.com

 

 

 

0 Kudos
Message 3 of 3
(2,755 Views)