03-28-2018 05:48 AM
We have an application.exe (Block Diagram attached below) which contains the base class for dynamically dispatching the plugins during runtime.
The application.exe, child class and our dynamic VI uses same API’s of the “NI_AALBase.lvlib and NI_AALPro.lvlib” libraries. When we run using the source code, the child class and dynamic VI launches without any issues.
After building the executable, when the application tries to launch child class we are getting error attached in error1.png file
When the application tries to launch the dynamic VI we are getting the error attached in error2.png file
We tried the following steps to resolve the above mentioned issues:
1. We added the VI search path in the application.ini file for the dependent libraries.
2. We added vi.lib folder and copied the dependent library files inside where the executable is located.
3. We created the source distribution for the dynamic VI.
4. We also unchecked the “separate compiled code from source file” option in the VI Properties for the dependent library API’s
I have attached the source code and exe for the reference.
Can anyone provide some solution to solve this issue? Thanks in advance.
03-28-2018 06:24 AM
Your plugins really should be built into Packed Project Libraries (PPL). A PPL is a fully compiled library, so it will include all of the vi.lib dependencies, etc. This does go into a rabbit hole since you will also want your base classes also in a PPL. You might want to give this article a good read: Plug-in Architecture using Packed Project Libraries (lvlibp)
03-28-2018 07:20 AM
Add the Dynamic VI to the executable in "Always Included", In Additional Exclusion Uncheck the "Modify Project Library File.. " option. Refer the attached images for more details.
03-28-2018 07:55 AM
Update:
Uncheck the "Remove Unused members.." in Additional Exclusion and add the child class also in the Always included section.
03-28-2018 08:33 AM - edited 03-28-2018 08:41 AM
Anand the idea of the plug in is to modify and extend the software functionality without changing the executable. We cannot add this in always included option.
This issue we facing while we add few specific LabVIEW library vis in the plugin.
03-28-2018 11:45 PM
Hi Balaji,
I used to do this kind of plugin method in my earlier projects but I'm getting the similar error what you have posted.
I have tried with PPL. I have attached it for your reference. I'm able to dynamically load different child classes which are included in PPL while building executable. However, later when I update the PPL with new child (extension) and use the new PPL in existing EXE, I'm getting Error7 (file not found).
I'm also looking for this solution for one of my application.
Thanks,
Ajay.
03-29-2018 12:44 AM
Is there any other solution other than using PPL or Source distribution?
03-29-2018 02:36 AM
Hi all,
I have fixed the issue. Please find the attached modified demo zip. Please refer to LabVIEW Help to understand the root cause of this issue.
LabVIEW Help -> Fundamentals -> Working with Projects -> Concepts -> Using Source Control in LabVIEW -> Facilitating Source Control by Separating Compiled Code from VIs and Other File Types.
Now to fix the issue All did is removed the check box as shown in the image below (and saved the VI) in the VI lib and copied the files next to the exe.
அன்புடன்
தமிழ் நேரம்
முதல் இந்திய ஆய்வுமெகபொப சிற்பி
சோதனைநிறுத்தம் சிற்பி
மற்ற சான்றிதழ்கள்
யாதும் ஊரே! யாவரும் கேளிர்!!
03-29-2018 08:09 AM
I have another question, If you create a child class for a base class and build the EXE only with the base class then can we expect the child class can be loaded dynamically without any issue? I was under the impression that the child class wouldn't be able to link to a class which is inside EXE, please correct me if I am wrong.
03-29-2018 08:18 AM
Hi Anish,
That setting is only/mainly with respect to the SCC context. How does it matter/impact in the current context of dynamically calling any of the non-primitive VIs from vi.lib/err.lib, etc.