Logic block < comparison fails


This is a very simple Elevator(Lift) app. When MoveLiftToTxt goes unfocus the Lift should go up or down. Initially everything is set to 0 the Lift is at the bottom.

I type 10 in the Move Lift and go unfocus the Lift goes up perfect.
Error Message has “10 and 0” and “up” messages
I type 3 in the Move Lift and go unfocus the Lift goes up??
Error Message has “3 and 10” and “up” messages
The Logical < comparison fails.
Both the Move Lift and Lift Pos inputs are numeric.
Why should the logical < comparison fail? Just baffling. Please help.

I just checked some posts like this and I’m guessing (since I can’t see where you define movelifttotxt), that movelifttotxt is still text.
To convert it to number you can have it to equal movelifttxt + 0.
See the post below for further information.

1 Like

Hi Thanks for the reply but I had initialized it as numeric 0 when clearing and I knew the +0 trick you mentioned but since it was initialized to numeric 0 I thought it was redundant. However your reply and the images you shared helped me to rethink my basic algorithm. My Y value was being calculated wrongly. I just fixed it. Now the other bugs are also gone. Thanks