Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations SSS148 on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting ma to decimal 1

Status
Not open for further replies.

brinkmann27

Electrical
May 9, 2002
33
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 !
 
Replies continue below

Recommended for you

Going back to algebra Y=MX+B
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.
 
Hello;
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.
 
Yeah, what these guys said. Seriously the line formula
Y=mx+b where m=slope and b=intercept should become your newest best friend. Both of the responses above are very
new presented.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor