LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

trying to avoid globals

Here is essentially what a want to do. I want the subVI to open when a menu item is selected (i know how to do this) so the user can change values in a seperate window. However, in my daq loop I need a way to get these values when the case is switched to true. If I put the subvi outside the daq loop, it wont get the values when they are changed by the user. If I put it inside the daq loop then it will obviously open the subVI's front panel every time the loop spins. I would prefer not to use globals so if someone could help me avoid that i'd appreciate it. A picture is worth 1000 words i guess so I'll post a simplified one that hopefully helps in understanding.

 

Message Edited by for(imstuck) on 03-26-2009 04:20 PM
0 Kudos
Message 1 of 5
(2,259 Views)

Store the values using a functional global variable.  AKA action engine.  See Ben's nugget.

Message 2 of 5
(2,254 Views)
Thats essentially what I'm trying to do (and I have read over bens nugget before and it really has helped in other code so ill check it again) but wont it cause problems seeing as I have the front panel set to show when called? No matter where I put the subVI it will open but I only want it to show front panel when its called in the top loop.
Message Edited by for(imstuck) on 03-26-2009 05:23 PM
0 Kudos
Message 3 of 5
(2,232 Views)

Make a separate VI for the functional global.  That way, you can access it inside or outside the loop.  And it shouldn't have a visible front panel.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 4 of 5
(2,228 Views)
Thanks, Ill mess around with it tomorrow, but I think ill get it to work no problem now with your guys help. I was just thinking about it the wrong way.
Message Edited by for(imstuck) on 03-26-2009 05:32 PM
0 Kudos
Message 5 of 5
(2,224 Views)