LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Alternate for nested case structure

Solved!
Go to solution

Hi,

 

I need to avoid / find alternate for nested case structure. is there any good solution for the nested case structure inside. I have attached sample nested case structure VI. Can some one help out with better solution.

0 Kudos
Message 1 of 9
(8,070 Views)
Solution
Accepted by topic author Technical_details

Hi details,

 

I have attached sample nested case structure VI.

Why do you need all those local variables?

Just use wires:

check.png

 

Can some one help out with better solution.

Use values of 0/1 for "DUT Sel" too. (Infact all 3 parameters use just two items: why not use boolean inputs then?)

When using item value ranges starting with zero you could use those input parameters to index an array of "action items" and simply call a state of a state machine using this "action item":

check.png

(I would just use a QMH approach with a state machine handling the messages…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(8,064 Views)

Hi Gred,

 

I have use Ring / Enum instead of Boolean because i may add few more parameter in the drop down in future if required.

 

secondly, when i tried to index the way you did it happened like this

 

 

0 Kudos
Message 3 of 9
(8,056 Views)

Hi Dteails,

 

when i tried to index the way you did it happened like this

Well, you did not wire l"the way I did" - you did something different!

 

Why did you increase/resize the IndexArray node to index 3 elements?

Why did you only wire the page input? I wired all 3 index inputs to index a single element from a 3D array…

 

I have use Ring / Enum instead of Boolean because i may add few more parameter in the drop down in future if required.

Then use consecutive ring item values starting from zero (like in enums) for easier array indexing…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 9
(8,050 Views)

Hi Gred,

 

I have tried the way advised but i couldnt figure it out exactly how it works and am not getting the correct sate. attached the VI

0 Kudos
Message 5 of 9
(8,005 Views)

Hi details,

 

several problems:

- in your array constant you only created the first page: as soon as you switch "Man/Auto" to "Auto" you try to index non-existing elements

- in your array constant you created a page containing 8×3 elements, yet "DUT" and "Parameter" only provide two different items each: it would be sufficient to create a page of 2×2 elements…

- minor problem: there is no wait in your loop…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 9
(8,002 Views)

Hi Gred,

 

I have understood the issue and the concept. as you said 2x2 matrix is sufficient for this case and the page to be filled with desired value. Thanks.

0 Kudos
Message 7 of 9
(7,998 Views)

(I would just use a QMH approach with a state machine handling the messages…)

 

You have stated that we can use Queued Message handler for this case. how it makes difference in using QMH and how effective it will be.

0 Kudos
Message 8 of 9
(7,994 Views)

Hi details,

 

how it makes difference in using QMH and how effective it will be.

You could separate UI handling (using efficient event structure) from processing your data (in your consumer loop). You could have your data processing sorted in a clean statemachine.

(The "effectiveness" depends on your programming :D)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 9
(7,989 Views)