4-20mA scaling (PT100 measuring) in Step7

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
I have a scaling problem.

I have a 2-wire analog 4-20mA input. There is a PT100 connected to it with a range from -30 tot +60 degrees.

What I did:

(((Input/27648)*16)+4) = Y (in mA)
16 is the range and 4 is the offset.

And after that I did ((Y*5,625)-30) and the result seems to be not right. 5,625 comes from ranges 90/16.
So I say, 4mA substracting, in the range 90 that is 4*5,625 = 22,5.
So the formula is Z = (((Y*5,625)-30)-22,5)

And, I'm not sure about what I did, I made it to complex.


Is 4 to 20mA 5529,6 to 27648 measurement in Step 7 ?
If so, then I can do this I guess:

((((X-5529,6)/22118,4) * 90) -30) = Z

5529,6 is 4mA in integer format.
22118,4 is the range between 5529,6 and 27648
90 is my range from -30 to +60 degrees
-30 is the Offset.


Please help me out,

Thanks



Okay
 
Hi Combo

Instead of doing your own scaling function I recommend to use the FC105 scaling function in step 7 provided by Siemens. That´s a nice built in function for this type of application.

Regards
Wille
 
Wrong on several counts.

If you've set up the module correctly in the STEP7 Hardware Configuration then no matter what the actual signal range is (0-20mA, 4-20mA, 0-10V etc) the numeric value in the PLC will always be 0-27648. Even if you did have to allow for the 20% offset at the bottom of the scale with a 4-20mA signal, you should subtract that first, then do your division - not the other way around.

By far the easiest solution is to set the module up correctly in H/w Config, adjust the range plug on the side of the module to match accordingly (you have noticed this?) and then use the standard FC105 SCALE function from the TI-S7 Converting blocks library supplied with STEP7. For this FC you tell it the source of the signal (your IW address), the high and low range of the signal in engineering units (i.e. your -30 and +60), and whether the signal is bipolar or not (for current we hope not, but for -5V to +5V it would be). It will then produce a floating-point value between -30 and +60 according to the incoming value in your IW address.

Good luck

Ken
 
Hi

Wel

Indeed, If u configure 0-20mA and u're input is 4-20mA, then u need to substract.

But I have configured 2-wire for the PT100, that's always 4-20mA input

so I have 0 to 27648 integer

I must have made a mistake, like this it works:

Range PT100 is -30 to 60 degrees:

L PIW 408
ITD
DTR
L 2.764800e+004
/R
L 9.000000e+001
*R
L 3.000000e+001
-R
T #Temperatuur_Zone_2
 
Aaah, this could be part of the problem! I apologise, I should have realised this in your first post when you mentioned a PT100 supplying a 4-20mA signal. This is most unlikely unless you have another conversion device in the line between the PT100 and the PLC.

Have you configured the module for use with a 2-wire current signal and then attached a PT100 sensor to it? In Siemens Hardware Config you have the choice of selecting Voltage, Current, TC (thermocouple) or RTD (resistive temperature device) as the type of signal being delivered to the channel on the module. If you select Current you then have the further choice of 2-wire or 4-wire. In Siemens' terms this refers to devices where the current loop is powered from the module (2-wire) or externally on the transmitter itself (4-wire). In either case the values returned to the PLC will be in the 0-27648 range. There is no defined industry standard for what 4mA represents or 20mA represents so you have to do the scaling yourself.

However if you have selected RTD, you then choose the correct PTx00 type. This defines the range for that sensor type since they are all standardised. In this case the module sends to the PLC a value which is (degrees C x 10). In other words all you need to do in the PLC is divide by 10 to get the actual temperature. Monitor your input word - you should be getting values between -300 and +600.

You must select the signal type correctly in H/W Config, you must adjust the range plug accordingly, and you must wire the connection correctly. I'm making no more assumptions now. Can you check and confirm all of these, please?

Regards

Ken
 
Hmmm, try this...

L #PV //Here comes direct signal 0-27648
ITD
DTR
T #PV_Real


L #PV_High //This may be yours 60Deg
L #PV_Low //This may be yours -30Deg
-R
T #Tune

L #PV_Real
L 2.764800e+004
/R
T #PV_tmp

L #PV_tmp
L #Tune
*R
L #PV_Low
+R
T #Output_Real

//This is for negative direct signals smaller then 0
L #PV
L 0
<I
JCN Here
L #PV_Low
T #Output_Real

Here: NOP 0
 
I am wanting to use the scale function.
I am using Step7 V5.4 SP4 rev 5.4.4.0

FC105 in my step7 is FC105 READ ANALOG VALUE 464-2 S5_CONVRT

I am sure I saw the scale function yesterday, but I have no idea where it went.
 
Open your FB or FC, display the overview window with program elements, libraries\Standart library\s5-s7 converting bloks\ your fc105
 
scale

Notice in the attached images the 2 FC105 blocks.

The first is located in the Standard Library\S5-S7 Converting Blocks\S5_CNVRT\FC105. The block on the left side of the ladder diagram is made using this FC105. "Read Analog Value464-2"

