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: 

What polymorphic does a VI belong to?!

Solved!
Go to solution

I'm working on inherited code and the previous programmer did a wonderful job of using polymorphic VIs all over the place, but he did not organize his VIs and polymorphics in any logical order or hierarchy in the project. Thus when I come across a VI that is part of a polymorphic VI, I can't find the actual polymorphic vi that it belongs to.

 

Is there any way to do that?

 

TIA 

0 Kudos
Message 1 of 15
(2,967 Views)

Where you are calling the Polymorphic VI, you can right-click and choose "Open Polymorphic VI".


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 15
(2,939 Views)

DANG IT!!  I swear I looked at the right-click menu four or five times and didn't see it!!!!  ugh!!

 

Thanks crossrulz

0 Kudos
Message 3 of 15
(2,932 Views)

Opps, I was too quick.

 

The issue is where I KNOW a sub vi is part of a polymorphic, but when I bring the VI over to a block diagram, it is an instance of itself, not as a part of the polymorphic and at that point, I can't determine what polymorphic it is part of!!

 

0 Kudos
Message 4 of 15
(2,927 Views)
Solution
Accepted by m3rl3n

Show VI Hiarchy?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 15
(2,904 Views)

Hey Ben,

 

Yes, that will do it.  It doesn't get the exact one right away, but it definitely narrows down the options enough so you can click on the one of the higher level VIs until you find it. 

 

Maybe I don't use the hierarchy enough to appreciate its power, but that is the first time that it's been useful for me in many years!! 

0 Kudos
Message 6 of 15
(2,879 Views)

You should be able to open the VI, click on View --> This VI in Project, then right click on the highlighted VI and choose Find --> Callers.  I believe it will find the Poly that it belongs to.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 7 of 15
(2,869 Views)

@m3rl3n wrote:

Hey Ben,

 

...

 

Maybe I don't use the hierarchy enough to appreciate its power, but that is the first time that it's been useful for me in many years!! 


Granted there are days when I am not working in LV while developing an architecture but when I am actually turning ideas into code, I use the hierarchy many times a day. Particularly with the addition of Libraries and being able to group the libraries in the hierarchy screen. Hundreds of VIs grouped in a dozen or so libraries lets me quickly locate the VI I am after.

 

Since letters and numbers get scrambled in my head, I think in pictures. So when working on a project that looks like this...

 

figure13.png

 

I find it easy to locate a VI in a hierarchy that looks like this.

 

figure14.png

 

I wrote more about that and libraries in this nugget.

 

Now as far as polymorphics...

 

I find them irritating since they use WORDS to indicate which flavor and right-clicking "find all callers" gets me to the polymorphic and does not help me find where else in the code the VI in question is located.

 

Yes I understand that if I am using code developed by others how they be useful in first getting close and then fine-tuning the flavor but about 99.5% of the code I write is contractually required to be developed exclusively for that project and is restricted from ever being used again. While that seems silly and inefficient, I have to play by the rules of the lawyers.

 

Take care,

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 15
(2,813 Views)

A VI can simultaneously be used as part of a polymorphic VI and be used independently.  Inf act, a single VI can be used in several Polymorphic VIs, there is no "owner" of the sub-VI in the sense of LVOOP.  A Polymorphic VI is just an aggregation of individual VIs.  A Polymorphic VI knows who it's members are, but the members don't know they're part of a Polymorphic VI.

 

As such, there is no guarantee that a single VI has a 1:1 relationship to a given polymorphic VI at all. I would concur with Ben that the VI Hierarchy is probably the best was to find out any existing relationships (Assuming the polymorphic VI is actually in memory).

 

So the reason why you can't have a right-click menu stating "Which polymorphic owns this VI" is because polymorphic VIs don't OWN instance VIs at all. It's a fleeting acquaintance at best.

 

And having said all that, an entry for "Show polymorphic Usage" to open a possible dialog with multiple Polymorphic VIs would be super useful. But it would have to deal with multiple polymorphic VIs using the same instance VI.

Message 9 of 15
(2,775 Views)

@Intaris wrote:

Infact, a single VI can be used in several Polymorphic VIs, there is no "owner" of the sub-VI in the sense of LVOOP.  A Polymorphic VI is just an aggregation of individual VIs.  A Polymorphic VI knows who it's members are, but the members don't know they're part of a Polymorphic VI.

 


Look at that, i learned something today! I've never reflected over how polymorphism works in LV, i assumed they were a 'library' so both parties knew about it.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 10 of 15
(2,753 Views)