LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a vi from a .exe

I'm trying to deploy a labview application for use by
student researchers at a university lab. Ideally I'd
like to build an executable out of everything that
needs to be nailed down and untouchable by students.
But I'd also like to have one or more vi's that the
students can edit and call from the main executable
without recompiling the exe.

I have the .exe launching a dynamic vi, but when I
edit that vi and run the .exe, the changes don't show
up, so I assume even the dynamic vi is built into the .exe or elsewhere in the installation.

Any ideas on how to do this?
0 Kudos
Message 1 of 10
(3,623 Views)
You should look at the shipping example called Plug In Example.vi for one way to this. It sounds like the dynamic VI was included in the build and the path for the dynamic VI is not correct for the VI you're editing.
Message 2 of 10
(3,606 Views)
Hello ESchell,
 
Did you solved this issue? I encounter the same broblem just like you discribed. I want to make a main VI (common platform)as a EXE and calls all sub-VIs dynamically,these sub-VIs are have same I/O interface and made depend on project requirement,so it can't including to the main.EXE. would you help me on this issue? my E-mail adress be followed : Steven.huang@wongswec.com, your kindly support will be a great appreciated!
 
 
0 Kudos
Message 3 of 10
(3,485 Views)

"Steven_huang" <x@no.email> wrote in message news:1148350207723-368912@exchange.ni.com...
Hello ESchell,
&nbsp;
Did you solved this issue? I encounter the same broblem just like you discribed. I want to make a&nbsp;main VI (common platform)as a EXE and calls all sub-VIs dynamically,these sub-VIs are have same I/O interface and made depend on project requirement,so it can't including to the main.EXE. would you help me on this issue? my E-mail adress be followed : <a href="mailto:Steven.huang@wongswec.com" target="_blank">Steven.huang@wongswec.com</a>, your kindly support will be a great appreciated!
&nbsp;
&nbsp;


Hi,


Most likelly, you run into the following problem. Because you run an executable, not all vi's LabVIEW uses are available. When you dynamically load a subvi, normally all of it's subvi's are available, but in the executable, the subvi's will not be found.


To check this let the executable open the vi's front panel, the run butotn should be broken. You can also open the subvi manually. Run the executable, and while it's running use the command line (Start>Run...), and type "Fullpathtoexecutable\executable.exe" "fullpathtosubvi\subvi.vi". The exe will try to open the subvi, and you'll get a bit more error information.


To solve this you'll have to find a way to include all the subvi's. You can make a llb of the subvi. If you use save as.. and select development distribution all the subvi's are saved. You'll have to adjust the path to the subvi. The best this to do (if possible) is to make a new vi that has all subvi's in it, and save this one as llb. You'll have all dynamic vi's in one llb, with all the subvi's in it.


An alternative is to make one llb that has all subvi's (you'll have to figure this out by using method 1, or by starting the subvi, and add subvi's untill it works), and use single vi's. If the llb is in one of the exe's subdirectories, they will be found.


Regards,


Wiebe.





Message 4 of 10
(3,475 Views)

Hi Eschell,

      In addition to the possibilities already expressed...

Is it possible that the EXE is not closing the VI-reference(s)?  I'm not sure, but I think the EXE will re-use a copy which remains in memory and might not see changes to the callee until after the EXE is re-started, and the callee re-loaded.

Cheers

Message Edited by Dynamik on 05-23-2006 03:47 AM

When they give imbeciles handicap-parking, I won't have so far to walk!
Message 5 of 10
(3,471 Views)
HellHello Wiebe,
Thnaks for your detailed suggestion but my broblem is not solved yet.
I attached a demo that you can understand my questions clearly.
 
