LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open VI Reference and Stand-Alone

Hi!
Using LabView 7.1 under XP I made a vi which creates a report in Excel format.
The vi runs correctly but, If I do a Stand-Alone application of that vi, an error 7
(problem occured at Open VI Reference in New Report.vi) appears when I launch the exe. Why ?

Someone has any idea ?

Thanks
0 Kudos
Message 1 of 5
(3,179 Views)
The path of the directory in which a VI is stored is different before and after building an application.

The VI Path before is Directory\VI, whereas after it's Directory\Application.exe\VI.

Make sure you're stripping the current VIs directory correctly and that as a result, the name of the VI you're trying to load is correct.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 2 of 5
(3,179 Views)
Thanks Shane,

You are perfectly right!

When I build the .exe, I have to include the vi's called with "Open VI Reference". Lots of such calls are made in "New Report.vi" or "Dispose Report.vi" for instance.

Regards,

Frédéric
0 Kudos
Message 3 of 5
(3,165 Views)
Hello,

Can you explain how you solved the problem? In a similar case I used the constant "Current Vi's path" as input to "Strip path" and looked for the files in the parent directory. Since I put my Vis in a library (llb), when testing within LV it went to the parent of the LLB and when running the EXE it went to the parent of the EXE, same folder in both cases. I never liked my workaround so i'd be happy to have a "cleaner" solution.

Thanks,

Marcelo
0 Kudos
Message 4 of 5
(3,155 Views)
I my particular case, I only add the vi's that are dynamically called in the Source Files list of the Build Application (see attachment). I did nothing else !
On the other hand, I have Oslo observed that the "Current Vi's path" gives for example:
c:\directory1\directory2\Library.llb\viName.vi
when testing within LV while it gives
c:\directory1\directory2\Application.exe\viName.vi
when running the EXE. I have first expected to get
c:\directory1\directory2\Application.exe
when running the EXE and thought it was a bug of LV. However, there is no bug (here) and "Current Vi's path" works as described in the documentation:
"...If you build the VI into an application, this function returns the path to the VI in the application file, and treats the application file as a VI library.".

Regards,

Frédéric
0 Kudos
Message 5 of 5
(3,141 Views)