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,329 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,310 Views)
I think this is what you are looking for.
- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 4
(2,290 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,281 Views)