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: 

subdiagram

Solved!
Go to solution

Hi all

 

I have a question about "case structure."

 

I want to use a "Tab Control" to select different subdiagrams from the  case structure, and each subdiagram is labelled by string, such as "voltage", "current", and "power."

 

But it always shows errors:

 

Case Structure: selector values have wrong type

Case Structure: no case for some selector values.

 

I was wondering how to fix this problem. Thank you. 

 

 

0 Kudos
Message 1 of 5
(2,705 Views)

Make your Tab control a typedef (not a strict typedef), then connect the tab control to a new case structure, right click on the border of the case structure and select, 'create case for every value'.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 2 of 5
(2,696 Views)
Solution
Accepted by topic author LITE
Well, you don't really have to do either. A tab is an enum and all you have to do is wire it to a case selector. Do NOT type anything into the case value. It will automatically name the cases.
Message 3 of 5
(2,691 Views)

Darren has posted a great series of nuggets on case structures you can review.

 

Hope this helps.

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 4 of 5
(2,644 Views)

Totally agree with Dennis Knutson, you don't have to do anything. Just create a case statement and wire it to the Tab control. Will automatically rename all cases as you tab strings and the only thing you need to do is decide which one will be your Default case. Just tested it works fine.

 

Dimitrios

0 Kudos
Message 5 of 5
(2,604 Views)