You are on page 1of 4

How do you standardize and destandardize analog values

with STEP 7 (TIA Portal)?

Entry

Associated product(s)
Instructions
An analog input module provides a number value for a standardized analog signal (current, voltage,
resistance or temperature). This number value must represent the parameter to be measured (fill level in
liters, for example). This procedure is called standardizing or scaling the analog value.
Fig. 01 shows an example for standardizing.

Fig. 01
Conversely the user program calculates a process value. This process value has to be converted into a
number value that the analog output module converts into an analog signal with which it activates an analog
actuator. This conversion procedure is called destandardizing. The functions of the library available for
downloading below can be used for standardizing and destandardizing in analog value processing.
Fig. 02 shows an example for destandardizing.

Fig. 02
Thus in the y values there is always the result of the conversion. The x values are the known parameters in
each case.
The functions below are available in both downloadable libraries.

Function
SKAL_LINEAR+LIM_INT_REAL
[FC165]
SCL_Scale_Linear_int-to-real
[FC1]
SKAL_LINEAR+LIM_REAL_INT
[FC166]
SCL_Scale_Linear_real-to-int
[FC2]
SKAL_LINEAR+LIM_INT [FC167]
SCL_Scale_Linear_Int [FC3]
SKAL_LINEAR+LIM_REAL
[FC168]
SCL_Scale_Linear_Real [FC4]

Langua Description
ge
STL Here the x values are integer
numbers and the y values are real
SCL numbers.
STL
SCL
STL
SCL
STL

Here the x values are real numbers


and the y values are integer
numbers.
Here the x values and the y values
are integer numbers.
Here the x values and the y values
are real numbers.

SCL

Table 01
Notes
These functions do not change the address register AR1/AR2 and for the FBD and LAD applications provide
the ENO box in which the RLO = 0 or 1 is stored in the BR bit.
By entering yMIN and yMAX you can limit the calculated y value to a specific range with lower and upper
limits. This cuts out overrange and underrange areas of the analog input and output cards.
Thus Y is calculated according to the general linear equation: y = a x + b.
This yields the following relationship: y = (y1-y0) / (x1-x0) * (x-x0) + y0

Example of linear scaling with the function SKAL_LINEAR+LIM_INT_REAL [FC165] (INTEGER >
REAL)

Fig. 03
Example
A signal of 4mA to 20mA is present at the analog input card. This is converted to the internal CPU value of 0
to 27648. A fill level is to be measured with this. It is known that 4mA corresponds to the fill level of 0.0m
and 20mA to the fill level of 1.7m.
This yields the following parameters:
P0(x0=0; y0=0.0)
P1(x1=+27648; y1=+1.7)
You call the FC165 function as follows:

Fig. 04

Download "STEP7_TIA_Portal_AWL_Scale"
The download contains the functions FC164, FC165, FC166 and FC167 with the STL program language for the
S7-300/400/1500.
Copy the "STEP7_TIA_Portal_AWL_Scale.zip" file into a separate directory and then start the file with a
double-click. The library now unpacks with all the associated subdirectories. Then you can open and edit the
unpacked library in STEP 7 (TIA Portal).
STEP7_TIA_Portal_AWL_Scale.zip ( 1036 KB )
Download "STEP7_TIA_Portal_SCL_Scale"
The download contains the functions FC1, FC2, FC3 and FC4 with the SCL program language for the S71200/1500.
Copy the "STEP7_TIA_Portal_SCL_Scale.zip" file into a separate directory and then start the file with a doubleclick. The library now unpacks with all the associated subdirectories. Then you can open and edit the
unpacked library in STEP 7 (TIA Portal).
STEP7_TIA_Portal_SCL_Scale.zip ( 987 KB )
Creation environment
The screens and downloads in this FAQ response were created with STEP 7 (TIA Portal) V12.
Additional Keywords
Measuring range, Measured value change

You might also like