From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get base class name

Hello,

 

I am calling child implementation of come class. Child implementation loads some vis dynamicly based on class name. I am using Get LV Class Name.vi to do get the full name of loaded implementation. I need to do the same for base class when child implementation is running to load other vis dynamicly. 

Is there a programatic way to do that? I want this to be universal so path always will be correct, when I use this class standalone or load form ppl.

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

Just use the Call Parent Method and let the parent handle it.


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
Message 2 of 4
(2,492 Views)

Another stupid thought: Make a protected method in your parent class that outputs both the parent's path/name and the child's path/name.  Then you can just have any child classes call it.


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 3 of 4
(2,485 Views)

Usually, those dynamic VI's (based on class name) can be made static for each child. So, make a VI that returns the reference, and implement the VI for all children. Each VI returns a different VI, by simply returning it's static VI reference.

 

Doing this by name is a hack (although you might need to get the VI name from the reference so you can instantiate a clone). You can't find where the VI's are used (find all instances), you won't notice broken VI's (unless they are in the class), they aren't automatically included in executable (unless in class), etc.

0 Kudos
Message 4 of 4
(2,452 Views)