LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling active display from another VI?

Helper wrote in message news:<506500000005000000BA540000-1007855737000@exchange.ni.com>...
> I can't use the tab controls even though that does seem like a good
> suggestion.

Actually, Tab controls are a fairly easy solution, it would seem.
When you remove the Tabs themselves, you have a rectangular area which
can display any number of different subscreens with controls and
readouts on each. The only tricky part is programmatically changing
tabs; if you are content to use an enum control even this is easy.

If you wish to have the program automatically change the displayed tab
'page', a bit of indirection is required, as there exists no attribute
for the tab control which allows choosing which tab 'page' is
displayed (LV 7.0??).

To d
o this, create your Tab Control 1. Populate it with as many named
states as you intend to use. Go to the program screen, and right
click on the Tab Control and create a constant. Pick up this constant
and drag it to the display screen, where it then becomes an enum
control (probably auto-named 'Tab Control 2' or some such). You can
wire this control to a local variable reference to the original Tab
Control 1 on your program screen. And, your program can write a U32
value to a VALUE attribute of this Tab Control 2, which will then
cause the displayed Tab 'page' of Tab Control 1 to change. Hide the
Tab Control 2 on your display screen. Remember, that if you later add
more tab pages to Tab Control 1, you will have to add them to enum
states for Tab Control 2 as well.

It ain't simple, but it works. And it allows real estate on your
screen to be multiplexed for different controls/indicators.
0 Kudos
Message 11 of 12
(437 Views)
> Actually, Tab controls are a fairly easy solution, it would seem.
> When you remove the Tabs themselves, you have a rectangular area which
> can display any number of different subscreens with controls and
> readouts on each. The only tricky part is programmatically changing
> tabs; if you are content to use an enum control even this is easy.
>
> If you wish to have the program automatically change the displayed tab
> 'page', a bit of indirection is required, as there exists no attribute
> for the tab control which allows choosing which tab 'page' is
> displayed (LV 7.0??).
>


The tab value written or read from the terminal describes which tab is
active/frontmost/visible. In fact the tabs on a tab control can be
hidden using t
he Visible Parts popup, and you can use Next and Back
buttons to increment and decrement the tab value to make a wizard. You
can use a ring or an enum to avoid having multiple rows of tabs, and
when you have even more items, you can even have a list box where the
selected row is read and written to the tab to control which tab is
visible.

What you cannot do at this point is to rename or reorder tabs. Always
something to work on.

Greg McKaskle
0 Kudos
Message 12 of 12
(437 Views)