LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executable can't load class

Solved!
Go to solution

I am calling a class from a VI using the "Get LV Class Default Value By Name.vi" and the  "To More Specific Class". 

 

EthanTheHut_0-1644936032571.png

 

 

 

The code is supposed to select the correct child class for a given class. The DSSP.lvclass represents the Device Specific Software Plugin from the Hardware Application Layer model. 

 

EthanTheHut_3-1644936264095.png

 

The Child class is called InstX and has 2 versions. The InstX Version Read.vi reports back with a message saying what version it is (this is done to test the mechanics of the class selection). 

 

 

EthanTheHut_2-1644936204788.png

 

 

EthanTheHut_1-1644936156551.png

 

 

It all works very well. That is until I create an executable application to deploy to a runtime machine.  Then I get this message.

 

EthanTheHut_4-1644936340779.png

 

Other details. 

 

I get this message in the labview environment as well when I try to run the VI without having the project open where the DSSP classes are. 

 

Any idea why labview cant or wont load the classes?

 

Thanks!
John Hess
0 Kudos
Message 1 of 11
(2,708 Views)

Because you are dynamically calling the classes, the builder doesn't know you need that class.  You need to go into the build specifications and "always include" the class library you want.


GCentral
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 2 of 11
(2,705 Views)

I thought I had done that but maybe I have it wrong. Do I need to make a specific library? Or is what I did below not what your talking about?

 

EthanTheHut_0-1644938038516.png

Here I am just including the files as they have been added to the project. 

 

Thanks!
John Hess
0 Kudos
Message 3 of 11
(2,698 Views)

I'm not sure if that will work or not.  You might have to explicitly choose your classes instead of using the folders.  That is not something I have tried.


GCentral
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 11
(2,687 Views)
Solution
Accepted by EthanTheHut

Add something like this to your factory VI, and the builder will include the child classes automatically.

Spoiler
FireFistRedhawk_0-1644938855630.png

 

Edit: I've never personally used "Get LV Class Default Value By Name.vi". AFAIK, the typical factory pattern uses "Get LV Class Default Value.vi" instead, which takes in a path to the class not its name. Probably why it doesn't run in dev environment unless the classes are in memory. Not sure if it has something to do with the runtime troubles. Here's my full factory VI.

 

Spoiler
FireFistRedhawk_0-1644939222217.png

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 5 of 11
(2,685 Views)

That fixed the problem!!!  Thank you so much!

I just dropped the child classes right on the block diagram (InstX V1.lvclass and InstX V1.lvclass). Now the executable works great!

This is good because I am going to use this architecture for my physical instruments. 

EthanTheHut_0-1645046780289.png

 

Thanks!
John Hess
0 Kudos
Message 6 of 11
(2,642 Views)
Solution
Accepted by EthanTheHut

I had the same problem and fixed it a little bit different. While placing the classes on the block diagram is working perfectly fine you always have to remember that you have to do this for ever new class you add to your project.

 

I added the whole classes folder to the build spec with the "always include" option. Then load all the classes in this folder by path ("Get LV Class Default Value.vi"). Now I can use the "Get LV Class Default Value By Name.vi" everywhere I need it without bothering about adding an object of it to the block diagram first.

 

Load LV Classes.png

0 Kudos
Message 7 of 11
(2,599 Views)

I really like this. Thanks!

 

I think loading from file is more robust way to go, I was missing this part for my include and it would not work. Now it works!

Thanks!
John Hess
0 Kudos
Message 8 of 11
(2,564 Views)

Can you explain where you place this block diagram you attached? I get an error when i run it in my load from factory pattern VI of my class. The other solution worked, but would prefer yours as I wouldn't have to update each time I add a child class.

0 Kudos
Message 9 of 11
(207 Views)

I execute the VI in the start-up routine of my program before I want to do anything with the corresponding classes.

0 Kudos
Message 10 of 11
(196 Views)