Converting ma to decimal
Converting ma to decimal
(OP)
I have a IDEC PLC w/ an analog input (4-20 ma). This input will monitor air pressure. The PLC data register is in a decimal format (0-4095). I know 0= 4 ma and 4095 = 20 ma. I can on paper figure various conversions by adding the "ends" and dividing by two. (Mid way would be 12 ma., which would be 4095/2. and so on). I would imagine there is a formula out there which would make me smarter than I am and easier to do. Thanks in advance !





RE: Converting ma to decimal
Sence it's an linear relationship Find the Ratio then multiply by know value add the offset.
Y=Result
M=Multiplier
X=Known Value
B=Constant
Known Values
Current Min = Cn = 4ma
Current Max = Cx = 20ma
PLC Min = Pn = 0c (c for counts)
PLC Max = Px = 4096c (c for counts)
M is the ratio of the two spans
Current Span = Cs = Cx-Cn
Cs = 20ma - 4ma
Cs = 16ma
PLC Span = Ps = Px-Pn
Ps = 4096c - 0c
Ps = 4096c
For converting Current to PLC counts
Lets say Current is 8ma
M= Ps / Cs
M= 4096c/16ma
M= 256c/ma (Counts per Mill Amp)
X= Actual - Offset
X= 8ma - 4ma
X= 4ma
Y=MX + B
Y= (256c/ma * 4ma) + 0c (notice the ma cancel out)
Y= 1024c
For converting PLC counts to Current
Let say X = PLC value is 3072c
M= Cs / Ps
M= 16ma/4096c
M= 0.00390625ma/c (Mill Amps per Count)
X = 4096
Y=MX + B
Y= (0.00390625ma/c * 3072c) + 4ma (notice the counts cancel out leaving ma)
Y= 12ma + 4ma
Y= 16ma
Hope this help.
RE: Converting ma to decimal
What you are asking for is how to scale the analog input into engineering units. To do this you need to know the range or span of the instrument. Given:
IL = analog input low
IH = analog input high
EL = engineering units low
EH = engineering units high
IN = input form analog card
EO = engineering units value (psi)
EO = (IN-IL)*((EH-EL)/(IH-IL)) + EL
Example:
The range or span of the pressure transducer is 0-150 psi,
the range of the analog input is 0-4095,
the analog input has a value of 3000:
(3000-0)*((150-0)/(4095-0)) + 0 = 109.89 psi
You can easily change the formula around to go the other way.
RE: Converting ma to decimal
Y=mx+b where m=slope and b=intercept should become your newest best friend. Both of the responses above are very
new presented.