LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynaically instatiated VIT in application (.exe) (LV 2010.1)

Hi

I ran into this problem before und I found an ugly solution. But maybe there is another one I cannot see. 

 

Situation: You have a program that instantiates VITs dynamically.

You don't want to specify an absolute path to open it, so you   pull a refence onto the diagram an get the Path property of it.

Works fine while in Labview.

 

When you try to build an executable (using 2010 exe file scheme) you get rather funny errors, or it does not work at all.

 

There are two awkward workarounds I know of.

1. Place the VIT in an extra folder that you place outside the.exe. This way you always have to move two files and you have to programmatically find out where that VIT is.

2. Similar- Use 8.x file scheme and you have to move a plethora of files and folders when distributing you application.

 

So is there a simple clean solution to move that VIT inside your exe and still get a reference to it so you can instantiate it ?

 

Thanks

Gabi 

7.1 -- 2013
CLA
0 Kudos
Message 1 of 9
(3,046 Views)

I would have expected this to work fine. Which errors are you getting?

 

My first guess would be that the file path is too long, so I would suggest trying to move the EXE to the root folder of the drive and then see what happens. If that helps, you would probably simply want to set the destination on the VIT to be in the root of the EXE instead of in its original location.


___________________
Try to take over the world!
0 Kudos
Message 2 of 9
(3,041 Views)

Hi and thanks to tst for the response.

 

Unfortunately it did not help to move the  VIT to the exe root. It is apparently not at all possible to work programmatically inside the file tree of the exe ?

 Neither build or strip path (not mention file list) seems to work inside the exe.

 

So I decided again to move the vit outside of the exe and search there for the path.

 

Pulling the reference onto the diagram will give you error 1127

          >>>>>>>>>LabVIEW: Cannot instantiate template VI because it is already in memory.<<<<<<<<<

 

The trick from 8.x days of placing the vit in a TRUE-case with a control, that was always FALSE and then use the name gives the same error.

 

 

I place my way here not as real solution but also to correct the spelling in the header, so other may find it.

 

 

and this NI, please give us a way to parse the exe file tree 

 

Gabi
 

7.1 -- 2013
CLA
0 Kudos
Message 3 of 9
(3,027 Views)

 


@Gabi Tillmann wrote:

 

Pulling the reference onto the diagram will give you error 1127


Ah, yes. I forgot about that. The truth is that I haven't used VITs in a long time, because these days reentrant VIs work basically the same. I suggest you simply change the VI to be reentrant and open the reference with 8 wired into the options input. This will open a new clone of the VI and should work around all the problems you have.


___________________
Try to take over the world!
0 Kudos
Message 4 of 9
(3,023 Views)

Reentrant is not bad, but not good to clone Daemons.

They all have the same name. The number in the window title is pure cosmetic.

When you let them run free, and forget about the reference, there is no way to ever find them again. 

 

A clone VIT is a real top-level VI running, that is in the list of VIs in memory. You can address it by it's unique name, open a front panel, abort it etc.

 

So there is still a reason for both.

 

Gabi 

7.1 -- 2013
CLA
0 Kudos
Message 5 of 9
(3,014 Views)

Actually, you can access clones by their name, although it's true they don't appear in the All VIs property. You can use the VI's Clone Name property to get its name, which is the VI's fully qualified name, with a ":X" added at the end, where X is the clone number. You could also simply keep the reference separately in a list, which I personally prefer, because I don't like having completely rouge references.

 

In any case, you can also vote for this idea to change the All VIs property - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Have-All-Clones-included-in-AllVIsInMemory-property/id...


___________________
Try to take over the world!
Message 6 of 9
(3,012 Views)

Thanks tst

 

was good to talk to you.

 

The problem with a list of references is,

They get lost once you hit the RED BUTTON.

 

Thanks again.

 

Gabi 

7.1 -- 2013
CLA
0 Kudos
Message 7 of 9
(3,003 Views)

The issue is that you can access the RED button (I assume you mean the Abort button in the LabVIEW toolbar), this should be removed for any end-user application.

 

Ton 

 

 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 8 of 9
(2,996 Views)

Gabi,

     Thanks for posting this.  I just ran into the same problem, found your post, but wasn't sure that I understood the "solution".  So I gave it a try and came up with a fairly simple system that seems to work with minimal effort.  I've never tried to post a link here, but this might point to my post -- http://forums.ni.com/t5/LabVIEW/Using-Clones-from-VITs-inside-Application-exe/td-p/1872453.

 

     I hope that you've found your own solution by now ...

0 Kudos
Message 9 of 9
(2,909 Views)