s7 scaling question

darren.s

Member
Join Date
Apr 2005
Posts
46
hello people

im after some help with the scaling of an analogue input with s7.
if i have a pressure tansducer 0-400 bar at 4-20ma and the input card is configured correctly.
12bit card.
assume signal comes in to PIW256 im after some help on how to manipulate this figure so i can make sense of it and use it in the program for different tasks.
is it best to leave the figure as is and use compare functions.
to flag alarms for example?
 
Assuming S7 300/400 series, use FC105 to scale your analogue signal into engineering units, see example below: (wFC105Return is a word variable, rPressureInBar is a real variable)


CALL "SCALE" (
IN := PIW256,
HI_LIM := 4.000000e+002,
LO_LIM := 0.000000e+000,
BIPOLAR := FALSE,
RET_VAL := #wFC105Return,
OUT := #rPressureInBar);
 
cant seem to get my head round this real number syndrome.
4,000000e+002 and 0.000000e+000 as above.
can anyone explain these figures i know "e" is the exponential but im just not getting it.
 
One of the examples above:

4.000000e+002

can be expressed as 4.000000 * 102, or 400.
The basis for the exponent is assumed to be 10.

So in a generic sense:

x.xxxxxxe+yyy

is x.xxxxxx * 10yyy

Hope this helps.
Keith
 
i understand that 4*10 to power of 2 is 400 which = 4.000000e+002
but why express all the 000000,s why not 4e+002.
am i missing something here!
maybe i should just give up
 
The display format for the numbers is a function of the Step 7 block editor. When creating the code, I actually typed "400.0" and "0.0", but the editor then displayed the numbers in the generalised floating point format.
 
try this

L #input_channel
ITD
DTR
L 2.764800e+004
/R
T #percent

L #span
L #zero
-R
L #percent
*R
L #zero
+R
T #reading

L #hi_setpoint
>=R
= #hi_alarm

L #reading
L #hihi_setpoint
>=R
= #hihi_alarm
 

Similar Topics

Hi everyone. I am hoping that someone could assist me on some scaling. I have a 0 to 5v laser potentiometer that I am trying to scale into a PID...
Replies
3
Views
1,966
Hello everyone, I am migrating a PLC5 program controlling a crane to a siemens s7-1500 PLC, but since i have no experience programming PLC5 I have...
Replies
8
Views
2,964
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
8
Views
3,608
Hello everyone, I have a plc 5 input card receiving an input from a conductivity Transmitter where 0ma=0 uhms and 20ma= 20,000 uhms The raw min...
Replies
2
Views
1,827
Hi all, Yesterday I was setting up a 4-20mA scale for a tank level. The tank has a staff gauge and a pressure sensor, and the scaling printed on...
Replies
7
Views
2,509
Back
Top Bottom