LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make one case structure with several conditions?

Hallo everyone;

 

I want to do the following, one case structure inside a for loop connected to it the following conditions, when i = 1 then do something, when i = 2 do another thing , when i = 3 ..... till i = 5  

 

i can do it with 5 case structures but i want to know if its possible to do it with one and how? 

 

thanks

0 Kudos
Message 1 of 4
(2,970 Views)

Wire the integer value to the case selector and have as many cases you want. Generally Enum data type is used for this purpose.

 

 

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 4
(2,966 Views)

When you wire a numerical input to the case structure, you would orignaly have two cases

 

ex: I wire the case structure terminal to 'i' value of the For loop. then, the cases i have will be, '0, default' and '1'.

 

right click on the case strucutre, select Add case after. you will get a new case of i=2.

right click again and repeat to get as many cases as you want. if you want to change the case value, to example 12 instead of 2, delete 2 and enter 12 there.

 

 

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 3 of 4
(2,963 Views)

Hi valdi,

 

did you consider reading the context help for the case structure? It explains all the details...

Best regards,
GerdW


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