LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A method to more easily locate SubVI terminal controls?

Solved!
Go to solution

Hello,

 

My usage of LabVIEW is fairly intermittent, so when I return to a large project it can take some time to re-orient myself with how my VIs interact with each other.  I encountered an instance where I opened a subVI and was trying to figure out where the controls/indicators for the input/output terminals were.  First I tried double-clicking one of the terminals in the top-right grid, and when that didn't appear to bring me to the appropriate indicator, I right-clicked on it and saw no option to bring me to the indicator of that specific node.

 

Then I remembered that if I just click on a terminal grid node, it will highlight the indicator or control on the front panel.  This is useful, except for when the front panel indicator has been hidden... which, in my case, it had.  I could see that it was highlighting something, but there was no way to find out what it was since it only showed an outline.  Unfortunately, that meant that the only way for me to reliably find out what the node references was to either look at the terminal labels on the subVI in the main VI (why can't these labels show up when hovering over the terminal grid on the VI itself? I just realized that I hadn't tried ctrl+H to see if these labels show up when hovering over the grid... they do) and ctrl+F to find the one I'm interested, or go through the block diagram and find any indicators of the same data type then showing them on the front panel and clicking the terminal node to see if it highlights the one I just unhid.

 

My question, I guess, is if there happens to be a better way to go about this process in the future?  It's not too bad for my current project since I've written each VI in it and think it's relatively clean so far, if it does take me a bit to get back into the groove of things and remember where things are after a time away from the project.  However, I will be inheriting some rather messy, massive code from a coworker in a few years once he retires, and am worried it may be a headache to find how some of his subVIs are wired.

 

So, I think I have a couple... ideas that I hope exist, but am afraid will be merely suggestions for features of limited usefulness.  First, is there a setting/command to temporarily unhide every front panel control or indicator?  Just something that you can turn on, find what you're looking for, then turn off to resume the original visibility settings of each node.  Second, is there some way to take a control/indicator and find if it has an input/output terminal (without deleting it and seeing if one disappears from the grid...)?  I'd be kind of surprised if this didn't exist since only one can connect to one other (right?), so the two-way link should be discoverable, I would think.  Finally, I think it would be helpful if double-clicking a terminal grid node did... something.  I wouldn't mind if it brought you to the node in the block diagram, but if it just had the same functionality of double-clicking the block diagram node (bringing you to the front panel control/indicator, and showing a faded version if it's normally hidden), that would be okay too.

 

It should be noted that I'm using LabVIEW 2017, so perhaps that is affecting my ability to interact with the terminal grid as I would hope to.  Also, my apologies if this type of question has been answered in the past... I tried searching but didn't come up with anything that fit my current conundrum.  Anyway, thank you for reading through my minor gripe with this particular facet of LabVIEW - hopefully it will help me learn something new!

0 Kudos
Message 1 of 12
(3,435 Views)

I guess you could create a VI with a VI reference for a control and bring the target VI ref in so that you can index through all the controls and set the visible property (read the property first so you can set it back later) for each.

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.
0 Kudos
Message 2 of 12
(3,411 Views)

@billko wrote:

I guess you could create a VI with a VI reference for a control and bring the target VI ref in so that you can index through all the controls and set the visible property (read the property first so you can set it back later) for each.


Bill, I'm not sure what you mean by the bolded part; it feels just beyond my grasp of understanding.  Is the gist that a workaround solution to unhiding terminal-linked front panel objects would be to create a separate (wrapper?) VI to set them to visible that way (then restore them from a stored set of visibility values)?  If so, that seems like an interesting option at this point.

0 Kudos
Message 3 of 12
(3,399 Views)

Hi jaywc

 

It would be worth considering the layout of the controls of your subvi. If the front panel is not displayed when it is run, then it is worth laying out the controls and indicators in a way that reflects their position on the connector pane.

Message 4 of 12
(3,350 Views)

No, to my knowledge these tools do not exist.

I think, they might be a little usefull for user interface subVIs with hidden controls. But it will pan the front panel and it can be not convenient, especially in general case with multiple panes

Also the input terminals should be easily located on block diagram. 

You can always add it to idea exchange, but for me this feature would not be of great use.

0 Kudos
Message 5 of 12
(3,329 Views)

Paul and Alexander, thank you for the response.  You're probably not wrong that there are ways I could improve my program and its layout, but it may make sense for me to briefly explain what I'm working with.  The subVI in question is a settings interface that pops up while the main program is running when one presses the Settings button on that front panel.  This settings subVI has a variety of different parameters that affect the main VI (and are written to functional global variables), but I have two buttons to close the program:  'Save and Quit' and 'Quit Without Saving'.  Whichever one is selected affects a boolean indicator (as does the panel being forcibly closed), which is then output to the main VI.  This boolean I have hidden since the user doesn't need to know what button they just pressed.  There's another hidden one too that outputs to the main VI if the interface is closed without certain important settings being selected.  Hence why they're hidden on the front panel of the popup subVI.  If there's a way to add an output terminal by creating a block diagram indicator without having to have a front panel object, however, I would be glad to hear that as well!

0 Kudos
Message 6 of 12
(3,316 Views)
Solution
Accepted by topic author jaywc

Another option would be to use VI scripting to just highlight the object on the front panel AND block diagram.  This will let you find the terminal on the block diagram.  Then if it is hidden on the front panel you can just right click on the block diagram terminal and make it visible.

 

 

ConnectorHighlight.png

 

 

 

Message 7 of 12
(3,306 Views)

I know this doesn't help with where you are at now, but just a suggestion for the future: when you have a dialog with controls/indicators that are needed for input/output of the subVI but you don't want the user to see them, instead of hiding them, you could place them somewhere on the front panel outside of the users view (for example, just above the origin is a common place to do this). Lay them all out so that they match the layout of the connector pane and then next time you open that VI, just scroll up and you will see them and know exactly the inputs/outputs of that subVI.

 

I don't think controls should ever be hidden all the time. Definitely there are times you may need to hide/show them dynamically in your program to do fancy UI stuff, but I wouldn't just keep one statically hidden. Maybe there is some exception I can't think of where it is okay to do this, but as you've found, it generally makes it harder to follow what's going on in the program.

Message 8 of 12
(3,303 Views)

BowenM, that does indeed look useful!  I'll have to play around with it and see if I can get something like that to work for me.  Like I mentioned in the OP, it's not something that is critical at this point since I'm working with something of a moderate size that I wrote and feel I can follow well enough at this point... but when I inherit an older coworker's programs, that task might become a bit more complicated, so something like this might help.  Thanks!

 

prettypwnie, I see your point that hiding them might cause me more problems than the cleanliness helps my mental well-being.  I read through the LabVIEW for Everyone and LabVIEW Style Book textbooks awhile back, and don't recall seeing a recommendation one way or another for this, but I'll definitely keep it in mind for the future to just move stuff out of sight rather than hide it.  Also, that's the second time I've seen the suggestion to order controls/indicators on the front panel as they're shown on the terminal grid, so I might have to start adopting that tactic as well - as long as I'm consistent, it sounds useful!

0 Kudos
Message 9 of 12
(3,283 Views)

For simple non-user facing VIs, it is very easy to do it automatically. I use the maker hub front panel clean up: https://www.labviewmakerhub.com/doku.php?id=blog:users:sam:2014_01_08_front_panel_cleanup_legacy

Message 10 of 12
(3,275 Views)