Hi, Would like to check for a value which lies in the range.
For example, say I've got a value +5 in var. Also in another variable a value of 2. These two values can be negative also. like inplace of +5, replace it with -5. And the corresponding second variable -7.
Basically want to check for alram conditons using c code.
incase if I'm targetting for +5, and the value obtained is say +2, then it's an alarm condition.
In the same way if I target -5, and i get -7 then it;s an alarm.
Want to sepcify the range for generating this alarm.
For exmaple , +/- 0.9 onthe sacle.
If the obtained value is betwwen this slab, then no alarm. otherwise it needs to be flaged.
Could anyone suggest a good logic for this?
Thanks
Sha
--------------------------
-5.9 -5 -4.1
--------------------------
4.1 5 5.9
Any value needs to be computed. ie signed values(both - and +)
Example:
Target = 5
Obtained value = 2
This does not lie in the scale of +/- 0.9 scale of taget. So needs to be flaged.
another example :
target = -5
obtained valu = -7
This also needs to be flaged as it doesn't come under the slab.
hope i'm clear on my query...