LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

What polymorphic does a VI belong to?!

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

Message 1 of 15
(336 Views)

Re: What polymorphic does a VI belong to?!

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

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 2 of 15
(308 Views)

Re: What polymorphic does a VI belong to?!

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

Thanks crossrulz

Message 3 of 15
(301 Views)

Re: What polymorphic does a VI belong to?!

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!!

Message 4 of 15
(296 Views)
Solution
Accepted by m3rl3n

Message 5 of 15
(273 Views)

Re: What polymorphic does a VI belong to?!

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!!

Message 6 of 15
(248 Views)

Re: What polymorphic does a VI belong to?!

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

(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
(238 Views)

Re: What polymorphic does a VI belong to?!

@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...

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

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

Message 8 of 15
(182 Views)

Re: What polymorphic does a VI belong to?!

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
(144 Views)
Highlighted

Re: What polymorphic does a VI belong to?!

@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