I made an odd discovery this morning when doing an application where I measure temperature and and use a COMPARE WITH HYSTERESIS LOW to control a fan. To make a long story short, the temperature control works just fine, just as long as he temperature measured is above 0°C. If the input value (A) receives a lower value than 0, the output somehow becomes true, but stays false from 0 up to the referance temperature as it should.
Ok, I thought. I just use a GREATER THAN operator and use input A for my measured values and B for reference value which I set to 0, so if input A is below 0, I will get a false on the output. That did not happen.
When trying to make sense of it, I made an application with only one GRATER THAN operator, put a simple check point on the output and used a parameter on input A and B so that I could run the service tool and monitor the output. It worked as it should, as long as both inputs were either negative or positive, but if I set input A to negative value and B to positive value I got a wrong answer.
Example:
A = 0, B = 17
A > B = false (as it should)
A = -1, B = 17
A > B = TRUE?
(so not true in reality!)
Both A and B are of the type S8.
Does this make any sense?
I could avoid all negative values by simply adding a constant to my values but I would like to know why I can't get the right result.
I would like to hear your opinion or if you have experienced the same.