Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 19 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
19
Dung lượng
183,5 KB
Nội dung
S7-200 Tip PT100 SIMATIC Group Tip No 36 S7-200 Tips Topic 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 Status: 06/97 page / 19 139 ntu1512760466.doc 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 0V +24V M Tip No 36 PT100 L+ C + C - C PU 214 Io L+ M EM 235 TD 200 T E M P E R A T U R E = ° C F5 F1 F6 F2 F7 F3 F8 F4 S H IF T ESC E N TE R Figure 36.1 Copyright 1997 by SIEMENS Status: 06/97 page / 19 140 ntu1512760466.doc 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 Program Start Initialization: delete operands, load °C-value, load °C-Offset, specify monitoring limits Write value from output current to AQW0 Transfer the measured value from AIWx in temperature value Subtract °C-Offset from temp.value; divide result by °C-value; Shift quotient by 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 Enable the first message for display Temperatur > high limit? No Yes Reset enable bit for Message Nr Set enable bit for Message Nr 2; switch off furnace Temperatur < low limit ? No Yes Set enable bit for Message Nr 3< switch on furnace END Copyright 1997 by SIEMENS Status: 06/97 Reset enable bit for Message Nr Figure 36.2 page / 19 141 ntu1512760466.doc 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 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 ] 110 108 106 104 102 T [°C ] 100 10 20 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 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 Status: 06/97 page / 19 142 ntu1512760466.doc 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 I0 PT100 ANALOG In-Out-PB RA A+ A- RB B+ B- RC C+ C- V I0 L+ M I EM 235 Figure 36.3 EM235 Circuit With the configuration switches on the EM235 module, the voltage range of 10V is selected as follows: Configuration Switch No: 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 The unused EM 235 inputs are short-circuited Copyright 1997 by SIEMENS Status: 06/97 page / 19 143 ntu1512760466.doc 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 LAD (S7-MicroDOS) Tip No 36 STL (IEC) Main Program // TITLE: Measuring Temperature with PT100 RTD and Displaying it using the TD200 │ SM0.1 MOV_DW──┐ ├─┤ ├─────────────────────────────┬────────────┤EN │ │ │ │ │ │ │ K0┤IN OUT├VD196 │ │ │ │ │ │ └───────┘ │ │ MOV_W───┐ │ ├────────────┤ EN │ │ │ │ │ │ │ K16┤IN OUT├VW250 │ │ │ │ │ │ └───────┘ │ │ MOV_W───┐ │ ├────────────┤ EN │ │ │ │ │ │ │ K4000┤IN OUT├VW252 │ │ │ │ │ │ └───────┘ │ │ MOV_W───┐ │ ├────────────┤ EN │ │ │ │ │ │ │ K300┤IN OUT├VW260 │ │ │ │ │ │ └───────┘ │ │ MOV_W───┐ │ ├────────────┤ EN │ │ │ │ │ │ │ K200┤IN OUT├VW262 │ │ │ │ │ │ └───────┘ │ │ MOV_W───┐ │ └────────────┤ EN │ │ │ │ │ K20000┤IN OUT├AQW0 │ │ │ │ └───────┘ LD MOVD MOVW MOVW MOVW MOVW MOVW SM0.1 0, VD196 16, VW250 4000, VW252 300, VW260 200, VW262 20000, AQW0 Copyright 1997 by SIEMENS Status: 06/97 // // // // // // // In the first cycle, clear VW196 and VW198 load 1°C = 16 in VW250 0°C-Offset = 4000 High temp limit 30°C Low temp limit 20°C Force Value for I0 page / 19 144 ntu1512760466.doc 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 │ SM0.0 SUB_I───┐ ├─┤ ├───────────────────────────┬────────────┤EN │ │ │ │ │ │ │ AIW4┤IN1 OUT├VW200 │ │ VW252┤IN2 │ │ │ └───────┘ │ │ DIV─────┐ │ ├────────────┤ EN │ │ │ │ │ │ │ VW200┤IN1 OUT├VD198 │ │ VW250┤IN2 │ │ │ └───────┘ │ │ MUL─────┐ │ ├────────────┤ EN │ │ │ │ │ │ │ K10┤IN1 OUT├VD196 │ │ VW198┤IN2 │ │ │ └───────┘ │ │ DIV─────┐ │ ├────────────┤ EN │ │ │ │ │ │ │ VW198┤IN1 OUT├VD196 │ │ VW250┤IN2 │ │ │ └───────┘ │ │ MOV_W───┐ │ ├────────────┤ EN │ │ │ │ │ │ │ VW198┤IN OUT├VW160 │ │ │ │ │ │ └───────┘ │ │ MOV_W───┐ │ ├────────────┤ EN │ │ │ │ │ │ │ K0┤IN OUT├VW198 │ │ │ │ │ │ └───────┘ │ │ MUL─────┐ │ ├────────────┤ EN │ │ │ │ │ │ │ K10┤IN1 OUT├VD198 │ │ VW200┤IN2 │ │ │ └───────┘ │ │ ADD_I───┐ │ ├────────────┤ EN │ │ │ │ │ │ │ VW160┤IN1 OUT├VW200 │ │ VW200┤IN2 │ │ │ └───────┘ │ │ MOV_W───┐ │ ├────────────┤ EN │ │ │ │ │ │ │ VW200┤IN OUT├VW116 │ │ │ │ │ │ └───────┘ │ │ V12.7 K1 │ └────────────( S ) │ Copyright 1997 by SIEMENS Status: 06/97 page / 19 145 ntu1512760466.doc 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 LD MOVW -I DIV MUL DIV MOVW MOVW MUL +I MOVW S Tip No 36 // Always load the measured // value in VW200 // deduct 0°C-Offset // divide the value // remainder x 10 // 10 x remainder / 30 = digit after decimal point // save one digit after decimal point // delete VW198 // Temp value x10 // Temp value X10 + digit after decimal point // transfer result in VW116 for display // Release Message for display │ │ VW200 VW260 V12.6 ├───────┤ >= W ├───────────┬────────────( ) │ │ │ │ Q0.0 K1 │ ├────────────( R ) │ │ │ │ MOV_W───┐ │ └────────────┤EN │ │ │ │ │ VW260┤IN OUT├VW136 │ │ │ │ └───────┘ LDW>= = R MOVW SM0.0 AIW4, VW200 VW252, VW200 VW250, VD198 10, VD196 VW250, VD196 VW198, VW160 0, VW198 10, VD198 VW160, VW200 VW200, VW116 V12.7, PT100 VW200, VW260 V12.6 Q0.0, VW260, VW136 // // // // // if high limit is exceeded Release Message Turn off furnace High limit in VW136 for display of Message │ VW200 VW262 V12.5 ├───────┤ xxx.x oC” xuất dòng thứ hình nhiệt độ lớn nhiệt độ giới hạn Và thông báo “Nhiệt độ < xxx.x oC” nhiệt độ đo giảm xuống mức giới hạn nhiệt độ thấp Sơ đồ đấu nối thiết bị cho đây: Copyright 1997 by SIEMENS Status: 06/97 page / 19 149 ntu1512760466.doc 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 0V +24V M Tip No 36 PT100 L+ C + C - C PU 214 Io L+ M EM 235 TD 200 T E M P E R A T U R E = °C F5 F1 F6 F2 F7 F3 F8 F4 S H IF T ESC E N TE R Lưu đồ thuật tốn chương trình cho đây: Copyright 1997 by SIEMENS Status: 06/97 page / 19 150 ntu1512760466.doc 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 Bắt đầu CT Khởi tạo: xóa bỏ toán hạng, lấy giá trị chênh lệch oC 0oC, định giá trị giới hạn, ghi giá trị dòng điện AQW0 Chuyển giá trị đo nhiệt độ AIWx Thực tính tốn nhiệt độ: giá trị đo trừ giá trị đo 0oC, chia cho độ chênh tương ứng với oC Chia phần dư nhân 10 cho độ chênh tương ứng 1oC sau cộng vào giá trị tính Ghi vào vùng nhớ cập nhật thông báo TD200 Hiển thị thông báo Sai Nhiệt độ > Nhiệt độ mức cao? Đúng Xóa bít cho phép hiển thị thông báo Hiện thông báo 2; Tắt lò Nhiệt độ= W ├───────────┬────────────( ) │ │ │ │ Q0.0 K1 │ ├────────────( R ) │ │ │ │ MOV_W───┐ │ └────────────┤EN │ │ │ │ │ VW260┤IN OUT├VW136 │ │ │ │ └───────┘ LDW>= = R MOVW SM0.0 AIW4, VW200 VW252, VW200 VW250, VD198 10, VD196 VW250, VD196 VW198, VW160 0, VW198 10, VD198 VW160, VW200 VW200, VW116 V12.7, PT100 VW200, VW260 V12.6 Q0.0, VW260, VW136 // // // // Nếu vượt giới hạn nhiệt độ cao Hiện thơng báo Tắt lò Chuyển giá trị giới hạn nhiệt độ cao VW136 để lên TD 200 │ VW200 VW262 V12.5 ├───────┤