This is a simple example consisting of a single VI that some programmers might find useful. The situation I was in was that I was dealing with a fairly large, complex program that had a complicated UI. To optimize the UI and present a clear interface during different sections of the execution, many controls and indicators were hidden and then made visible at different times. A difficulty then arose when adding new functionality, in that one could not always remember where all the hidden UI elements were. This VI is designed so that you can drop it into the block diagram of a top-level program. When the "Make Visible?" input is false (as it is by default), nothing happens. But if it is set to true (through a block diagram edit or a "debug" flag that the program sets, then it searches through the front panel objects of its calling VI, making each one visible. Since I use this VI when editing large projects, I also have it stop the calling VI. At that point, the calling VI is ready to edit with all its controls and indicators visible.
Drop the "Make Everything Visible.vi" on the block diagram of a UI-heavy program. Usually I place it at the beginning of the program, even outside the main loop. When the program runs, if the Make Visible? input is true, the calling program will be stopped with all its controls and indicators visible. Note that this version iterates through all levels and sub-objects of tab controls and clusters. Additional types of controls could be added if necessary.
Open the UI Example.vi.
Run it with the "Make Visible?" control False, then exit.
Change the Make Visible? control to True, then run it again.
Main Front Panel:
Main Block Diagram:
On a related note - If this is something that bothers you, you should consider voting for this idea, so that we never need VIs like this again - http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Show-hidden-controls-as-quot-ghosts-quot-in-edit-mode/...
tst,
Thanks for pointing that out. Great suggestion. I'd love it if this were built into the environment. I like some of the comments on that Idea about being able to toggle this kind of display.
DaveT
The mechanism of needing to place code on the diagram is a bit convoluted. A better choice would be to add it as an entry to the tools menu (e.g. like the code capture tool).
There is also a serious problem that it only handles one caller residing in memory. If you have several toplevel VIs open that contain this subVI and try to make the controls visible, it will actually act on whatever toplevel VI was opened first, not necessarliy the actual caller. The problems is that it picks only the first caller from the array. One solution would be to use the call chain and go up one level. (To demonstrate the problem open both VIs, then save the toplevel under a new name, keeping the old and new in memory (use special save option). Now run the new VI with the switch set to visible. Observe that the controls in the old toplevel become visible while the new one remains untouched).
Still, great example!