From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic loading of VIs from compiled program in LabVIEW 2013

Solved!
Go to solution

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?

 

TestEXELoad.vi Block Diagram on ZH Adv Test.jpg

 

TestEXELoad.jpg

 

 

 

0 Kudos
Message 1 of 5
(2,880 Views)
Solution
Accepted by topic author smillard

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, 

Message 2 of 5
(2,821 Views)

Thanks, Linsday. For now, using the LabVIEW 8.x file layout under the Advance Tab of the application properties solves the problem.

0 Kudos
Message 3 of 5
(2,805 Views)

TestEXELoad.vi Block Diagram on ZH Adv Test.jpg

 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.

0 Kudos
Message 4 of 5
(2,788 Views)

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.

0 Kudos
Message 5 of 5
(2,764 Views)