Showing results for 
Search instead for 
Did you mean: 

Passing values between tabs, using a case structure.

Go to solution

At the risk of exposing my ignorance, I have a fundamental problem; how to pass values in a tab controlled case structure.

I have a simple UI that utilizes a tab control container controlling a case structure all wrapped up in a while loop. I am using

LabVIEW 2012.


The base intention is to execute VI's in tab 1, the results of which would be available to the VI's in tab 2 ect...

(see attached example; as an experiment I would like the changes made to the int & string controls on page 1 to be reflected

by the matching indicators on page 2).


I can "tunnel" the values from one case outside the case structure itself (through an output tunnel), but can't seem to make it

available to any other cases via an input tunnel.


I tried to tunnel out of the case into a shift register on the while loop but am thwarted in retrieving that data back into another case.


I tried to use local variables but obviously do not understand LabVIEW's scoping paradigm for variables; I can create a local

variable but can't seem to "wire" it to an indicator on the second page.


First question: Is the tab controlled case structure within a while loop a reasonable method for controlling program execution?

                          I chose it because I have literally dozens of parameters to set and validate and wish to manage the visual space

                          for the operator. For example, I would like this sequence:


  1. Interrogate and list all available devices on my PC
  2. Select a device to use, verify it is working properly
  3. Set parameters (about 30) for this particular device
  4. run the device, collect data and save results


Second question: It is clear I do not know how to use variables, and the examples I read involve passing data to parallel structures

                                 and not within a case. Is a local variable a reasonable method of passing data between "tabs"? I will gladly

                                 accept the admonishment to "RTFM" as long as the requisite "FM" is identified.


Thank you in advance for your kind attention to my advisedly freshman inquiry



0 Kudos
Message 1 of 5
Accepted by topic author dkw-info

Shift registers are simple to get data from.  Where was your problem with using them?  Though, did you think of just using the terminals dirctly in the Page 2 case?


You should learn to use the Event Structure.  You shouldn't care which tab you are on.  It is all in the same VI.  Therefore use a single Event Structure for all of your control value changes.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 5
Accepted by topic author dkw-info

Don't try to micromanage the code. There is rarely a need to wire a tab structure terminal to a case structure.


Simply wire the indicators to the controls and update whenever the control changes (e.g. using an event structure)


Omit the case structure and leave the tab terminal unwired.

If you don't use an event structure, place a small wait inside your loop to prevent CPU hogging.

Message 3 of 5

Thank you all for the prompt replies! I did discover my problem using variables (they have a read and write property) and was able to get the scheme as is to work. I will however tahe your suggestions to heart and change to use a tab control with an event structure. Thank you for your kindness with such a noob question.

0 Kudos
Message 4 of 5

For more details, also see my old reply here.

0 Kudos
Message 5 of 5