Analog value processing in S7 and explanation need

arocon

Member
Join Date
Oct 2006
Location
Dubai
Posts
171
I am newbie in S7 and PLC and i am trying to learn analog processing in S7. I have got an example, which raise some questions.

[font=BHPLLN+Arial]In the following example, a value from 0 to 10V with an analog module SM334 in slot 6 is inputted (PIW288). It is first presented as an INTEGER (16 Bit) and should be normalized from 100 to 1000 in REAL format and saved in the memory bit double word MD10.

[/font]Solution in STL:

[font=BHPLLN+Arial]L PIW 288 //Analog value input 0 to 10 V contains 0 to 27648 integers (16 Bit)

ITD //Value of integer (16 Bit) converted into integer (32 Bit)

DTR //Value of integer (32 Bit) converted into a real number

L 2.7648e+4 //

/R //Division with real number 27648

L 9.000e+2 //

*R //

L 1.000e+2 //

+R // Addition with real number 100 (Offset)

T MD10 //Normalized value 100 to 1000 in real format

a) 'Analog value input 0 to 10 V contains 0 to 27648 integers (16 Bit) ' why analog value have 27648 integers, does not it 65536 as 16 bit?

b)'L 2.7648e+4 ' why this and why 2.7648e+4?

c)'/R ' why this?

d)'L 9.000e+2' why this and why 9.000e+2?

f)'*R ' why this ?

g)' L 1.000e+2 ' why this ? and why 1.000e+2?

h)'+R' why this?

i)'Normalized value 100 to 1000 in real format' why does it mean?

If any one help me with the reply it will be a great help.

arocon

[/font]
 
Do you have any familiarity with any other plcs or programming languages ?
Do you have access to any hardware or the simulator to test and observe what the plc does ?
 
Hello arocon;

a) 'Analog value input 0 to 10 V contains 0 to 27648 integers (16 Bit) ' why analog value have 27648 integers, does not it 65536 as 16 bit?

Yes, you can write a value of up to 65535 using a 16-bit register, if the value is formatted as an unsigned INT; a INT value will go from -32728 to +32767. The value 27648 is a numeric value chosen by Siemens because it represents 85% of ths signal range of the positive side of an INT value. Whatever signal lies between 0 and 27648 is valid and will be transmitted to the CPU for scaling and processing. Whatever lies above is declared over range error(say a 22 mA signal from a 20 mA transmitter). The same applies on negative signals.
Look at the analog signal representation tables for the analog I/O modules for St-300 and 400 PLCs, you will see limits of 27648 for all modules except RTD inputs.

b)'L 2.7648e+4 ' why this and why 2.7648e+4?

This is the value 27468.0 (in REAL format)as discussed earlier, written in scientific notation.

'/R ' '*R' '+R' '-R'
these are STL math operations on REAL values : divide, multiply, add, substract.

So you could probably rewrtite the STL code as the following equation, and deduce the scaling done:

STL_calc.jpg



Hope this helps,
Daniel Chartier
Edit: Oups, the divide operation is by 27648.0, sorry.
 
Last edited:
Daniel, you are simply great. How do i can find out (which S7 manual- hardware or software manual)that The value 27648 is a numeric value chosen by Siemens instead of 32767?

and i have seen your reply, seems you are having very versatile knowledge in S7. Could you tell me what is the fastest process atleast to gain programming skill in S7?

 
Hello arocon;

If you open, say, the s7-300 module data reference manual, you will find some tables explaining the binary representation of analog data (here is one, there are a bunch of other tables).

S7_analogRep.jpg


Hope this helps,
Daniel Chartier
 
Instead of all these equations, just try FC105 (Scale).

There is a built-in function in STEP-7. You just enter the upper and lower limits and you get the scaled value without any effort.

Also there is its reciprocal, FC106 (Unscale)
Check them in the help of STEP-7
 

Similar Topics

Hello, I'm new to siemens and i have problem about analog signals... I'm using a 8x13 Bit AI, a 4x12 bit Ao and a combo 8 bit 4ai/2ao card. How...
Replies
5
Views
6,130
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
7
Views
113
I'm pretty new to PLC's, so forgive me if I use the wrong terminology and whatnot. We have an issue at work where we have a flow meter that is...
Replies
10
Views
286
Apologies if this is a basic thing to ask here. I am controlling an Analog control valve. I need to open it for 100%. At this Juncture PID is not...
Replies
6
Views
763
Back
Top Bottom