01-19-2007 06:00 PM
01-20-2007 11:09 AM
When loading VIs dynamically, LV does not search for the VI. If it is not in memory or where you said it will be, LV will return error 1003. This is because the search is done only for subVIs, which have their paths stored as a relative path inside the calling VI.
To get the exe to call the VIs, you should include them in the build. You can do this either when you build the executable by adding the top-level VIs as support files or, more easily, by having a VI which will not be called in your top-level VI and let that VI hold all those VIs in it. Since it will not execute, the VIs will only be used when you call them dynamically.
Note that if you're using 8.x you should use a case structure (not the disable structure) with a boolean control wired to it. If you use a constant, LV will ignore the code and the VIs will probably not be included in your executable.
01-22-2007 06:14 AM
01-22-2007 07:09 AM
01-22-2007 08:26 AM
01-22-2007 01:26 PM
@batesbc wrote:
The VIs that are disappearing are polymorphic VIs (specifically DAQmx stuff), even though the executable has the "disconnect typedefs and remove unused polymorphic VIs" unchecked. We have a Loader.exe, which dynamically calls our DAQmx controller code, which has the DAQmx driver VIs as subVIs. Do subVIs in dynamically called VIs still follow the parent exe's .ini file?
tst already told you what is the issue. The reason is that the DAQmx VIs reference DLLs and LabVIEW tries to link to those DLLs but failing to find them it also fails to load the VI in an executable for good reasons. You couldn't do anything with the broken VI anyhow in an exe.
Only the DAQmx installer knows where and how to put all the necessary DLLs and add the correct registry entries for DAQmx to work correctly.
Rolf Kalbermatter
01-22-2007 01:47 PM
01-22-2007 01:57 PM - edited 01-22-2007 01:57 PM
Message Edited by batesbc on 01-22-2007 01:58 PM
01-22-2007 02:59 PM
I don't know how an executable treats polymorphic VIs which are called dynamically, but your setup sounds a little bit too complicated to me (although I have to admit that 3700 VIs does sound like a very big project).
In any case, based on your description, the best guess I currently have is that the problem is not with the search path (since the DaqMX VIs should know exactly where their stuff is), but maybe with the vi.lib part.
This folder is saved as a logical folder when using the relative path (i.e., it doesn't matter where your VI is, it will always remember that the vi.lib VIs it calls are found in <vilib>/whatever).
Since the EXE does not know where your vi.lib library is, any VI using a vi.lib VI would possibly have some problems. There might be an INI key to set the vi.lib folder to another folder, but I never found it (I wanted to change user.lib to another path).
01-22-2007 04:46 PM