03-14-2014 03:17 PM
In LabVIEW 8.6 and earlier, I am able to dynamically load VIs from disk files. There are some standard library VIs that would not load if they were called in the VI I was dynamically loading. To overcome this, all I had to do was call the library VIs somewhere in the compiled code, typically in a case structure that would not execute.
In LabVIEW 2012 & 2013, this method will not work. The only way I can dynamically load a VI is if I put the VI in the always include section of the build and load it from the .exe file. The problem with this is that if I make any changes in the dynamically loaded VI, I have to recompile the main application.
I remote support many test stands. On those with the older versions of LabVIEW, I can make a change in one of the dynamically loaded VIs and drop it on the test stand in the background while it is running. On the next test the change is automatically picked up when the VI is dynamically loaded again. With the new version of LabVIEW, I have to interrupt production, stop the machine, recompile and then restart the machine.
Below is sample code and an error I get in 2013 for VIs that will not load even though I have these in the .exe file. Anyone know a way around this?
Solved! Go to Solution.
03-17-2014 11:14 AM
Hi,
Do any of the VI’s you’re calling use any .NET calls? Sometimes this error message will appear if you do not have the correct version of the .NET Framework installed on the target machine.
Additionally, it is worth checking that you are placing these dynamically loaded VI’s in the correct file path. Take a look at the following two KnowledgeBase Articles:
http://digital.ni.com/public.nsf/allkb/644C66077212FC218625760F004C6733?OpenDocument
http://digital.ni.com/public.nsf/allkb/EEE8A5650DAC28558625762F0070A384?OpenDocument
The first article explains a couple techniques for dynamically calling VIs from an executable without including them in the executable. At the end of the article it mentions that in LabVIEW 2009 and later, the file structure for executable applications has changed, which is explained in the second article mentioned above.
Regards,
03-17-2014 12:00 PM
Thanks, Linsday. For now, using the LabVIEW 8.x file layout under the Advance Tab of the application properties solves the problem.
03-17-2014 09:45 PM
Do you notice the Red appearance of the FP Property Node? It's my understanding that this marks a "deprecated" feature, one that might not work any more. Try using the Front Panel Invoke node instead and see if that fixes the problem.
03-18-2014 09:48 AM
Thanks pointing out the depreciated property node, although it does still control the front panel, that is something else I need to search for when migrating older code to 2013. Normally that is not in there, just the open and invoke node. I added it (copied from older code) to leave the front panel open after the invoke from an exe so I could 'run' the broken vi to see what is was missiing. The real issue is the file paths as Linsday pointed out.