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: 

Create complicated if statement

I want to create a complicated if statement:

output has to be high when x*1 = y
output has to be high when x*2 = y
output has to be high when x*3 = y
.....
.....
output has to be high when x*300 = y

and for the 'number' is also a maximum defined like 300 or something

where is x a constant and y are the output value's from an encoder ( that means it's an increamental whole number )

------------------------------------------

I hope you can help me out with this problem
0 Kudos
Message 1 of 4
(2,327 Views)
I am not exactly clear about what your logic is. It looks like an AND function or an OR function applied to many conditionals.

Do you need to test all 300 possibilities for each new value of y? A for loop with the i node replacing n is one way of doing this. A shift register can be used to accumulate the AND/OR funcitions for the various values. Some of the math and logic functions can be connnected directly to array wires, saving much wiring and diagram space.

If you can be more specific abput your requirement, someone on the list will likely be able tohelp you.

Lynn
0 Kudos
Message 2 of 4
(2,308 Views)
I think this is what you are looking for.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 4
(2,288 Views)
Well, it looks like you simply want y/x to be an integer smaller than e.g. 300.

The attached code (image) should easily do the job. 🙂
0 Kudos
Message 4 of 4
(2,279 Views)