LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get LabVIEW Class Default.vi cannot find the class in executable

Architecture of my project includes dynamic loading of classes with Get LabVIEW Class Default.vi. It works fine under LabVIEW IDE. When compiled in EXE problems appear.

 

Get LabVIEW Class Default.vi cannot find the class specified in the class path unless the class was already loaded. The problem appears in parts of the code that are not new. They were already debugged and worked properly in EXE. Irrelevant parts of code were added; EXE was recompiled and the problem popped up.

 

I cannot upload the project here and I cannot reproduce the problem on a small scale.

 

The attached project doesn’t suffer from the same problem despite the solution is basically the same.

 

MAIN.png

 

If the real project runs as EXE, the first frame generates error 7, the second and third frames work error-free.

 

Please suggest what could go wrong and how the problem can be nailed.

LabVIEW 2021 32-bit.

_____________________________________
www.azinterface.net - Interface-based multiple inheritance for LabVIEW OOP
0 Kudos
Message 1 of 4
(104 Views)

I believe the only reliable way to use a dynamic load/plugin architecture is to use PPLs.  Create and build a parent PPL containing the parent class as Parent.lvlibp:Parent.lvclass, then create a child class inheriting from the parent in Parent.lvlibp (not the Parent.lvclass before it's built into a PPL).  Then put that child class into Child.lvlibp:Child.lvclass as another build, and load that to get the dynamic class load feature working.

 

I do not do this myself, but one of my co-workers does and it works for him.  I can't speak to a lot of details here because of that.

0 Kudos
Message 2 of 4
(67 Views)

It seems like it should be working, I can't tell from your example where the problem is. But I have to ask why you're even bothering loading these things dynamically within an exe, rather than just statically linking?

0 Kudos
Message 3 of 4
(61 Views)

The dynamic loading is likely the cause of the issue. If the builder does not see a hard dependency, it will not be included in the executable. By calling the class by path, the builder does not see the child as a hard dependency and therefore will not include it in the build. You can add the class to the "Always Include" in the build specification.

 

Personally, I go the PPL route Kyle was referring to. This makes the build for the executable a lot simpler/faster. If I find a bug in the child class, I only need to rebuild that PPL and my executable is still happy. If there is a bug in the executable, only the executable needs built, not the libraries it is using. It does take some care to keep the PPL build order and destinations correct. And then the deployment needs to keep relative paths between the PPLs. But after a few attempts, it becomes almost second nature. I also use the LabVIEW Solution Builder to build my PPLs.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 4
(43 Views)