
SIMATIC S7-200 Tips
S7-200 Tip PT100 Tip No. 36
Group Topic
6 Measuring and Monitoring Temperature with a PT100 Resistance
Temperature Detector
CPUs required for this tip
CPU 210 CPU 212 CPU 214 CPU 215 CPU 216 OTHER
Overview
This program tip discusses the following: measuring a temperature and monitoring the
specified limits by using the analog expansion module EM235; at one input channel of the
analog module, a temperature sensor PT100 is connected.
In order to convert the temperature-conditioned resistance change of the PT100 into a voltage,
the analog output is used as constant current source. The output supplies the PT100 sensor
with a 12.5mA constant current. With this circuit, a linear input voltage of 5mV/°C is generated.
The EM235 converts this voltage into a digital value, which the program reads out cyclically.
From the value read, the program calculates the temperature[°C], using the following formula
T[°C] = Digital Value - 0 ° C-Offset
1°C-Value
Digital Value = value stored in AIWx (x=0,2,4).
0°C-Offset = digital value, measured at 0°C. In the case in point, this offset is 4000.
1°C-Value = value difference at a temperature rise of 1°C. In this tip, 1°C-Value = 16.
The program calculates the value to the first decimal point and writes the result in the
embedded variable of Message 1: ’’Temperature = xxx.x°C’’, which is read out with a TD200. In
the initialization segment of the program, the user can enter a high and low temperature limit.
The program monitors the measured value and displays a warning via the TD200 if the
measured temperature leaves the selected range. Message 2: ‘’Temperature > xxx.x°C’’
appears in the second display line of the TD200 if the measured temperature exceeds the high
temperature limit; Message 3: ‘’Temperature < xxx.x°C" is displayed if the measured
temperature drops below the low temperature limit.
Copyright 1997 by SIEMENS page 1 / 19 s72_36e_3244.doc
Status: 06/97 Version 1.3
SIMATIC S7-200 customers have free use of the application tips. These tips are only a general approach to using the S7-200 with various applications.
Your specific application may be different. It is your responsibility to use the SIMATIC S7-200 properly in your applications.

S7-200 Tip PT100 Tip No. 36
T D 2 0 0
F 5
F 1
F 6
F 2
F 7
F 3
F 8
F 4
S H I F T
ESC
E N T E R
C P U 2 1 4
M L + C + C - L + M
E M 2 3 5
0 V + 2 4 V
T E M P E R A T U R E = 2 3 . 6 ° C
P T 1 0 0
I o
Figure 36.1
Copyright 1997 by SIEMENS page 2 / 19 s72_36e_3244.doc
Status: 06/97 Version 1.3
SIMATIC S7-200 customers have free use of the application tips. These tips are only a general approach to using the S7-200 with various applications.
Your specific application may be different. It is your responsibility to use the SIMATIC S7-200 properly in your applications.

S7-200 Tip PT100 Tip No. 36
Program Structure
Figure 36.2
Copyright 1997 by SIEMENS page 3 / 19 s72_36e_3244.doc
Status: 06/97 Version 1.3
SIMATIC S7-200 customers have free use of the application tips. These tips are only a general approach to using the S7-200 with various applications.
Your specific application may be different. It is your responsibility to use the SIMATIC S7-200 properly in your applications.
Initialization: delete operands, load 1 °C-value, load 0 °C-Offset, specify
monitoring limits. Write value from output current to AQW0.
Program Start
Transfer the measured value from AIWx in temperature value.
Subtract 0 °C-Offset from temp.value; divide result by 1 °C-value; Shift
quotient by 1 decimal point to the left
Divide remainder X 10 by 1°C-value and add to temp.value. Write
calculated temperature in embedded variable of Message Nr. 1
Enable the first message for display
Temperatur > high limit?
Set enable bit for Message Nr. 2;
switch off furnace
Reset enable bit for Message Nr. 2
Set enable bit for Message Nr. 3<
switch on furnace
Reset enable bit for Message Nr. 3
Temperatur < low limit ?
END
No
No
Yes
Yes

S7-200 Tip PT100 Tip No. 36
Program Description
Temperature Sensor:
The PT100 is a platinum resistance temperature detector which is suitable for temperature
measurements in an application range from -60 to +400°C.
Calculating the Supply Current for PT100:
The PT100 has a resistance value of 100 Ohm at 0C°. The resistor changes linear with the
temperature by approximately 0.4 Ohm per degree Celsius.
R [ O h m ]
T [ ° C ]
1 0 0
1 0 2
1 0 4
1 0 6
1 0 8
1 1 0
0 1 0 2 0
To generate a voltage coefficient of 5mV/°C, 12.5mA supply current is needed. The resolution
at the analog output is 10uA/Count, so that the required count value has to be 1250, in order to
get 12.5mA. Since the data word format of the AQW is shifted to the right by 4 bits, the count
value has to be multiplied by 16. Consequently, 20000 has to be entered in AQW0 in order to
initialize 12.5mA current at the analog output Io.
Format Equation: (32000/20mA * 12.5mA = 20000)
Copyright 1997 by SIEMENS page 4 / 19 s72_36e_3244.doc
Status: 06/97 Version 1.3
SIMATIC S7-200 customers have free use of the application tips. These tips are only a general approach to using the S7-200 with various applications.
Your specific application may be different. It is your responsibility to use the SIMATIC S7-200 properly in your applications.

S7-200 Tip PT100 Tip No. 36
RA A+ A- RB B+ B- RC C+ C- V
0
I
0
L+ M I
EM 235
ANALOG
In-Out-PB
PT100
I
0
Figure 36.3
EM235 Circuit
With the configuration switches on the EM235 module, the voltage range of 0..10V is selected
as follows:
Configuration Switch No: 1 3 5 7 9 11
ON OFF OFF OFF ON OFF
Depending on the number of the channel used on the EM235, the corresponding address of
the AI word has to be used in the program:
AIW0 for Input Channel 1, AIW2 for Input Channel 2,
AIW4 for Input Channel 3, AQW0 for Output Channel 1
The unused EM 235 inputs are short-circuited.
Copyright 1997 by SIEMENS page 5 / 19 s72_36e_3244.doc
Status: 06/97 Version 1.3
SIMATIC S7-200 customers have free use of the application tips. These tips are only a general approach to using the S7-200 with various applications.
Your specific application may be different. It is your responsibility to use the SIMATIC S7-200 properly in your applications.