drbitboy
Lifetime Supporting Member
BTW, the simplest solution is to bump (increase) the tolerance by one-tenth (or one-half) of the lowest resolution decimal digit, i.e. use 0.0011 (or 0.0015); this is functionally equivalent to the multiply-by-1k-into-DINTs.
Since the scanned or measured value will always be within 1 bit (one part in eight million) of three decimal places to the right of the decimal point and all zeros after that, 0.015-roundoff_epsilon will be accepted and 0.014+roundoff_epsilon will be rejected.
or
Since the scanned or measured value will always be within 1 bit (one part in eight million) of three decimal places to the right of the decimal point and all zeros after that, 0.015-roundoff_epsilon will be accepted and 0.014+roundoff_epsilon will be rejected.
ADD scanval 0.0011 testval GRT testval 0.016 SUB scanval 0.0011 testval LES testval 0.016 OTE scanval_in_range
ADD scanval 0.0011 testvalhi SUB scanval 0.0011 testvallo LIM testvallo 0.016 testvalhi OTE scanval_in_range
Last edited: