This might look complicated, but if you will dig down into the logic you will see what it is doing. This is generic in that it can "extract the square root" for a Differential Pressure Flow Input if needed.
It is a little more complicated because I wanted to do it all in one block in a Honeywell HC900 rather than making a separate "Normal Block" and "Extract SQRT Block"
This works no matter what the ranges are. It can be adapted to any PLC that can do the math (I've done it in a CompactLogix PLC)
The logic is as follows:
(((H*sqrt((A-B)/(C-B)))+(abs(H-G)*((A-B)/(C-B))))*(E-D))+D
A = Raw Input Value
B = Raw Input Zero Value (ex. 0)
C = Raw Input Span Value (ex. 100)
D = Engineering Units Zero Value (ex. 32)
E = Engineering Units Span Value (ex. 212)
F = Constant 0 Value
G = Constant 1 Value
H = 0 = Linear Value 1 = "Extract SQRT"
The first half ((h*sqrt((a-b)/(c-b))) = ZERO if you are not Extracting the SQRT and the second half (abs(h-g)*((a-b)/(c-b))) = ZERO if you are xtracting the SQRT. The "+" in the middle either adds 0 to a number or a number to 0.
The rest *(e-d))+d does the final linearizing.
Put it in a spreadsheet and watch it work...
Put this in any cell after putting your numbers above into A1 to H1. Change A1 and watch the formula do its work. Change B1 and/or C1 and D1 and/or E1 for fun.
=(((H1*SQRT((A1-B1)/(C1-B1)))+(ABS(H1-G1)*((A1-B1)/(C1-B1))))*(E1-D1))+D1
Then play around with simplifying it if you want...
I know some PLCs have this functionality built in but you asked how to do it.
Jim