ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

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
(3,988 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
(3,976 Views)
Solution
Accepted by 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
(3,974 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
(3,973 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
(3,970 Views)
Message 6 of 7
(3,968 Views)

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

 

 

Thanks everyone!

0 Kudos
Message 7 of 7
(3,964 Views)