ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Refer to current tab programatically when using tab control

Solved!
Go to solution

Hi, I'm a bit of a n00b.

 

Say I have 10 arrays of data and I want to plot these 10 arrays on 10 separate graphs.  I don't want to clutter up my screen so I made a tab control, with one tab for the plot of each data array.  But I don't want to plot them all at once, I want each plot to have its own "plot data" button so that the user can customize the plot options for each one.

 

I could do this with 10 separate pieces of code with 10 different buttons, but as I said I hate clutter, so I'd prefer to put this all into a case-structure whereby according to whichever tab the user has currently selected, when they press the one "plot data" button, labview gets the appropriate data and plots it accordingly.

 

Now I know the tabs are indexed and I can refer at any time to any given page using Property Node --> Pages, but I need a way to grab the index of the page currently selected.  Once I have that, I know how to do the rest.  

 

Is this possible?

Thanks,

Jessie

0 Kudos
Message 1 of 5
(3,476 Views)

If you want the currently selected tab, just read the terminal value. Don't use the property node or a local value when you don't have to.

 

Here's one possible simple solution. I used a constant for the data since I did not know how you were acquiring it. Modity as needed.

0 Kudos
Message 2 of 5
(3,467 Views)
Oops! I'm on 8.2 so I can't view your example--I probably should have mentioned that.  What do you mean "read the terminal value"? 
0 Kudos
Message 3 of 5
(3,461 Views)
Solution
Accepted by grae313

It's exactly what it sounds like, there is a terminal on the block diagram that represents the tab. On the front panel, right click and select 'Find Terminal'.

 

Here's 8.0 code.

Message 4 of 5
(3,459 Views)
Gosh, that was easy 🙂  Thanks!
0 Kudos
Message 5 of 5
(3,455 Views)