From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a type def of a tab control?

Solved!
Go to solution

This may be a dumb question...

 

Has anyone figured out how to be able to make a tab Control a strict type so that when I edit the tab names the new names show up such that I can use a property >>> Value node to change tab pages from a sub-VI?

 

What works for all other types of controls is...

 

1) Right-click tab control >>> Advanced >>> customize

 

2) Save it as a type def.

 

3) Apply changes save all close the control editor and answer yes to replace.

 

4) Create a reference to the tab control.

 

5) Create a control from the reference.

 

6) Repeat steps 1-3 to save the ref as a type def.

 

7) Put the type defed control of the tab control in a cluster to use in a sub-vi

 

What I would like to see is that changes to the tab name be reflected in the constants I wire to a property >>> Value node.

 

What I see in the sub-VI is

 

1.png

 

A)

The constants created by right-click create control are not type-defs (see no triangle in top left corner)

 

B)

A constant created on the diagram that has the tab control and copied to the sub-VI DOES have the type-def marking.

 

2.png

 

A) Disconnecting the constant created from the property node and connecting the constant that created in the top level VI and copied down shows a coercion dot.

 

So... have any of you figured out how to get the constants in the sub-VI acting on the tab control to adapt to changes to the original tab control?

 

I this a bug that nobody has noticed or am just not doing this right?

 

I have been aware of this situation going back to about LV 6i or so. But never stopped to wonder why I could not get it working.

 

Thanks you for your time!

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 1 of 37
(5,258 Views)

We should see some code instead. For example are you sure that the tab inside the type cluster constant in the subVI is typedef'd. (i.e. the one wired to the top of bundle by name)

0 Kudos
Message 2 of 37
(5,244 Views)

@altenbach wrote:

We should see some code instead. For example are you sure that the tab inside the type cluster constant in the subVI is typedef'd.


 

If I find time I will put together an example. I am still curious if anyone has figured this out.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 37
(5,238 Views)

I followed your sequence (I think) and it seems to work for me (LV2012).  I can create constants in the subVI and they are typedef'd.  Maybe I am not quite understanding what you want to accomplish or how you are doing it.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 4 of 37
(5,218 Views)

Seems to work fine here. (trying to stick to the gist, but maybe I misunderstood.)

As a graphical programmer, I cannot follow text instructions. 😄

 

 

Message 5 of 37
(5,214 Views)

Strict Type-def BD constants are treated as non-strict.  Basic type def behavior.  You need to watch for that.  Type Def Enums update because the names are part of the data type. But, Tab Names are not part of the data type of the tab container therefore they behave more like rings (and probably should have Ring Constants rather than enums)  Therefore As playing with aputnam zip shows not only does the type-def for the refnum need to be strictly typed the refnum itself must be strict.  (Right-Click the ref control itself and select "Include Data type" - get the red star)

Also, you are going to hit CAR 547900 with that code.  And, don't even try re-ordering the Tabs in the type def, You'll likely crash LabVIEW.

 

Did I ever mention "I Hate Tabs?"


"Should be" isn't "Is" -Jay
Message 6 of 37
(5,206 Views)

I will the posted zip when I get a chance.

 

One difference I see with what I have been doing and what Christian shared is my cluster passed to the sub-VI is a type def as well.

 

Yes Jeff you have.

 

But when I am coding for novice developers, it is hard to justify using sub-panels when a tab control works just fine.

 

Ben 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 37
(5,189 Views)

My code is basically the same as what Altenbach shows.  After posting it, I tried also making the cluster into a typedef and it still worked properly. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 8 of 37
(5,178 Views)

I must be going crazy.

 

It ws working and hen it stopped and then it was working and now it keeps working.

 

Can not figure what I did to get it to start to work and ...

 

It is Friday.

 

Probably just me.

 

Sorry about wasting your time.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 9 of 37
(5,162 Views)

See attached 5.zip which was saved as LV 11 and I am working in 15

1) Open Tabs.vi

2) Save all

3) Close

4) Open Tabs.vi

5) Open Type-def of tab control

6) select page13

7) Edit name

😎 Apply changes

9) Save all

 

Try to close the control editor.

 

Ben

 

 

 

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Download All
0 Kudos
Message 10 of 37
(5,147 Views)