LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nested case structure problem

Solved!
Go to solution

So I'm a new user and I wanted to make four cases using a nested case structures. So I am selecting cases from two combo-boxes each having two options. But when I run the program, the outer case executes just fine while the inner case just executes default cases for each of the outer cases. Is there a way to make this work?

0 Kudos
Message 1 of 6
(1,159 Views)
Solution
Accepted by topic author singh530

Hi singh,

 


@singh530 wrote:

Is there a way to make this work?


Sure there is!

 


@singh530 wrote:

So I'm a new user and I wanted to make four cases using a nested case structures. So I am selecting cases from two combo-boxes each having two options.


Why do you need nested case structures?

Why do you use comboboxes?

Why don't you use a single case structure with 4 cases?

Why don't you attach your code when you have problems with your code? (Keep in mind: we cannot run/edit/debug images with LabVIEW!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(1,155 Views)

He did attach the code.

 

You compared e.g. "Litz " with "litz". Both capitalisation and a space makes the comparison fail.

Certified LabVIEW Architect
Message 3 of 6
(1,117 Views)

@thols wrote:

He did attach the code.

 

You compared e.g. "Litz " with "litz". Both capitalisation and a space makes the comparison fail.


Note: You can right-click on a case structure and select "Case Insensitive Match"

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 6
(1,100 Views)

@thols wrote:

 

You compared e.g. "Litz " with "litz". Both capitalisation and a space makes the comparison fail.


You can right click on the case structure and choose "case insensitive match" in order to eliminate the capitalization issue. That won't fix the space issue but it at least fixes that.

 

Another option is to use an enum instead of the combo box.

0 Kudos
Message 5 of 6
(1,095 Views)

If you don't actually need to write into the combo-box, you could use a ring, set it to DBL type, and edit the values. Then you can get rid of the case structures since the value is connected to the selected item:

thols_0-1646667083057.png

 

Certified LabVIEW Architect
Message 6 of 6
(1,082 Views)