04-09-2009 07:24 AM
I want to build an application with some subVI's. The target would be to have an *.exe from the topVI and a seperate file for every subVI (I suppose this will then be a *.dll file)
The topVI uses the "call by reference node" with a "type specifier VI refnum" reference.
The path of the subVI's is read from a textfile and the subVI's are called dynamicly, all subVI's have the same connector layout.
Until now I was not able to generate a *.exe file wich is able to dynamicly call subVI's which are not included in the *.exe file (I tried with *.vi, *.llb and *.dll versions of the subVI's).
Building this application with all subVI's included in the *.exe is no problem and works fine, but is not what I want.
The target would be to have the possibility to update only some subVI's without the need to build the whole application again.
This way of working would increase the flexibility to have different combinations of versions a lot.
I am using LV8.2.
Is my question anyway possible and if yes can somebody tell me how?
Thanks!
04-09-2009 09:16 AM
I don't see how you could possibly load a subVI as a dll. That just does not make any sense.
Loading a VI or a VI in an llb should be no problem. Are you using the Current VI's Path function and are you aware that it will return a different path when you build the executable? You have not provided much information except that the exe does not work. What kind of error code is generated when you try to load an external VI?
04-10-2009 05:38 AM
Hello,
A SubVI is actually what you call a sub-routine in text-based programming languages.
So when you build an executable from a VI with SubVI's, it will simply build everything into one exe file.
That's normal behaviour.
If you would like to use dll's for flexibility, than you have to build VI's seperately for every dll you want to build.
These dll's can than be called from within you main application executable.
This practice is often used by system integrators to protect there code otherwise than a larger executable, but mainly because of easy maintenance.
That is what I think you are also looking at.
So what you would like to do is perfectly possible and common practice, you may only have to change your top view of the actual application.
04-15-2009 02:14 AM
Thanks Joeri,
this is indeed what I want to have.
Now my problem is still how do I call these subVI's (which are now *.dll files) from the main application?
In my current topVI I use the "call by reference" but this only works with *.vi files and not with *.dll files.
So how can I call *.dll subVI's and also connect some inputs and outputs to the connector of this subVI.dll ?
Thanks,
04-15-2009 04:23 PM - edited 04-15-2009 04:25 PM
04-23-2009 06:11 AM
In the mean time I am able to call *.dll files. Thanks for this. But still I don't know how to dynamicly call *.dll files.
Currently I use the the "call by reference node" with a "type specifier VI refnum" reference, meaning I give the path of a VI to this "call by reference node" and this calls the given VI.
By using the "type specifier VI refnum" I specify the connector layout of the VI's I want to call.
Now I would like to do the same thing with the *.dll files.
Then I have a lot of *.dll files which all have the same parameters and all contains a function with the same name (offcourse different functionality).
This should make it possible to specify a "type specifier DLL refnum" and have a fixed connector layout with fixed connections for the "call library function node".
Then in the same way I would give a path to the "call library function node" to load the correct *.dl.
With the standard "call library function node" this seems not to be possible, there is no input to connect a path nor a property to set the path programmatically.
Is there an "advanced" version of this node available or how can this be done?
04-23-2009 07:35 AM
You actually have some options if you want to call sub VIs dynamiclly. This is also true if you have created an exe file. If you have test system compiled to exe file, you may add test ruotines as exstrenal VIs much in the same fashion as you do with DLLs. I suppose that is something like that you want to do, and some terms has been mixied. For more information on this topic search the labview help for "Dynamically Loading and Calling VIs". For example use the find example function and search for dynamic load.
Good luck
04-23-2009 08:47 AM
I think this is getting confusing. We are actually talking about two different things:
1) calling dll's from a LabVIEW exe (LV dlls or others)
2) calling external vi's dynamically from a LabVIEW exe
I've done quite a bit of both of these (but only with VI's included with the exe for the second). I believe the ability to specify the path to the dll on the Call Library Function Node was added with LV8.5, so you might be outta luck there. I think you could achieve the same effect with a wrapper library, but that would have to be coded outside LabVIEW. I think #2 is what you were talking about originally, and I don't see any reason why it wouldn't work. As Dennis mentioned, you need to be aware of how the current VI's path changes when it is part of an exe, but other than that, I don't see an issue. I haven't tried it though, so I'm not sure.
Chris
04-23-2009 09:04 AM
The ability to specify a path to a dll would be a good reason to upgrade. Functionally, there's not a lot of difference between dynamically calling a VI or a dll.