LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can someone please explain to me how to make "tab control" an enum item?

Solved!
Go to solution

I was looking at one of the examples from LabView called "B Spline Fitting Demo.vi". I just don't know "tab control" can be inserted in an enum.

Can someone please explain to me how this is done? I want to know how to do it.

I also attached a VI for those that can't find the example. 

GRCK5000_0-1671654703319.png

 

0 Kudos
Message 1 of 18
(2,182 Views)

Tab control IS enum.  Built-in.

What version of LabVIEW are you using?

 

George Zou
0 Kudos
Message 2 of 18
(2,177 Views)

Okay, good to know. Thanks! If that's the case,  I guess I can create a state machine with tab control then. Cool!

I'm using LabView 2021

0 Kudos
Message 3 of 18
(2,165 Views)

I was wrong. A state machine with tab control does not work as I thought it would be.

GRCK5000_0-1671656215360.png

 

0 Kudos
Message 4 of 18
(2,155 Views)

I don't have the latest version of LabVIEW.

But in LabVIEW 2021, tab control should be an enum.

 

George Zou
0 Kudos
Message 5 of 18
(2,152 Views)
Solution
Accepted by GRCK5000

@GRCK5000 wrote:

I was wrong. A state machine with tab control does not work as I thought it would be.

GRCK5000_0-1671656215360.png

 


Hmm... First I can't open your VI because I am still on LV2021. Second are you trying to basically get rid of the "tabs" and change pages programmatically like by pressing buttons?

 

Try making your Tab "Control" an "Indicator" then you can change pages programmatically.

 

tabselect.PNG

 

I like using Radio Buttons to change the page because a "tabbed Interface" seems dated and I can make the buttons nice and big for touch screen monitors.

 

Pro Tip: You can hide the tabs and make the pages on a Tab Control (Indicator) transparent so the screen changs at the press of a button and nobody knows it's a tabbed interface. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 18
(2,139 Views)

If you're going to use it programmatically, then I'd recommend the same treatment I'd give to any other enum and make it a typedef.  Right-click->Make Type Def.  Then right-click->Open Type Def.  Then edit, File->Apply Changes, and Save.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 7 of 18
(2,128 Views)

Hi gcrk,

 


@GRCK5000 wrote:

I was wrong. A state machine with tab control does not work as I thought it would be.


Maybe you should clarify what you thought...

 

Question: how do you think is the tab control related to the data/value stored in the shift register?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 18
(2,120 Views)
Solution
Accepted by GRCK5000

@GRCK5000 wrote:

I was wrong. A state machine with tab control does not work as I thought it would be.

GRCK5000_0-1671656215360.png

 


It works exactly as is should, but maybe not how YOU think it should. There is no way that the data in the shift register would somehow magically flow upstream into a control terminal that's outside the loop! Right?

 

If you want to exclusively change the tabs programmatically, make it an indicator and wire it right before the case structure (i.e. inside the loop).

 

If you want both (some do!), i.e. allowing the user to (1) change the tab or (2) have the code change it programmatically. I would use an event structure.

 

One event for the tab change, which would feed the shift register.

Another event for the "Switch page" Boolean, feeding the same shift register.

A local variable of the tab control before the event structure (or elsewhere, depending on the rest of the code)

 

Attached is a quick draft (LabVIEW 2020):

 

0 Kudos
Message 9 of 18
(2,108 Views)

Hi RTSLVU,

I saved my code for previous version. 

GRCK5000_0-1671685550696.png

 

Exactly, the goal is to change pages programmtically by pressing the button.

I attached my original code and another code with your suggestion making "tab control"  indicator. The last seemed to work, but it's a little bit defective. It is skipping page 2. I am pretty sure I am missing to do something. I have attached both VIs.

Also do you mind sharing the VI how you use radio buttons to change pages? That sounds interesting. 

Download All
0 Kudos
Message 10 of 18
(2,024 Views)