12-21-2022 02:32 PM - edited 12-21-2022 02:36 PM
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.
Solved! Go to Solution.
12-21-2022 02:36 PM
Tab control IS enum. Built-in.
What version of LabVIEW are you using?
12-21-2022 02:38 PM - edited 12-21-2022 02:47 PM
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
12-21-2022 02:57 PM
I was wrong. A state machine with tab control does not work as I thought it would be.
12-21-2022 02:58 PM
I don't have the latest version of LabVIEW.
But in LabVIEW 2021, tab control should be an enum.
12-21-2022 03:30 PM - edited 12-21-2022 03:44 PM
@GRCK5000 wrote:
I was wrong. A state machine with tab control does not work as I thought it would be.
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.
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.
12-21-2022 03:43 PM
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
12-21-2022 03:52 PM
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?
12-21-2022 04:03 PM - edited 12-21-2022 04:20 PM
@GRCK5000 wrote:
I was wrong. A state machine with tab control does not work as I thought it would be.
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):
12-21-2022 11:59 PM
Hi RTSLVU,
I saved my code for previous version.
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.