LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help passing data through separate subpanels

Hello,

 

My goal is to trigger an event in the which every VI is loaded into to the main subpanel whenever a boolean is pressed in the left subpanel VI.


I have opened each VI staticly and abort them as soon as another tab is opened (Test Setup, Instrument Configuration, analysis, etc.) from the top panel.


I have tried passing the a boolean reference via a functional global variable to the the main vi in the right subpanel and it does not work.


I am thinking passing the information through a user event or queue, however I need it to only trigger when the button is pressed in the left panel.


Maybe just removing the left panel and having the buttons loaded with the main vi in the main subpanel may work or is using the two subpanels possible?

 

Thank you.

Download All
0 Kudos
Message 1 of 6
(2,567 Views)

Hope this will help. Let me know if you need any help

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 2 of 6
(2,543 Views)

Hey, thanks Ranjeet for the response, I am still working through it. I am confused though.

Are both pieces of code located in the VI in the main subpanel? I am not entirely sure how the user menu selection would send the signal to save the configuration values.

0 Kudos
Message 3 of 6
(2,522 Views)

Ok, using the call by reference .VIs I used an event structure in the menu subVI where I call by static reference the main panel subvi and insert the values into my functional global variable. I did, although do I need to call the functional global through the call by reference, I think I'm doing redundant code there.

 

Also, I am not sure why but I had to make the static VI a strictly typed reference, why?

I did not want to drop the subVI in on its own as it is already running.

 

Does this make sense?

 

0 Kudos
Message 4 of 6
(2,517 Views)

You might want to look into the MVC (Model View Controller) design pattern.  This is where you maintain a encapsulated store of 'Model' data (any data you need to share) and provide an interface to the Model for 

reading and writing parts or the whole Model.  Any View (Top Level VI) that has a UI changes will write an update of that data to the Model, the Model will in turn Publish this data in the form of a User Event which any GUI's can subscribe (Wire the Event reference to a dynamic user event input on its event loop) to.  It really not as hard as it sounds and will give you great flexibility and extensibility in your design.  The Store for the model could be as simple as a FGV or singleton class data.

0 Kudos
Message 5 of 6
(2,491 Views)

Hmm loooks interesting, I'm taking a look at it right now and at the very least I understand how to use events with queues much more clearly. Thanks for the suggestion sachsm. 

I keep going deeper into the rabbit hole everytime I try and optimize/solve my design.

0 Kudos
Message 6 of 6
(2,485 Views)