The built-in analog ports on all the M-series PLC return data in the range of 0 to 4092 which corresponds to the full range of voltage input presented at the analog pin. However, very often a user needs a formula to translate this numeric data into units meaningful to the process (e.g. degree C or F, psi etc). To do so, you need to know at least two reference points of how the native unit map to the PLC's ADC reading.
Reference Point ADC Reading
=========== ==========
x1 a1
x2 a2
Hence, for any reading A = ADC(1), the corresponding X is derived from:
X - x1 A - a1
--------- = -----------
x2 - x1 a2 - a1
==> X = (x2 - x1)*(A - a1)/(a2 - a1) + x1
Note that since x1,x2,a1, and a2 are all constants the actual formula is much simpler then it appears above.
E.g. Temperature measurement
========================
Temp ADC(n)
30 200
100 3000
So for any ADC readings A, the temperature is:
X = 70*(A - 200)/2800 + 30
Note: To get better resolution , you can represent 30 degree as 300 and 100 degree as 1000 so if X = 123 it means 12.3 degree.
[Edit 2014/7]: If you are using Fx PLC or the SmartTILE-Fx then you can use floating point operation directly without having to use integer to emulate the decimal point. So the formula could be:
X# = 70.0*(A-200.0)/2800.0 + 30.0