Now in the second image you see in the menu on the left another FC105 located in Standard Library\TI-S7 Converting Blocks\CONVERT\FC105. This function was used to generate the block shown on the right hand side of the ladder diagram.

Notice anything different about the 2 blocks? Te first time I made the block on the right the title said "scale" now it says "Read Analog Value464-2" . So same number , same discription, but different blocks and listed in two places with no explaination or comparison.

A different help file is assigned to each one as well.

So how/why do we have 2 blocks with the same FC number?

And why do I have to rename it if I use it more than once?

And if I rename the second FC105 to FC106, what happens when I try to use FC106? Why doesn't the function name stay the same and only the symbol change?

For example:

FC105 number one=FC105 scale oil temp input
FC105 number two=FC105 scale oil level input.



Step 7 is obviously written by half mad German engineers who feel the need to micro control every little possibility even if it means overwhelming the user and dragging the process to a slow crawl. This is the German way. I have worked with many Germans, this is my impression. They will over complicate a machine by 30 % to gain 2% more function and really believe they have done something to be proud of.

Step7 is fun to play with and I enjoy learning it, but it makes as much sense as everything else the Germans do.

Like having to define the background DB for a PID. That should be either completely unseen to the user or at least defaulted and allow you access if you must alter it.

Even the OLD Allen Bradley would do this.

Leave nothing to chance , leave no stone un turned, no address undefined, no detail is too small to complicate.

And this whole peripheral I/O thing is hilarious.

The end logic is laughably simple compared to figuring out how to just enter it into the software!

I have used Mitsubishi (4 versions) and Allen Bradley (3 versions) TI-Soft, GE-FANUC, Toshiba, MicroWin,and maybe a few others I don't remeber. Step 7 is a neat idea and is fun to explore but why does it have to be so convoluted ? And the documentation is a mountain of unclear nothing. I have read through it for days and still have not found one clear answer to any question.

Half of the posts here are the same way.

The worst ones just refer you to a section of the documentation, as if no one thought to look in the book.

I read the bookssssssssssssss. And I have questions due to the lack of clarity in the documentation. So why would someone refer me back to the documentation?

Anyway..............after 2 weeks of Step7 I needed to vent.
 
PT100 CONNECTED AS RTD, NOT AS 4-20mA
Function Call example:
Attach: Scaling Function From Analog value to Engineering Value:
(as like Siemens FC105, but more open)
Ps. Not tested yet, but it is freeware from me!
Br. Seppo
 
Last edited:
seppoalanen

now that is what I feel "scale" should be.

The Siemnes block 105 assumes that the input is a full analog input.

I might want to scale any number to some other range.

AB allows this, Input range to output range. Real scale.

From your image it looks as if you also allow a constant as a parameter.

As far as I can tell, Siemens doesn't allow using a constant. Maybe I am not doing it right.

I would like to put an out scale of "100" or some other constant. But the Siemens block only allows a real number in that spot.

I guess the only way to get what you want from Siemens is to make it custom like you did.

I do not have the statement list down yet and I have no time to learn it for this project.

Thanks for the download.
 
dahnuguy said:
...From your image it looks as if you also allow a constant as a parameter.
..., Siemens doesn't allow using a constant. Maybe I am not doing it right.

I would like to put an out scale of "100" or some other constant. But the Siemens block only allows a real number in that spot.
...

For FC105:
Write constant real number as "100.0" and enter. Resut shows this: 1.000000e+002

FC105 is only for case (unipolar) 0-27648 or for case (Bipolar) from -27648 to 27648 input signals as you mentioned.
FC105 is not for universal purposes, it is as iron rail.

For Attach file:
If real variable output needed, live away from TRUNC command to end of Network. Delete #ENG from variable list and finally re-write #R_ENG to #ENG.
Inputs are reparable by real with same extent and imagination.

It's cood practise use real numbers in math and finally change result to int as done. In AB world it's enough that some constant is as 100.0, not 100 if other variables are integers.
 

Similar Topics

5069 IF8 with a 4-20ma 0-100psi, sealed fixed, no calibration, transducer attached. IF8 is scaled 4ma= 0 psi, 20ma=100psi. If over time the...
Replies
12
Views
2,604
Hello, I have looked through the archives and haven't had any luck on the basics of scaling. I'm trying to refresh myself and what formulas I can...
Replies
10
Views
2,707
Hey guys, Normally I have an add in instruction that does this for me but the version of RSLogix I have (borrowed laptop) doesn’t have AOI’s so I...
Replies
19
Views
9,717
Hi, im using a wago 750-455 connected to s7-300 cpu I use fc105 but the scaling is not right, the value is 20% off. Almost like the fc thinks im...
Replies
15
Views
4,330
Hello, I am seeing an issue with inaccurate tank level. It is an elliptical bottom tank with an Anderson Level sensor mounted on the bottom of...
Replies
20
Views
7,488
Back
Top Bottom