LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using .vit for multiple instance

Hi,
 
I have a main vi, uses rendevous to run multiple subvis at the same time, that needs to be opened separately per user which need to open the same vi multiple times.
I tried to use .vit, changed main vi to vit. Created new vi that calls this main.vit. However this doesn't run multiple times, only opens the first window. Then I used subVIs as vit. This even creates a bigger problem. The sub vi's that opened doesn't run.
 
I think I'm missing some basic concepts of using vit. I searched the forum, found some articles but I can't find what I'm doing wrong.
 
Should main vit calling several sub vit's work?
 
Any tips, comments would help.
 
Thank you very much.
0 Kudos
Message 1 of 6
(3,051 Views)
VIT is not for multiple instances, it is a TEMPLATE. That means you open it up, but when you go to save it, it pretends that it's untitled, and you have to give it a new name.

That's useful - for example, I have a TIMING TEMPLATE. When I want to time something. I open this VIT file. I insert the code I want to time into a certain frame, and run it. I usually don't save it, but if I do, I have to give it a new name.

That way, the next time I open it, it's fresh again.

If you want to run the same VI multiple times in parallel, you must:

  1. Understand what RE-ENTRANT EXECUTION means.
  2. Set the VI to use re-entrant execution.
  3. Use the VI Server to open each instance dynamically.
  4. Use the VI Server to CLOSE each instance dynamically.
  5. Be very careful about getting data into and out of the VI in question.
HTH

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

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

Can you attach your code so we can see whats happening?

Shooting in the dark: It sounds to me like the SubVIs should be the vit.  You would want the Main VI to open a new instance to the Sub VIT, pass in the various references and then run it.  Then when a new instance is needed you just call the same code again.

0 Kudos
Message 3 of 6
(3,039 Views)

"CoastalMaineBird" <x@no.email> wrote in message news:1173897608738-491799@exchange.ni.com...
VIT is not for multiple instances, it is a TEMPLATE. That means you open it up, but when you go to save it, it pretends that it's untitled, and you have to give it a new name.


That's useful - for example, I have a TIMING TEMPLATE. When I want to time something. I open this VIT file. I insert the code I want to time into a certain frame, and run it. I usually don't save it, but if I do, I have to give it a new name.
That way, the next time I open it, it's fresh again.


If you want to run the same VI multiple times in parallel, you must:


- Understand what RE-ENTRANT EXECUTION means.
- Set the VI to use re-entrant execution.


- Use the VI Server to open each instance dynamically.
- Use the VI Server to CLOSE each instance dynamically.
- Be very careful about getting data into and out of the VI in question.


HTH



VI Templates can also be used to run multiple instances of the same vi. If you open a .vit dynamically several times, you'll end up with several instances of the vit. Actually, this is an intended use of the vi templates. And it works great. The great benefit over reentrant vi's is that the vi templates have front panels of there own. So it's great to use vit's when you want several similar panel, without copying the code. Reentrant vi's where not intended for this. Before 8.0, reentrant vi's didn't even have panels that updated properly, so you had to use a vit.


Regards,


Wiebe.

0 Kudos
Message 4 of 6
(3,024 Views)

For an example of how to use a template to present multiple GUI's please see the my "Dynamic Instantiation of Occurrence Based Architecture" Nugget that can be found here.

http://forums.ni.com/ni/board/message?board.id=170&message.id=226491&view=by_date_descending&page=2

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 6
(3,017 Views)

Thank you for the thought guys.

The sub vi called by main contains 2 other sub vi's front panel. So when I use first subvi as vit, it won't load its sub vi's front panel.

Sub1 vi + sub 2 vi --- (called by) ---> sub 3. vi ---> main vi. 

I made main vit, sub 3 vit. Sub3 vit won't load sub1, sub2 vi's front panels....

Something like this kinda architecture. I'm not sure if vit with sub vit can be done. I'll attach example code if I can make it simple.

Thanks again.

 

0 Kudos
Message 6 of 6
(3,007 Views)