LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LVOOP VI Override broken if sibling broken

Solved!
Go to solution

I saw some old thread about this but no update from NI since 2010.

Let's take the example bellow.

 

sklod_0-1586432014708.png

sklod_1-1586432131808.png

I create an error on Son_2.Fct.

 

The Son_2.Fct is broken

The Son_1.Fct is OK

The Mother.Fct is OK

 

Until now everything is working as intended.

 

I added the Mother.Fct in a normal VI and that broke the VI.

sklod_2-1586432400602.png

 

As I saw in old thread, this isn't intended to work like this.

All my classes are set like this.

sklod_3-1586432629385.png

 

sklod_4-1586432653300.png

 

This seems to work in Teststand even if a sibling is broken.

 

Is there any way to solve this problem, because I’m not installing all the sibling drivers when I’m using only few of them and I’m not going to delete every time the classes that I’m not using.

 

Or am I missing something.

0 Kudos
Message 1 of 4
(2,037 Views)

Breaking with the constant "Mother" class input is a bit strange but I would expect the VI to be broken if the input was a control of the same class so I'll try to explain that reasoning (I wouldn't expect "Mother" to be a concrete class so it probably wouldn't be a constant in any real application anyway).

 

My understanding is that if the the "Mother" class input is a control, the actual object class couldn't be determined until runtime. You have Mother, Son1, and Son2 in the project so they are all loaded into memory meaning LabVIEW will see that the Fct method could Mother.Fct, Son1.Fct, or Son2.Fct. If any one of those methods is broken then LabVIEW will throw an edit time error because otherwise it could potentially call a broken VI.

 

I don't know your exact setup or exactly what is happening in TestStand but my best guess is that TestStand isn't actually loading all three classes at once. If you are just loading Mother and Son1, both instances of Fct can execute so the step should run as normal. In your LabVIEW example, if you remove Son2 from the project and all dependencies, the VI should be runnable (you might have to reload LabVIEW). Similarly, you could change your application to dynamically load the class it needs as a plugin. If you were to go that route, you would be able to load Son1 but would receive an error if you tried to load Son2.

Matt J | National Instruments | CLA
Message 2 of 4
(1,993 Views)
Solution
Accepted by topic author sklod

Thanks for the reply,

 

The goal here is to have something like this. So, the class name will invoke the wright VI

sklod_0-1586849394197.png

When you are saying "you could change your application to dynamically load the class". Are you talking about a call by reference.

 
 

Sadly, it doesn't work with class.

 

I agree with the fact that labview load all the child class and that's what breaks my VI and Teststand doesn't. And your second paragraph gave me an idea. This time I created a new project to set the VI that uses the class.

 

Capture.PNG

 

And this time, it does work. It seems that if the project doesn't have the whole class hierarchy it'll load only what's needed and the vi will crash only if it calls the broken VI.

 

This video explains it better than me 🙂

https://www.youtube.com/watch?v=3zizYonIF2Y

 

Thanks,

0 Kudos
Message 3 of 4
(1,940 Views)

@sklod wrote:

 

When you are saying "you could change your application to dynamically load the class". Are you talking about a call by reference.


 

It looks like the video you linked shows what I was trying to explain which is using the Get LV Class Default Value function. This lets you load a .lvclass file by path so you don't need need it in the project which is more or less what you ended up with.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 4
(1,928 Views)