Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Siemens CPU 224 XP analog to real??? 1

Status
Not open for further replies.

Cristodul

Mechanical
Dec 1, 2006
12
0
0
US
Hi all
I am using Simatic S7-200
I have connected a cpu 224 xp and a analog sensor (4-20mA) 12 bit resolution inside of a pneumatic cylinder. When the cylinder is fully retracted the value on the PLC is 6304 and @fully retract is 26624.
I have problems converting the analog value in to inches.
I tried to determine the resolution and I have the following results: intercept is -2.4450 and the x variable is 0.0004
I looked over some the other topics but without success.
Can somebody help me with the program?

Thanks’ in advance!
C
 
Replies continue below

Recommended for you

I am not certain that the Seimens PLC has this feature, but Allen-Bradley PLC's have a "box" called SCP (I am pretty confident that Seimens does have a similar feature as most PLC manufacturers try to duplicate competitor's features).This box allows you to enter the range of input values (in your case-6304 minimum value and 26624 maximum value) and select the range of output values and designate a memory location for the output result to be stored in. Measure your cylinder stroke (say 4")and set the output range from minimum = 0 and maximum = 400. This will give you an integer output that is able to measure .01" changes in position. You could also construct programming that would do the same thing, if you have the time.
 
ab contrologix 1756-of8 output analog, never use input analog, has scaling and output range built into the cards configuration tab.

Does siemans have this same feature on their analog input
cards?

I barely remember analog input cards in PLC5 and it had scaling and output range built into the card configuration itself, but its been awhile, so my memory is vague.

I find it hard to believe that siemens would not have this same feature, but hey this is the germans we are talking about.

 
The S7-200 "Micro" is fairly limited... I don't remember seeing any scaling functions in the Micro/Win software; check the online help associated with Micro/Win. There is a lot of good information in there... Personally, any time that I have scaled values, I've done it through the HMI screen. Protool (HMI config. software) does have scaling options.
 
S7-200, designed by Americans by the way :), is a very basic PLC. It has integer and floating point maths but nothing special. You would have to write the code to scale the inputs yourself.

S7-300 and 400's have Functions which scale analogues for you.

To scale is a simple maths problem.

From your post;
4mA = 6304, 20mA = 26624.
The range on the above = 26624-6304 = 20320.

If you wanted to scale and give a range between 0-500 for example, divide 500 by 20320 to get the scaling factor.

500/20320 = 0.01878.

So to scale the 4-20mA to 0-500, then do the following maths in the PLC.

(INPUT ANALOGUE - 6304) * 0.01878.

There are a couple of conversion instructions for integer to real etc.

 
Is not working.
When I'm with the cylinder fully retracted I get a number over 100
I tried this way (please see bellow) but when I'm fully retracted insted of 0 i'm @ 0.070

I've measured with the caliper distance @ different points and I've got:

raw val inches
6304 0
6928 0.328
7584 0.581
8144 0.805
8624 0.99
8848 1.09
9360 1.288
9504 1.353
9680 1.418
9728 1.4435
10384 1.6995
11232 2.039
12565 2.562
12832 2.6735
13648 3.001
14256 3.2405
15184 3.6145
15936 3.914
16720 4.226
17932 4.489
18144 4.79
19312 5.25
19384 5.36
20304 5.648
21152 5.991
21888 6.277
22560 6.55
23504 6.91
24288 7.245
25136 7.582
26192 8.003
26640 8.185

In EXCEL I've run a Regression (Tools->Data Analysis)
and I have the folowing program:


LD Always_On:SM0.0
ITD AIW0, #temp1:LD0
AENO
DTR #temp1:LD0, #temp2:LD4
AENO
*R 0.0003982944, #temp2:LD4
AENO
MOVR #temp2:LD4, DisplacementInches:VD40
-R 2.390614, DisplacementInches:VD40
 
Status
Not open for further replies.
Back
Top