02-08-2018 05:49 AM
I have a top-level VI that allows the user to point to a directory. Inside that directory are several plug-ins that I want to be able to dynamically load into a subpanel during execution. Each plug-in calls a few sub-VIs, along with some LabVIEW primitives (for this example, each plug-in calls Traverse for GObjects). Traverse for GObjects shows up in my project dependency list inside the vi.lib folder.
When I run this program inside the IDE, it works fine. However, when I build an exe and load the VIs into the subpanel, it never finishes loading. The image of the front panel of the subVI shows up, but I can't interact with it.
I turned on the remote debugger and was able to view my block diagram while the executable was running. Here's what I see where I should see Traverse for GObjects (see attached...a big question mark where the VI should be).
So I take that to mean that when I build the exe, I must not be including my dependencies correctly. So I went into my build settings and have tried several things there, all to no avail. The other thing I did was take the default Support Directory (called data in my case) and place it directly alongside my output executable...my understanding is that if the exe is looking for a given VI, it will first check its own directory.
I also tried - in the Source File Settings option within the build properties - I set the Dependencies destination to be my executable (i.e. select dependencies, check the box that says "Set destination for all contained items", then choose my exe from the drop-down...shouldn't that effectively build anything listed in 'dependencies' directly into the .exe??).
A couple of things puzzle me:
1. the obvious, what am I doing wrong?
2. why doesn't the exe give me an error when I run it if it can't find it (if this is a setting that hides error messages, how do I turn it off)?
Thanks in advance for any help.
Solved! Go to Solution.
02-08-2018 09:33 AM
I'm still relatively new to VI scripting but I'm pretty sure that VI scripting functions are not available in the run time environment. You would have to call the dynamically loaded scripting code in an instance of the development environment, not the run time engine. I also found another forum here with a similar topic.
02-08-2018 09:34 AM
I have never tried to do this before so I hope this is correct. The thing you want to do is compile all of the "plugins" into a packed project library. And I believe all of the plugin's dependents need to be included there as well since the plugins don't have direct access to the files compiled within the EXE. I'm sure someone will correct me if that isn't correct.
02-08-2018 09:37 AM - edited 02-08-2018 09:46 AM
sirknoxalot - That's a good thought but I know for a fact that Traverse is supported (unless something has changed in the past 24 hours). I didn't go into detail in my original post but I have successfully created executables for this same application for 3+ years, albeit with a different approach to how the plugin got loaded (but the plugin itself remains the same and calls Traverse).
You are correct in that there are some functions - for instance Create GObject - that are not supported.
Thanks for the suggestion...
02-08-2018 09:45 AM - edited 02-08-2018 09:46 AM
aputman - I believe you are on track...I should have mentioned I found this article as well:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PAq8SAG
Notice a potential problem descriptor is that the exe loads but fails to do anything. I still don't understand though why I wouldn't be getting an error when it can't find the Traverse vi...
But setting that aside - I'm still not having luck even with following the instructions in the article. I have gone so far as to create a temp directory, and inside that I put my executable and all the dependent VIs, including Traverse.., and the same thing still happens. Surely the exe looks in its own directory?
02-08-2018 11:32 PM
wrote:
sirknoxalot - That's a good thought but I know for a fact that Traverse is supported
That's good to know. Thanks!
02-16-2018 06:47 AM
For anyone curious as to how this works, here's the formula I ended up using. I'm not saying this is the only way, or the right way, or anything other than, this is what worked for me.
This approach tells the exe that it can look in the support directory for the lvlibp that contains the dependencies.
Hope this approach works for you...