LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass data between Tab Control Pages

I’d like to initiate a serial VISA session in the first page of a Tab Control to use the VISA Serial Configure.VI outputs (Visa resource name and Error cluster) in other pages or outside the tab control.

 

So, how can I pass those references outside the page? I used local variables, but it doesn't seem the best way to do this because I need to create several variables to capture the reference in each page of the tab control...

 

I created a sub-VI to initialize the VISA session, but in this case it always starts a new session every time I use the sub-VI….

 

Thanks in advance!

 

Klein

 

=====================================

Block Diagrams (LabVIEW 😎

 

 

 

 

Message Edited by Klein on 04-03-2007 12:56 PM

0 Kudos
Message 1 of 4
(3,398 Views)
Use a shift register.

Lynn
0 Kudos
Message 2 of 4
(3,387 Views)
There's no reason at all to wire the tab control to a case statement. Since you have the read and write Booleans and they can't be clicked until the user changes tab pages, no code for the tab is necessary.With the Booleans for write and read, you should just have an event structure for those. You could initialize the serial port outside the main while loop and just pass the resource name in. Of course, if you wanted a tab for the init funciton, you could do that to but put a Boolean on that page to execute it. The only time you need to wire the tab control to a case statement is if you want to run some code immediately when the page is clicked.
0 Kudos
Message 3 of 4
(3,377 Views)
Johnsold,
 
I think that use shift register doesn't works, because I need to pass a wire to shift register (on while) through case structure. So, I need to use the Use Default If Unwired option on Case structure... That's the problem because the inicial value is lost when I change the page tabs.
 
The Dennis's solution solves the problem! I don't need to put the code inside a case structure. It simplify my dataflow.
 
Thanks!
0 Kudos
Message 4 of 4
(3,365 Views)