0% found this document useful (0 votes)
9 views

S7-1200 Programmable Controller - Processing of Analog Values

Uploaded by

Wole Oyefisayo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

S7-1200 Programmable Controller - Processing of Analog Values

Uploaded by

Wole Oyefisayo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

S7-1200 Programmable controller

Processing of analog values

Processing of analog values

Analog signal modules provide input signals or expect output values that represent either a
voltage range or a current range. These ranges are ±10 V, ±5 V, ±2.5 V, or 0 - 20 mA. The values
returned by the modules are integer values where 0 to 27648 represents the rated range for
current, and -27648 to 27648 for voltage. Anything outside the range represents either an
overflow or underflow. See the tables for analog input representation and analog output
representation for details about the types of out-of-range values.
In your control program, you probably need to use these values in engineering units, for
example to represent a volume, temperature, weight or other quantitative value. To do this for
an analog input, you must first normalize the analog value to a real (floating point) value from
0.0 to 1.0. Then you must scale it to the minimum and maximum values of the engineering
units that it represents. For values that are in engineering units that you need to convert to an
analog output value, you first normalize the value in engineering units to a value between 0.0
and 1.0, and then scale it between 0 and 27648 or -27648 to 27648, depending on the range
of the analog module. STEP 7 provides the NORM_X and SCALE_X instructions for this purpose.
You can also use the CALCULATE instruction to scale the analog values.

Example: analog value processing


Consider, for example, an analog input that has a current range of 0 - 20 mA. The analog input
module returns values in the range 0 to 24768 for measured values. For this example, consider
that you are using this analog input value to measure a temperature range from 50 °C to 100 °
C. A few sample values would have the following meanings:

Analog input value Engineering units

0 50 °C

6192 62.5 °C

12384 75 °C

18576 87.5 °C

24768 100 °C

The calculation for determining engineering units from the analog input value in this example
is as follows:
Engineering units value = 50 + (Analog input value) * (100 - 50) / (24768 - 0)
For the general case, the equation would be:

Englineering units value = (Low range of engineering units) +


(Analog input value) *
(High range of engineering units - Low range of engineering units) /
(Maximum analog input range - Minimum analog input range)

This document constitutes a free excerpt compiled by the user himself/herself from the documentation provided by Siemens for this product. Siemens disclaims all
liability for the completeness of this document. It shall only be used for the user's own internal purposes. It shall not be passed on to third parties.
11/1/2024
S7-1200 Programmable controller
Processing of analog values

In PLC applications, the typical method is to normalize the analog input value to a floating point
value between 0.0 and 1.0. Then, you would scale the resulting value to a floating point value
in the range of your engineering units. For simplicity, the following LAD instructions use
constant values for the ranges; you might actually choose to use tags:
Network 1

Network 2

See also
→ Measurement ranges of the analog inputs for voltage and current (SB and SM)
→ Measurement ranges of the analog outputs for voltage and current (SB and SM)
→ SCALE_X (Scale) and NORM_X (Normalize)
→ CALCULATE (Calculate)
→ Creating a complex equation with a simple instruction

This document constitutes a free excerpt compiled by the user himself/herself from the documentation provided by Siemens for this product. Siemens disclaims all
liability for the completeness of this document. It shall only be used for the user's own internal purposes. It shall not be passed on to third parties.
11/1/2024

You might also like