LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
wiebe@CARYA

VI property subpanel ref

Status: Declined

Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined. 

Not sure why I can't find this idea, there are a few 'VI Ref' read property for SubPanels" posts, but couldn't find this one...

 

How about a VI property "SubPanel" , that returns the subpanel a VI is in (or Not a ref)?

 

Now I have to give all dynamic VI's a SubPanel reference, and when started, and put into a subpanel, I have to dynamically set the control value. I need the subpanel reference, for coordinate conversion, handling tabbing, getting panel images, etc.

 

Regards,

 

Wiebe.

43 Comments
wiebe@CARYA
Knight of NI

>Wiebe, it's been a few years since you've looked into this. Have you settled on a good way to do this, other than the "get mouse current position" function calls? At least as of LV2018, the Convert Panel to Screen Coordinates function just plain doesn't work when it's called within a subpanel.

 

No, it's still a big pain.

 

Spoiler

I've 'solved' this by traversing over all VI's in memory, traverse their FP for subpanels, if it has a sub panel, see if it's a reentrant VI, try to see if there are open clones (a big task on it's own), see if the VI is in there. Getting the VI ref is also tricky, because getting the VI reference from a sub panel doesn't (used to?) return a reference, but the reference. Closing this ref, or stopping the VI that got it will remove the VI from the sub panel. Of course this needs to be done recursively, as a VI with subpanel can be in a sub panel...

This is hard to make, and takes long to execute. So 'solution' doesn't quite hit the mark.

BertMcMahan
Trusted Enthusiast

Oof, that's definitely a rough workaround. I think the "couple it by passing VI refs downstream" will suit my needs for now. Thanks for the update.

wiebe@CARYA
Knight of NI

>Oof, that's definitely a rough workaround. I think the "couple it by passing VI refs downstream" will suit my needs for now. Thanks for the update.

 

If you can, do that, that is the way to go. There are situations where you can't do that.