LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change a value with reference if inside of a tabControl?

Hello,

i have a Vi with a tabcontrol and two pages. On each page is a string-control (string1 and string2).

 

Now i have second vi that gets the file-reference of the first vi and is called inside of the first vi.

This reference do i want to use to change the value of the string-control.

 

But i dont have access to "pages" when using the reference.

 

Attached the two vis.

 

Thanks for the help

Download All
0 Kudos
Message 1 of 9
(2,621 Views)

I'd do it like this:

ref[1]_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 9
(2,602 Views)

@OnlyOne wrote:

[...] But i dont have access to "pages" when using the reference.


You can do this to address this problem.  Convert the generic reference to a TabControl to get the TabControl-specific properties.

 

ref[1]_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 9
(2,585 Views)

Thanks for the help.

But how can i create this TabControl-Reference?

I do it like:

1. Create a reference from the TabControl

2. Create a constant from this reference

 

its working, but the text of the constant is "TabControl (strict)".

 

0 Kudos
Message 4 of 9
(2,567 Views)

I just showed a small part of your original diagram; you don't need to create a reference.  Here's the whole thing (after executing Clean Up Diagram on your VI).  I prefer my solution in my original response over this one, though.

 

ref[1]_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 9
(2,560 Views)

Yes, i understand that. But my question is: how can i create thie green TabControl for the typecast (which is shown in your picture on the upper right side)?

Than you

0 Kudos
Message 6 of 9
(2,555 Views)

Easiest way that I know is to right click on the control itself and select "Create->Reference".



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 7 of 9
(2,545 Views)

Oh, ic.

 

You can pull a Class Specifier Constant out of the Application Control pallet, or right-click on the To More Specific Class target class terminal and create one.  Click on it and browse through  to the type you need:

 

browse.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 8 of 9
(2,542 Views)

Btw, that's not a reference to the Tab Control, it's a type specifier that tells the To More Specific Class what type of object to convert the reference to.  The conversion will fail if the reference isn't for a Tab Control, and you'll get an error.  That's how I found the Tab Control in the Controls[] array in the original answer - I know that there's only one Tab Control on the panel so I continue iterating if I get the conversion error.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 9 of 9
(2,539 Views)