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: 

If, Or, Else, Then statement

Solved!
Go to solution

Hello again,

 

I'm trying to make a statement for the following:

 

If X = 01 or 13 or 18 or 23 or 24 or 30, then range = Y

If X = 02 then range = Y

If X = 03 or 20 or 21 or 25 or 29 then range = Y

Else range = Y

 

I'm going to be using it in a state in a state machine. It will allow the software to automatically tell a pressure calibrator what range to be in.

 

Thanks everyone

0 Kudos
Message 1 of 7
(2,931 Views)

You did not actually ask a question so we are not  sure what you want.

 

Look at a case structure.  If X is an integer data type, wire it directly to the selector terminal.

 

Lynn

Message 2 of 7
(2,919 Views)
Solution
Accepted by topic author buickgn

Hi buick,

 

when you always have "range = y" then you don't need any case structure at all Smiley Wink

 

If you insist on separating those cases: use a case structure and wire your case selector integer to its selector input. Read the help for the case structure...

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 7
(2,917 Views)

Sorry. When a user inputs a part number, the application parses the string and returns numbers 01-30. I want to take this number and use it in the if, or, else, then statement so I can input the correct range to a pressure calibrator.

0 Kudos
Message 4 of 7
(2,916 Views)

Hi buick,

 

use a case structure.

No IF, THEN, ELSE, ELSEIF, ENDIF, FI needed...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 7
(2,913 Views)
Message 6 of 7
(2,911 Views)

I'm mad I didn't think of that.... Coffee time!!

 

 

Thanks everyone!

0 Kudos
Message 7 of 7
(2,907 Views)