code description:
1,main.vi and main.EXE are exited in DynamicVI.zip.
2.DynamicVI_Config.ini can be changed among "SubVI1.vi", "SubVI2.vi" and "SubVI3.vi"(Note that these three subVIs, as well as their called subVIs, are all packaged in the DynamicSubVI.llb, this is necessary otherwise LabVIEW will report a "Can not find subVIs" error. ).
3.subVI2 and subVI3 are can be called by main.vi and main.EXE,subVI1 can be called by main.vi BUT can NOT be called by main.EXE unless remove 'hp34970.vi'. the error code is 1003 "this vi is not execulable" not error code 21 'can not find subVIs'.
My questions:
Why is the subVI1 can NOT be called by main.exe unless remove hp34970.vi??? (error code is 1003 not 21) How can I do?
any other good suggestion?
 
Attachment that you need add to a folder together!  PLEASE See next page also!!!!
Download All
0 Kudos
Message 6 of 10
(3,433 Views)
Attachment!!!

Sorry , I can't upload main.exe file, maybe you need to build it by yourself and do not including subVIs in labVIEW builder.

 

 

0 Kudos
Message 7 of 10
(3,431 Views)

"Steven_huang" <x@no.email> wrote in message news:1148434808136-369523@exchange.ni.com...
HellHello Wiebe,Thnaks for your detailed suggestion but my broblem is not solved yet.I attached a demo that you can understand my questions clearly.
&nbsp;
code description:1,main.vi and main.EXE are exited in DynamicVI.zip.2.DynamicVI_Config.ini can be changed among "SubVI1.vi", "SubVI2.vi" and "SubVI3.vi"(Note that these three subVIs, as well as their called subVIs, are all packaged in the DynamicSubVI.llb, this is necessary otherwise LabVIEW will report a "Can not find subVIs" error. ).3.subVI2 and subVI3 are can be called by main.vi and main.EXE,subVI1 can be called by main.vi BUT can NOT be called by main.EXE unless remove 'hp34970.vi'. the error code is 1003 "this vi is not execulable" not error code 21 'can not find subVIs'.
My questions:
Why is the subVI1 can NOT be called by main.exe unless remove hp34970.vi??? (error code is 1003 not 21) How can I do?
any other good suggestion?
&nbsp;
Attachment that you need add to a folder together!&nbsp; PLEASE See next page also!!!!



DynamicVI_Config.ini:
http://forums.ni.com/attachments/ni/170/186433/1/DynamicVI_Config.ini



DynamicSubVI.llb:
http://forums.ni.com/attachments/ni/170/186433/2/DynamicSubVI.llb



DynamicVI.ini:
http://forums.ni.com/attachments/ni/170/186433/3/DynamicVI.ini



Steven,


I don't have the entire hp34970 library, so it won't work on the development environment either.


I still think the exe won't load the hp34970.vi because the subvi's are missing. You can try to put the hp34970 in the exe as dynamic vi (just to test, the whole purpose is probably to be able to not include it). See if the exe can find the vi now.


Did you try the command line trick? See if the exe can open the hp34970.vi with the command line. See what errors you get (probably it cannot locate hp34970 Initialize, close, etc.).


You can also put the hp34970 library (llb or directory) in a subdirectory of the executable. See if it helps.


Regards,


Wiebe.






0 Kudos
Message 8 of 10
(3,422 Views)

Hello Wiebe,

Thank you very much!

I tried the command line but no any effect.

Now I sovled this problem :

I made a llb that including all dynamic vi and dynamic vi's subVIs.My labview installed on disk E, so the exe still can not find the 34970.lib that installed in E:\program files\national instruments\labview 7.1\instr.lib\ cos the labview default path on disk C\program files\national instruments\.....

I change labview search path in Application.ini as :

[Application]

viSearchPath="E:\program files\national instruments\labview 7.1\instr.lib\*"

then run the program dynamic VIs are link OK!Smiley Wink

Thanks you good suggestions to make a llb including all dynamic VIs.

Steven

0 Kudos
Message 9 of 10
(3,417 Views)
Wiebe said:
You can also put the hp34970 library (llb or directory) in a subdirectory of the executable. See if it helps.
 
Hello Wiebe,
I think put the hp34970 library in a subdirectory of the executable also OK!  thank you!!!
 
Steven
0 Kudos
Message 10 of 10
(3,415 Views)