LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use SubPanels to display and run multiple executables from the same GUI?

Solved!
Go to solution

Thanks for all the posts.  I was finally able to get the functionality I desired...running three instances of a Main VI from one top-level executable.

 

I  made my Main.vi into a VI template and then open multiple references to this template from a top-level VI.  While there are ways to get re-entrant behavior out of FGs (link) I decided to eliminate any FGs I had and to pass the data using wires or queues instead.  All my SubVis were made re-entrant.

 

I then insert each of the Main.vis into separate Subpanels on my top-level VI (each running a separate instance of the Main.vi).  Each instance of teh Main.vi communicates with an indivdual USB-6008. 

 

Works well.

 

Dan

0 Kudos
Message 11 of 41
(1,710 Views)
I would like to take your idea just one step further - I was hoping you (anyone actually) could tell me if this is feasible.  In your case, you had two instances that you ultimately rolled up into one top-level VI.  In my case, I will have anywhere from one to 16 instances that I want to have the top-level VI control.  I envision a client telling me how many apps he needs, I programmatically create that many, then the client sends me a TCP message (with some ID to direct the message to the correct app).  Does this dynamic growth seem possible?
0 Kudos
Message 12 of 41
(1,637 Views)
Another clarification question - If I understood you correctly, you enveloped your LABVIEW code into a DLL, correct? 
0 Kudos
Message 13 of 41
(1,636 Views)
You mentioned that "All my SubVis were made re-entrant".  What is done with VIs from third-party vendors?  I am not able to select the Execution properties of those VIs.
0 Kudos
Message 14 of 41
(1,630 Views)
In response to:
Another clarification question - If I understood you correctly, you enveloped your LABVIEW code into a DLL, correct?

No, I made the top level VI a VI template and opened separate instances to this template

 

In response to:

You mentioned that "All my SubVis were made re-entrant".  What is done with VIs from third-party vendors?  I am not able to select the Execution properties of those VIs.

If the third party VIs need to maintain separate data space then they need to be re-entrant, even when opening seperate instances of the template vi.

 

In response to:

I would like to take your idea just one step further - I was hoping you (anyone actually) could tell me if this is feasible.  In your case, you had two instances that you ultimately rolled up into one top-level VI.  In my case, I will have anywhere from one to 16 instances that I want to have the top-level VI control.  I envision a client telling me how many apps he needs, I programmatically create that many, then the client sends me a TCP message (with some ID to direct the message to the correct app).  Does this dynamic growth seem possible?

Anything is possible...

I ended up having three separate instances, 3 or 16 shouldn't matter.  Just create the instances in a loop as needed. 

 

Dan

0 Kudos
Message 15 of 41
(1,625 Views)

1) How do I make third party VIs re-entrant?

 

2) Can you elaborate on how you ".. made the top level VI a VI template and opened separate instances to this template"?  Not sure how to do those two things.  I think I read that the VI Server is involved when trying to call this template, but I'm not sure what that looks like.

0 Kudos
Message 16 of 41
(1,623 Views)

1) A VI is a VI and you make any VI reentrant by going to VI Properties>Execution. If a VI that you created or someone else created is password protected, then you cannot make changes to either the code or properties.

 

2) You make a VI a template by doing a save as .vit. Calling a template is really no different than calling any other VI. You can call it statically or dynamically. Calling a VI dynamically with VI Server is shown in several shipping examples.

0 Kudos
Message 17 of 41
(1,619 Views)

1) (a) Either get access to the source code from the thrid party, or (b) looks like the reentrancy is a VI property (Execution.IsReentrant), use a property node to set this property for all exes.  To do this you will need to open a reference to the VI that is part of the third party build.

 

2) All you need to do to make a vi template is Save As..with a .vit extension.  Then just use open VI reference to obtain the reference to the template.  Each reference will be a separate instance.

Also see:

http://decibel.ni.com/content/docs/DOC-7721

http://digital.ni.com/public.nsf/allkb/98847B4E4C715E6D86256C59006B57CC

http://zone.ni.com/reference/en-XX/help/371361F-01/lvhowto/creating_vi_templates/


Dan

0 Kudos
Message 18 of 41
(1,617 Views)

I am curious why the Main.vi needs to be a .vit (template) file if it is to be used as a dynamically loaded reentrant vi.  According to the documentation, you can convert a vi to a vit just by adding the "t" to the end of the filename, there is no difference in the code at all!

0 Kudos
Message 19 of 41
(1,610 Views)
With regards to the VI & VIT, is there a need to maintain both.  Just looking at configuration management issues.  It seems like you need the vit to do the template, but can a vit be used outside of a template (i.e., can I make an EXE out of it)?
0 Kudos
Message 20 of 41
(1,584 Views)