How can I scale an analog input or output?
Scaling Analog values
Scaling an analog input is a process of converting from the value range of the analog conversion input (typically 0 to 4000 or 0 to 8000 values for the 4000 point and 8000 point resolution units respectively) to a value range in engineering units.
Example 1 - scaling an input
For instance, a temperature sensor is attached to an analog 4-20mA input with a resolution of 4000 points. The temperature sensor has a sensing range of -50 to 250 degrees Celcius which corresponds to the 4-20mA range. The analog input unit should then be reading 4mA at -50 degrees C and 20mA at 250 degrees C. The value the analog input unit converts the input range to its range of resolution, ie 0 to 4000.
In the below graph, the values would be
X0 = +0.0 (the lower end of the input range) Y0 =-50.0 (deg C) (ie the lower converted value)
X1 = +4000.0 (the upper value of the input range) Y1 = +250.0 (deg C) (ie the upper converted value)
Note that it is often convenient to use the upper and lower range of the analog input as the data scaling points, but any two known points of input vs output are sufficient to define this linear relationship.
OMRON has written function blocks for the C series PLCs to scale both input and output values. The formula for this is as follows. This is taken from the Sysmac series which has the function in built, but is not present in a C series PLC
This CX Programmer Function Block outputs as a REAL data type which is useful for engineering units containing decimal points.
Example 2 - scaling an output
Scaling from a command value of say 0-100% can be done in a similar manner. Lets assume that an actuator is fully closed when it receives a 4mA loop value and fully open when it receives a 20mA loop value. The analog output used for this device is an 8000 point resolution. Note now the output of the scaling function will be the analog output units command values.
The values used for scaling in this example would be as follows;
X0 = +0.0 (%) (the lower end of the input range) Y0 = 0 (analog unit value) (ie the lower converted value)
X1 = +100.0 (%) (the upper value of the input range) Y1 = 8000 (analog unit value ) (ie the upper converted value)
Note this CX Programmer function block outputs as an INT datatype which is compatible with analog outputs