Arithmetic problem

ishmail

Member
Join Date
Aug 2006
Location
Bloemfontein
Posts
49
Hi to all in the Forum

im having a mathematical problem, my system reads values from the analog PLC module 7117 ife,then displays the current from the PLC as a knob is adjusted. problem is, i would like to display it as actual mA current values on RSview, i know i must perform some arithmetic but does anyone know what formular i should use.

i came across one that said: if the motor current reading is 6000 then the actual current is --> 6000/1000 * 2, i tried it on RSView, it gives me values that are not close to the value displayed on the milli amp display.

the whole perpose of this is that, whatever is going on with PLC and its modules, it should be shown on RSView so that the user can be aware of everything that goes on from, say maybe his office.
 
hi ishmail, what is the range of the current that u r measuring,i.e. what do u mean by 6000, and what is the counts that u get in the plc for max.current.

if you are measuring current in 4-20 mA and for 20mA you are getting 32767 counts then you just have to cross multiply

i.e

value to be displayed = ((counts in plc) *20)/max counts i.e.32767 in this case.
 
Last edited:
First, you'll have to decide a max and min for your current, (say min=0A, max=1000A)

Second you must know the range your system reads (e.g. 4-20mA)

It's clear that 4mA corresponds 0A and 20mA corresponds 1000A
It's clear also that inside tha PLC, 4mA corresponds 0 and 20mA corresponds 26748 (or whatever PLC range you're using. In s7-200 it will be about 32000)

So, using cross multiplication, we get:

Actual -> PLC
0A -----> 0
1000A --> 26748

Also if you want to measure how many milliamps entering the PLC then:

Actual -> PLC
0mA ----> 0A
20mA ---> 1000A

I wish this helps
 
Is 6000 means 6000A
icon17.gif
? or 6000mA? or the reading inside the PLC is 6000? or anything else?
And how could you measure it?
 
Ok, i think the solution will be as follows:

Measure the current through the motor with a clampmeter (or any other device).
This will correspond to 6000 inside the plc.
I assume a range of 4-20mA measuring (you must get these values).
I assume a range of 0-26748 inside PLC (you must get these values).

If You want to know how much milliamps going inside the PLC:
milliamps --> PLC
4mA --------> 0
20mA -------> 26748
XmA --------> 6000 (that what you want)

so X=(20 * 6000 (or PLC reading)) / 26748

If you want to know the motor current:
I assume 6000 inside PLC corresponds 2A from motor (you must measure it).

motor -----> PLC
0A --------> 0
2A --------> 6000
XA --------> (some PLC reading)

So X=(2 * (some PLC reading)) / 6000

I wish this answers your question
 
Hi Ishmail


Now to tackle a problem of this kind, most PLC's give a Scale function. In the Siemens' range there are several useful blocks which can do a scaling of the raw value(32767 counts as max) as well told by the AmazingAhmed. Notably in the AB range there is both a "scale" function and a "SCale with parameters function". It is stupidly easy to use. Believe me that this sort of scaling is the most commonly used PLC function block. Modicon PLCs do scaling right on the dialog box configuring your Analog input module.Trick is, to locate where it is kept in your ladder editor.

If this is too difficult or your PLC can't be stopped. You can pull off the trick in RSView 32. In the RSview Tag database lookup the tag you want to change into the engineering units. Enter the minimum and maximum values in the tag's dialog box. The entry for "scale" is (Amps_max - Amps_min)/(Counts_max - Counts_min). The Offset value is to be kept zero.

Best wishes and good luck 👨🏻‍🏫
Raj S. Iyer
 
Last edited:
This is a common problem.

For any unit conversion on any PLC you can use four function math with the following, which
asumes integer math:
DataOffset = Data in input register at 4 mA (or zero analog signal of whatever range - for example 0 VDC on a 0-10 VDC transmitter)
DataSPan = Data at 20 mA - Data @ 4 mA
FACTOR = arbitrary factor (multiple of 10) needed to get proper resolution and accuracy
EU = Engineering Units x FACTOR
EUOffset = Engineering Units @ 4 mA x FACTOR
EUSpan = (Engineering Units @ 20 mA - Engineering Units @ 4 mA) x FACTOR
DATA = Actual data reading in input register
EU = ((EUSpan x (DATA - DataOffset))/DataSpan) + EUOffset ProcessValue = EU / FACTOR

For Example, 0-60 psig from 4-20 mA with resolution of 0.1 psig:
FACTOR = 10
Data @ 4 mA = 6240
Data @ 20 mA = 31208
DataOffset = 6240
DataSpan = 31208 - 6240 = 24968
EUOffset = 0 x 10 = 0
EUSpan = (60 - 0) x 10 = 600
DATA = 18975
EU = ((600 x (18975 - 6240)) / 24968) + 0 = 306
Process Value = 306 / 10 = 30.6 psig

In your case the enegineeing units are mA.
 

Similar Topics

Hello gents, I have a Control Logix processor with a few Flex IO nodes and I keep getting minor faults saying that it's a type 04 Program Fault...
Replies
13
Views
12,074
Hello I'm dealing with a couple of PLCs that arent able to handle floats. The task I have is to program a regulator and not use the integrated...
Replies
15
Views
4,404
Does anyone know of any such PLCs? Usually I'm lazy and don't want to think about precision and overflows.
Replies
20
Views
6,984
I have a counter which is a DINT in both compactlogix and control logix. Sometimes it rolls over, and that is fine. I have logic which does...
Replies
1
Views
4,458
Hi, I have to move the low word and the high word of a 32 channels I/O module in two 16-bit memory words. I copy the source 32-bit word in a...
Replies
38
Views
9,276
Back
Top Bottom