LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

program design and sharing control settings for the same hardware between VIs (or subVIs)

    i'm designing a program and here's what I would like to have happen.  mainVI has a button to scopeVI and another button that initiates acquisition (a 'run Exp.' button).   scopeVI allows the user to set things like vert/horiz/sampling rate/record size, and whatever other 'controls' they want to use for the actual acquisition.
    ideally, i'd like the user to be able to click on scopeVI button, set parameters, and then close this VI.  Then I'd like the user to be able to press 'run Exp.' button to (1) initialize the scope using the same values that were set in the scopeVI, (2) collect data, (3) close scope. 
    The problems are this....
    1)  One way that I can envision doing this is to put all of the scope controls in the mainVI, create references to them which can then be updated when scopeVI runs.  I could then hide the cotrols from the front panel so the user wouldn't know they're even there.  One good thing about this approach is that I can avoid using global Vars.  I don't like this approach because it will take a lot of work to duplicate all of the controls, and I have to be very careful to avoid race conditions when accessing the controls.
    3)  I'm not sure how I could do this using shift registers because it seems complicated.
    2)  the other way I can envision doing this is to have scopeVI load into memory when the button is clicked, but then when it is closed from the scopeVI panel, somehow make sure it is not entirely unloaded from memory so that I can still access those variables.  I don't know if this is even possible, but i would think there's some way to do it.

any suggestions on how to approach this are really appreciated!
-Z
0 Kudos
Message 1 of 3
(2,758 Views)
Here is a tutorial on a common design pattern for application development.  It does not include a data acquisition loop, but you can easily add that later.  Look it over, then reply with questions on how to modify it for your use.

NOTE:  The example is in LV7.1.  You didn't mention what LV version you are using.  I have it in 7.0 format, as well.
0 Kudos
Message 2 of 3
(2,740 Views)
Thank you DFGray,  I'll look through this and do some thinking.  I'm currently using labview 8.0, although I assume we'll  upgrade to 8.2 at some point in the not to distant future.  In the end, I hope to pick algorithms that will not be subject to problems by upgrading labview.

thanks, and i'll post again when I've gone through this a bit.
-Z
0 Kudos
Message 3 of 3
(2,733 Views)