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: 

modularity: how to automatize new actions without modify code (remove hard coding)

Was the parent class inside of a PPL of its own?  If not, then the parent was actually put into the PPL you are trying to load.  So it is a different class hierarchy.  Build your main parent class into a PPL.  Use that PPL in your main code and have your plugins also inherit from that PPL.


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 11 of 13
(236 Views)

hello

 

my LVLIBP only contains the child class.

I just realize the problem is the same with "to a specific class" when I invoke classes directly in the project and not classes inside the LVLIP. So It confirms what wiebe@carya said: it's not an appropriate function.

 

to sum up, what I did is to try to index child classes (my label fields) in order to process them in a dynamic dispatch VI (method VI that is present on each one, with the same name , the same pane, but different content)
constraint: I don't want to call them as constant, but from outside of the code.
I realized I can't cast a labview object since it requires to know the class it has to cast.

thus, I'm stuck. 😞

 

crossrulz thanks for your reply but I don't understand what you want me to do.

 

 

Pierre FCentum TNS, Grenoble
Certified LabVIEW Associated Developer
0 Kudos
Message 12 of 13
(225 Views)

Pierre_F wrote:

crossrulz thanks for your reply but I don't understand what you want me to do.


1. Have a project that is just the parent class in a library.  Build that into a PPL.

2. Update your main code to use the class inside of the PPL built in step 1.

3. Make another project that has your child classes.  Have them inherit from the class in the PPL built in step 1.  Build these classes into PPLs.

 

I think your problem is that your parent class is not currently in a PPL.  So when you build the child class, that parent class is being built into the child's PPL.  This adds the PPL's namespace to the parent class.  This means it is actually a different class than the one you are calling in your main application.  This is why you are getting an error when you try to do the To More Specific Class.  So by making the parent class into a PPL and updating everybody to link to the class inside of that PPL, everybody is now seeing the same parent class.


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 13 of 13
(214 Views)