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.
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.
10-17-2008 01:54 AM
Hi,
I try to use "to more specific" VI to access child class (B) from class parent (A) // see attached Classe.bmp //. I can run the VI (no wire conflict) but I get the err code 1448, wich I can't interpret...
I construct class B with iheritage from class A //see attached Inheritage.bmp//. I would like to use methods and parameters of A (violet wire) in B.
What I am doing wrong ?Is it a bug or what ? I see LV exemple NavScreen.lvlib that do exactly the same with ClickableText.class from Link.class...
Thank's in advance I am very stucked here.
10-17-2008 03:13 AM
Hey bull balls
I think the following thread is talking about the same problem: http://forums.ni.com/ni/board/message?board.id=170&message.id=238663&requireLogin=False
Hope this helps,
Christian
10-17-2008 05:44 AM
Hi, Thank's for your reply.
I have already read it & it seem's to be no issue, but what's weird is that in the NI exemple (LV8.5), they use exactly the "to more specific".
Anyway, how can I access parent's parameters from child ? Any idea ?
Thank's
10-17-2008 07:06 AM
Hi!
If I'm not mistaken you cannot access the parents object data directly. Instead, implement accessors, functions that reads or writes object data, in the parent class and use these functions in the child class. If you do not wish these functions to be used outside these classes inheritance scope, make their access scope 'protected'.
At least in 8.6 there are templates for Data Member access vi:s if you right click your class.
Hope this helps.
//M
10-17-2008 07:15 AM
Type casting a class wire has two effects. It changes the type of the class on the diagram so that you can wire child methods directly. Secondly, at run-time, the expectation is that the actual class on the wire is of the type you cast or a child of the casted type. If it is not, you will get an error.
To access a parent's parameter, you need to create an accessor VI on the parent. This accessor allows the child to get the parent data.
01-10-2020 05:09 AM
Hello,
How to create that accessor vi .I am unable to pass child parameter/control values to parent class parameters/controls. I tried with adding child as friend to parent and also inheritance from child to parent but not getting to know how to update child class control value into parent class