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

Thank you Mr. Altenbach! I'm successfully able to change the tabs programmatically. I just did not know I had to place the tab control inside the loop. Thanks for the suggestion. I think it works as expected now (see attached VI). Also, big thanks for the event structure suggestion and great explanation how to set it up. 

 

0 Kudos
Message 11 of 18
(817 Views)

@GRCK5000 wrote:

Thank you Mr. Altenbach! I'm successfully able to change the tabs programmatically. I just did not know I had to place the tab control inside the loop. Thanks for the suggestion. I think it works as expected now (see attached VI). Also, big thanks for the event structure suggestion and great explanation how to set it up. 

 


Isn't it frustrating when what you tell the code to do and what you want the code to do don't match?  Hopefully with experience, the two converge more quickly (but it's not guaranteed).  😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 12 of 18
(808 Views)

Yes, that's one of the most frustrating things ever. 😄

0 Kudos
Message 13 of 18
(800 Views)

Hi GCRK,

 


@GRCK5000 wrote:

I just did not know I had to place the tab control inside the loop. Thanks for the suggestion.


Well, then you forgot to pray the daily mantra of "THINK DATAFLOW!" before starting to code! 🙂

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 14 of 18
(794 Views)

Some 15 years down the road that still happens surprisingly often. 🙂

(aren't all bugs a case of this?)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 15 of 18
(783 Views)

@billko wrote:


Isn't it frustrating when what you tell the code to do and what you want the code to do don't match?  Hopefully with experience, the two converge more quickly (but it's not guaranteed).  😄


You mind is playing tricks on you...

 

Frozen_0-1671721013986.png

 

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 16 of 18
(767 Views)

@GRCK5000 wrote:

I think it works as expected now (see attached VI).


You still have way too much unnecessary code!

 

  • The sequence structure after the loop (and its contents!) can be deleted. Since you initialize the shift register, the tab will start on the correct page when you run it. The page in edit mode is irrelevant.
  • A 1000 ms wait is way too long for an interactive program.
  • "OK" is the default for the dialog. No need to wire it.
  • Dialog popups are annoying in general.
  • The output of a one button dialog is always the same, so the "select" is pointless.
  • Don't label it "tab control 2" if it is not a control, but an indicator.
  • The local variable in the "page 2" case is unnecessary. The tab will get written a ns later anyway. There is no need for any local variables anywhere!
  • Your code gets stuck on page 3 because there is no way to continue except press the stop button. The "move to next page" button is no longer functional! That's not nice to the user.
  • A switch is not natural for latch mechanical action. Use a button instead.
  • ...

 

Here are some quick modifications.

 

altenbach_0-1671724961615.png

 

Message 17 of 18
(756 Views)

Thanks Mr. Altenbach! These are definitely important points to take into account. See I just don't want my code to be functional. I also want my code to look like code from a pro  and work efficiently taking into CPU usage and stuff. Thank you for this!

0 Kudos
Message 18 of 18
(707 Views)