Jump to content

Trouble validating two objects and using DD with Call Parent Method


Recommended Posts

cross posted: http://forums.ni.com/t5/LabVIEW/Compare-parts-of-two-child-objects-and-use-call-parent-method/td-p/2530980

 

I am trying to validate if two child objects can be grouped together, based on some conditions in their private data. So, I would like to have a "checkIfValid" method in the parent class that has both the settings must override and must call parent method.

 

However, I am running into problems because the connector panes must match. The following VI gives me a broken run arrow. Is there any way to implement what I want? A picture is worth a thousand words so here you go. Is there any way for me to do this comparison, while using DD to force the call parent method?

 

post-15770-0-31542200-1377036479_thumb.p

 

 

Edited by for(imstuck)
Link to comment

The second StraingChannel Needs to be the same object type as the parent VI. This means that instead of StrainChannel data type, it needs to be ParentOfStrainChannel Data type. My guess is you'll need to cast it to the child data type in the code you screen shotted, or you'll need to figure out another way of doing this.

Link to comment
The second StraingChannel Needs to be the same object type as the parent VI. This means that instead of StrainChannel data type, it needs to be ParentOfStrainChannel Data type. My guess is you'll need to cast it to the child data type in the code you screen shotted, or you'll need to figure out another way of doing this.

 

Yeah, I know I can use to more specific. Was just wondering if I could avoid any run time type checking also. Looks like that may be unavoidable.

Link to comment

Mind. Blown. 

 

So, awesome, in depth response AQ, but I don't think the benefits outweigh the increased implementation time and potential support of this all. I have stuck it in my back pocket for future reference, but when I sit down and think about the ramifications of a potential incorrect input being wired to the connector pane and getting a run time error vs the implementation time of the above suggestions, I actually feel the right decision is to just deal with and handle a run time error. Of course, there is always the argument that putting in the upfront time can save you run time debugging down the road, but since it sounds like these implementations all have their own potential drawbacks, I'm kind of just picking my poison.

Edited by for(imstuck)
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.