LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect if VI was Overridden

This might a stupid question because "Why would you want that?" but I have a case where I think what would be useful is the way to detect if a dynamic dispatch VI was overridden, from within that VI.

 

So I have a case where I have a function that can operate on an array of items.  This VI in the parent class must be overridden, and it must call the parent function in the child.  This is because the child is the one that actually does the work, and the parent just does some tracking of what took place.

 

Now I have a desire for this same operation to work on a scalr of items.  So I thought I would be smart and say if the parent item doesn't need to be overridden, and if it isn't, then I would just call the parent array working function that I had earlier, and if it does have a child specific override then it can work on the data knowing that there is only one item (because it is a scalar).  The problem comes when I want the parent scalar function to perform similar tracking like the array parent function does.  I think the only option is to force the child to override the parent, and then the parent can either perform the tracking if the child overrode it, or perform the parent array call if it wasn't overridden.

 

So is there a way for a parent function to know if it was overridden, and is being called from the child that overrode it, or it wasn't overridden and to perform all the work needed?  Is there an easier way to do what I want?  Basically to default to performing the array function with one item, but allow the child to override it and do something with the one item if it did.  I wanted to avoid adding other terminals to these functions as they need to be the same on all the children, but that might be the route I go.

 

EDIT: Yeah I'm just adding another input that the child can set, notifying the parent call that the child did some work

0 Kudos
Message 1 of 3
(2,997 Views)

Perhaps the Call Chain would show the child in it...I have not tried this at all, but it is worth checking out.


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 3
(2,959 Views)

Not near a dev machine to try test code now, but does the Call Chain reveal anything to distinguish the cases?  It "feels like" it should, since you would actually enter and begin executing the child method vi before redirecting back to the parent method vi.

 

 

-Kevin P

 

P.S.  Dang, opened the thread and then got around to answering much later without refreshing and seeing the same answer already waiting.

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 3 of 3
(2,945 Views)