Scaling an Analogue Input in STL: The Integer Maths and Where It Overflows
A DINT stops at 2147483647, and 27648 multiplied by 77673 is 2147503104. That is the whole of the problem with fixed-point scaling in STL: the arithmetic is exact right up to the statement where it is not, and *D reports the crossing by setting OV and OS rather than by refusing to run. Here is … Read more