LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

show hide vi

I’m new to LV. I have been working with LV on and off with small projects. My new project is a little more complex. In the main.vi I would like to have a Boolean (Set) to open the front panel of another vi. to run in parallel with the main.vi. In the pictures, I have three PID temperatures each one would need a Sub.vi to run the algorithm of the PID. I was thinking of using Global Variable to past data from the Main.vi to the Sub.vi. I do know that I need to keep the Sub.vi in memory so LV can do the algorithm and pass the data over to the Main.vi. So, the question I’m asking is what’s the best way of doing this? With keeping this in memory will it make it run slower? I have tried using a Tab Control with all the setting but to me it takes up too much real estate that’s why I’m looking into opening a window for the settings to keep the Main.vi front panel clean. I was looking at make the sub.vi be transparent or minimize by a Boolean (set) on Main.vi.pid2.PNGpid.PNG

0 Kudos
Message 1 of 5
(3,759 Views)

1. Use subpanels.  With subpanels, you just dynamically load a VI's panel and it shows up like it is on your main VI.

 

2.  Personally, I like to use User Events to send messages to my parallel loops/process.  The process can do something with the message (like update a parameter), or ignore it.

 

3.  It might be too advanced at this point, but this sounds like a good application for the Actor Framework.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,706 Views)

You have three sub-VIs that run a PID Temperature routine.  Do you intend to run all three simultaneously, displaying the Front Panel of a selected VI for Control and Outputs?  As Crossrulz notes, the Actor Framework is one way to do this.  Another way is to create a single VI to run one system and "clone" it by using Start Asynchronous Call and making the VI a Pre-Allocated Reentrant Clone.  You need to pass an "identifier" (I number my Clones as I spawn them, 0, 1, 2, etc.) so that Clone N can "attach" to device N, and you need to have a way to pass data between the Clone and the Main (Caller) VI (I've used Named Queues, as well as VIGs and Action Engines).

 

With this scheme, your Main sets up a single Display, Clones as many "Stations" as you need, passing in the Station ID and any Station-specific Input needed to start the Station Clone VI.  The Main designates which Clone should be passing data back for display.

 

Bob Schor

0 Kudos
Message 3 of 5
(3,657 Views)

Sorry I been busy at work. Thanks for the info look like I have some work ahead of me on learning about actors and clones. 

0 Kudos
Message 4 of 5
(3,624 Views)

Here is another suggestion that I personally like:

 

Using a VI Reference and a Property node, you can programmatically change the VI properties. 

By making the Boolean below True, SubVI wil appear.

By making the Boolean below False, SubVI wil disappear.

 

Gilles1_0-1641551163644.png

 

0 Kudos
Message 5 of 5
(2,099 Views)