08-08-2012 04:45 PM
I am trying to interface with a proprietary .net dll. The problem I am having is that this dll can be in multiple places and may not always be in one location. This means that when I open a VI that tries to link to the dll and it is not in the correct location, the VI throws warnings that I don't want my users to ever see. The NI help that I have seen makes it clear that when the VI is opened any .net assemblies referenced are loaded.
I have tried breaking the portion of the VI that interfaces with the dll in to a sub VI and then trying to dynamically load it after checking that the dll is present in the expected location. I have tried "dynamically loading" and and "call by reference", "Call by reference" does not work as it still tries to load the .net assembly no matter what the "call setup" settings are. Dynamically opening the sub VI seems to work in the sense that if the sub vi references a bad dll location, the caller does not fault unless it is run. However, I am also trying to manage some .net references which seem to be dropped in the dynamically called sub vi. I have tried using global variables to hold the references as well as doing a "get value" from the upper level VI.
I am not real familiar with the .net world and would appreciate any pointers you can give me.
08-14-2012 09:41 AM
For your application, dynamically calling the vi that uses .NET is the way to go. I think the problem that you are having is passing values between main vi and dynamically called vi. If I were use, I will created a queue in the main vi and reference to the same queue by name in the dynamically called vi. Let me know does that work.
08-21-2012 10:57 AM
It is unfortunately not possible to handle .NET assemblies in the fashion you wish. One workaround possibility is to put a shortcut to the dll into the VI directory. This would throw a warning, but allow the dll to change location without breaking the program. For more information on .NET assemblies and how they are loaded into LabVIEW, see the following links:
http://digital.ni.com/public.nsf/allkb/32B0BA28A72AA87D8625782600737DE9
http://digital.ni.com/public.nsf/allkb/C4EA5ABBEB67AF7C862573F3004D4421