LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Manu56

"CloneName" and/or "Clonereference" property of a subVI reference

Status: Declined

Any idea that has not received any kudos within a year after posting will be automatically declined. 

In the properties of a subVI reference, you can get the name and reference of the VI.


When The VI is re-entrant, with this property then you get the name and reference to the "Model" VI but NOT to the Clone associated to the subVI.

In scripting activities, it would be usefull to be able to get the name and/or reference of the Clone VI of an instance subVI...

 

For example, in development mode, I have a instance subVI of a re-entrant on which I need to put a breakpoint by scripting at runtime for debug purposes. This is something I actually can't do.

 

I think that's this is something easy and that might already exist (in private properties of subVIs ???) because when you double click on a subVI instance of a re-entrant VI, then the front panel of the clone (i.e. copy) of the original VI is opened. So there's somewhere a link between the subVI (reference) and the Clone VI.


(it's already possible in VI property to get the Clone name when this VI is re-entrant).

(Hope I'm clear...)

 

 

16 Comments
SteenSchmidt
Trusted Enthusiast

Unfortunately I don't think you'll get you wish granted, as obtaining refnums externally to clones of reentrant VIs is by all evidence on its way out. Please read this short article:

 

http://gpower.as/lvc-articles/82-a-vi-refnum-can-break-your-vi-s-password-protection

 

Cheers,

Steen

CLA, CTA, CLED & LabVIEW Champion
Manu56
Member

Very interesting article...

 

But I can reformulate my wish in another way :

Just a VI property that returns THE subVI refnum of THIS instance VI (Re-entrant or not, this doesn't matter).

 

 

SteenSchmidt
Trusted Enthusiast

But that's the issue; NI will never supply a method that will give you the This VI refnum from outside the VI itself. If they did, they'd have handed you a tool where you with VI scripting could defeat the password protection of any other VI.

 

And they won't supply you with a method that gives you some arbitrary VI refnum to a clone, as that is not supported for clones. The currently only published way to get this is by using the Open VI Reference function with the clone name, and that hole will by all probability be closed in the near future.

 

So, no way to get you what you ask for here I suppose.

 

/Steen

CLA, CTA, CLED & LabVIEW Champion
AristosQueue (NI)
NI Employee (retired)

Useful workaround: If you want to put a breakpoint on a particular clone when the subVI is called then right click on the subVI and select "SubVI Node Setup..." and then click the checkbox for "Suspend when called". This feature allows you to rerun the clone as many times as you want before you return to the caller. You can even set the property programmatically.

Untitled.png

 

Longer discussion:

Steen is right. It's a pretty tight catch 22, with only downsides to redesigning so far as we have been able to find thus far.

 

Manu56: There's an important problem with your original idea:

 

> In scripting activities, it would be usefull to be able to get the name

> and/or reference of the Clone VI of an instance subVI...

 

You say you want to do this during scripting. While scripting, there is no clone associated with a subVI. Clones are only handed out when the VI is done with editing and the VI gets compiled. While scripting, the subVI just references the real VI. Clones often don't even exist while scripting. And for shared clones, there is no clone associated with any particular subVI any time other than when the node is actually executing.

 

Adding a breakpoint isn't scripting, that's debugging (yes, I realize I'm splitting hairs that are meaningful to R&D but not necessarily to you as a user, but I need to be sure what use cases you're hoping for us to solve). We could do things to improve the debugging (like the Suspend When Called mentioned above) without solving the more general scripting case.

Manu56
Member

Aristos, the breakpoint was just an example... what I'd like is a "My subVI" refnum for an instance (It's the same problem you've seen in one of my other post).

Steeve, In fact, I was, in the second post, talking about SubVI reference, it's slightly different from VI reference...

 

I don't think that a node like "My subVI refnum" would involve the same problems as "My VI" refnum... because they are completely differnt objects !  subvi properties and methods don't deal at all with opening diagram of a VI... 

AristosQueue (NI)
NI Employee (retired)

> what I'd like is a "My subVI" refnum for an instance

 

I was afraid of that. It's unlikely to ever happen.

Manu56
Member

Well, that's not a good news... If you just take a look of our toolkit GrafcetVIEW which is in the process of Version 2 release, you could imagine why such a facility would be useful...

www.grafcetview.com

 

Manu56
Member

Just wondering... a VI express is able to do such things no ?
If you look to the diagram of a VI express configrator VI and to its connector, you see that one of its inputs is a subVI refnum.
This configuration VI must receive the subVI refnum of the instance of the express VI that you look at, no?
So, is it possible and NI don't want to give this possibility (for security  reasons ?) or did I missed something ?

Manu56
Member

(And it appears that I can achieve what I want by the bias of making an express VI that will give me the subVI refnum of the instance VI I'm considering, then dealing with subVI tags and so on... but this is so much complications for a very simple thing, no ?)

AristosQueue (NI)
NI Employee (retired)

Your question caught me on a good day... there's a possible solution to your quandry that I've been meaning to explore for a while now. I've posted it here:

https://decibel.ni.com/content/docs/DOC-35069

 

> but this is so much complications for a very simple thing, no ?

 

It is not a simple thing you are asking for. It is something that is very hard to ascertain. And my proposed solution isn't particularly simple either. If you've found a good solution with the Express VI then take that route.

 

> So, is it possible and NI don't want to give this possibility (for security  reasons ?) or did I missed something ?

 

An Express VI creates an entirely new non-reentrant VI within its caller. It is not a clone. It is significantly more heavyweight than a clone precisely because the block diagram of the instance VI is designed to be rescripted based on the configuration VI.