1. Trang chủ
  2. » Khoa Học Tự Nhiên

Simatic S7 - 200 tips doc

19 537 2

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 19
Dung lượng 199,5 KB

Nội dung

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 rzz1406913668.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 E S C 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 rzz1406913668.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 rzz1406913668.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 I o . Format Equation: (32000/20mA * 12.5mA = 20000) Copyright 1997 by SIEMENS page 4 / 19 rzz1406913668.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 rzz1406913668.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 LAD (S7-MicroDOS) STL (IEC) Main Program // TITLE: Measuring Temperature with PT100 RTD and Displaying it using the TD200 │ SM0.1 MOV_DW──┐ 1 ├─┤ ├─────────────────────────────┬────────────┤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 SM0.1 // In the first cycle, MOVD 0, VD196 // clear VW196 and VW198 MOVW 16, VW250 // load 1°C = 16 in VW250 MOVW 4000, VW252 // 0°C-Offset = 4000 MOVW 300, VW260 // High temp. limit 30°C MOVW 200, VW262 // Low temp. limit 20°C MOVW 20000, AQW0 // Force Value for I 0 Copyright 1997 by SIEMENS page 6 / 19 rzz1406913668.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 │ SM0.0 SUB_I───┐ 2 ├─┤ ├───────────────────────────┬────────────┤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 page 7 / 19 rzz1406913668.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 LD SM0.0 // Always load the measured MOVW AIW4, VW200 // value in VW200 -I VW252, VW200 // deduct 0°C-Offset DIV VW250, VD198 // divide the value MUL 10, VD196 // remainder x 10 DIV VW250, VD196 // 10 x remainder / 30 = 1 digit after decimal point MOVW VW198, VW160 // save one digit after decimal point MOVW 0, VW198 // delete VW198 MUL 10, VD198 // Temp. value x10 +I VW160, VW200 // Temp. value X10 + 1 digit after decimal point MOVW VW200, VW116 // transfer result in VW116 for display S V12.7, 1 // Release Message 1 for display │ │ VW200 VW260 V12.6 3 ├───────┤ >= W ├───────────┬────────────( ) │ │ │ │ Q0.0 K1 │ ├────────────( R ) │ │ │ │ MOV_W───┐ │ └────────────┤EN │ │ │ │ │ VW260┤IN OUT├VW136 │ │ │ │ └───────┘ LDW>= VW200, VW260 // if high limit is exceeded = V12.6 // Release Message 2 R Q0.0, 1 // Turn off furnace MOVW VW260, VW136 // High limit in VW136 for // display of Message 2 │ VW200 VW262 V12.5 4 ├───────┤ <= W ├───────────┬────────────( ) │ │ │ │ Q0.0 K1 │ ├────────────( S ) │ │ │ │ MOV_W───┐ │ └────────────┤EN │ │ │ │ │ VW262┤IN OUT├VW156 │ │ │ │ └───────┘ LDW<= VW200, VW262 // if drop below low limit = V12.5 // Release Message 3 S Q0.0, 1 // switch on furnace MOVW VW262, VW156 // Low limit in VW156 for // display of Message 3 Copyright 1997 by SIEMENS page 8 / 19 rzz1406913668.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 │ 5 ├───────────────────────────────────────( MEND ) MEND // End of program Data Block DB1 (V Memory): The Parameter block for TD200 for reading out the message with embedded value of the measured temperature, and warnings with embedded temperature limits. // BEGIN TD200_BLOCK 0 // (Comments within this block should not be edited or removed) VB0 'TD' // TD 200 Identification VB2 16#10 // Set Language to English, set Update to As fast as possible VB3 16#00 // Set the display to 20 character mode; Up key V3.2; Down key V3.3 VB4 3 // Set the number of messages VB5 0 // Set the Function Keys notification bits to M0.0 - M0.7 VW6 100 // Set the starting address for messages to VW100 VW8 12 // Set the starting address for message enable bits to VW12 // MESSAGE 1 // Message Enable Bit V12.7 VB100 'Temperature = ' VB114 16#00 // No Edit; No Acknowledgement; No Password; VB115 16#31 // Unsigned Word; 1 Digits to the right of the decimal; VW116 16#00 // Embedded Data Value: Move data for display here. VB118 'ßC' // MESSAGE 2 // Message Enable Bit V12.6 VB120 'Temperature > ' VB134 16#00 // No Edit; No Acknowledgement; No Password; VB135 16#31 // Unsigned Word; 1 Digits to the right of the decimal; VW136 16#00 // Embedded Data Value: Move data for display here. VB138 'ßC' // MESSAGE 3 // Message Enable Bit V12.5 VB140 'Temperature < ' VB154 16#00 // No Edit; No Acknowledgement; No Password; VB155 16#31 // Unsigned Word; 1 Digits to the right of the decimal; VW156 16#00 // Embedded Data Value: Move data for display here. VB158 'ßC' // END TD200_BLOCK 0 Copyright 1997 by SIEMENS page 9 / 19 rzz1406913668.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 Conversion Notes To Convert from IEC STL to S7-Micro/DOS STL:  Add a ‘K’ before all non-Hex numerical constants (i.e. 4 ⇒ K4)  Replace ‘16#’ with ‘KH’ for all Hex constants (i.e. 16#FF ⇒ KHFF)  Commas denote field divisions. Use arrow or TAB keys to toggle between fields.  To convert an S7-Micro/DOS STL program to LAD form, every network must begin with the word ‘NETWORK’ and a number. Each network in this Application Tip program is designated by a number on the ladder diagram. Use the INSNW command under the EDIT menu to enter a new network. The MEND, RET, RETI, LBL, SBR, and INT commands each receive their own networks.  Line-Comments denoted by ‘//’ are not possible with S7-Micro/DOS, but Network- Comments are possible. The data block shown was created in Micro/Win; in Micro/DOS use the V-memory editor to enter a data block (Refer to the Micro/DOS users’ guide). Note that in Micro/Win:  16# denotes a hexadecimal value  ‘text‘ represents a string value General Notes The SIMATIC S7-200 Application Tips are provided to give users of the S7-200 some indication as to how, from the view of programming technique, certain tasks can be solved with this controller. These instructions do not purport to cover all details or variations in equipment, nor do they provide for every possible contingency. Use of the S7-200 Application Tips is free. Siemens reserves the right to make changes in specifications shown herein or make improvements at any time without notice or obligation. It does not relieve the user of responsibility to use sound practices in application, installation, operation, and maintenance of the equipment purchased. Should a conflict arise between the general information contained in this publication, the contents of drawings or supplementary material, or both, the latter shall take precedence. Siemens is not liable, for whatever legal reason, for damages or personal injury resulting from the use of the application tips. All rights reserved. Any form of duplication or distribution, including excerpts, is only permitted with express authorization by SIEMENS. Copyright 1997 by SIEMENS page 10 / 19 rzz1406913668.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. [...]... 15 / 19 rzz1406913668 .doc Version 1.3 SIMATIC S 7- 200 customers have free use of the application tips These tips are only a general approach to using the S 7- 200 with various applications Your specific application may be different It is your responsibility to use the SIMATIC S 7- 200 properly in your applications S 7- 200 Tip PT100 Tip No 36 // Đo nhiệt độ và hiển thị lên màn hình TD 200 1 │ SM0.1 MOV_DW──┐... hạn nhiệt độ thấp ra VW156 để hiện lên TD200 page 18 / 19 rzz1406913668 .doc Version 1.3 SIMATIC S 7- 200 customers have free use of the application tips These tips are only a general approach to using the S 7- 200 with various applications Your specific application may be different It is your responsibility to use the SIMATIC S 7- 200 properly in your applications S 7- 200 Tip 5 PT100 │ ├───────────────────────────────────────(... ©1997 by SIEMENS Status: 06/97 page 12 / 19 rzz1406913668 .doc Version 1.3 SIMATIC S 7- 200 customers have free use of the application tips These tips are only a general approach to using the S 7- 200 with various applications Your specific application may be different It is your responsibility to use the SIMATIC S 7- 200 properly in your applications S 7- 200 Tip PT100 Tip No 36 Bắt đầu CT Khởi tạo: xóa bỏ toán... hiển thị VB158 'ßC' // Kết thúc TD200_BLOCK 0 Copyright ©1997 by SIEMENS Status: 06/97 page 19 / 19 rzz1406913668 .doc Version 1.3 SIMATIC S 7- 200 customers have free use of the application tips These tips are only a general approach to using the S 7- 200 with various applications Your specific application may be different It is your responsibility to use the SIMATIC S 7- 200 properly in your applications... OUT├VD198 │ VW200┤IN2 │ │ └───────┘ │ ADD_I───┐ ├────────────┤ EN │ │ │ │ │ VW160┤IN1 OUT├VW200 │ VW200┤IN2 │ │ └───────┘ │ MOV_W───┐ ├────────────┤ EN │ │ │ │ │ VW200┤IN OUT├VW116 │ │ │ │ └───────┘ │ V12.7 K1 └────────────( S ) page 17 / 19 rzz1406913668 .doc Version 1.3 SIMATIC S 7- 200 customers have free use of the application tips These tips are only a general approach to using the S 7- 200 with various... là 2000 0 để có thể tạo ra dòng điện 12,5 mA ở đầu ra Io 20mA tương ứng với giá trị 32000 Do đó, ( 32000 /20mA * 12.5mA = 2000 0) I0 PT100 ANALOG In-Out-PB RA A+ A- RB B+ B- RC C+ C- V0 I0 L+ M I EM 235 Sơ đồ đấu nối khối EM235 Công tắc thiết lập cho module EM235 để chọn chế độ 0 – 10 V được bố trí như sau: Copyright ©1997 by SIEMENS Status: 06/97 page 14 / 19 rzz1406913668 .doc Version 1.3 SIMATIC S 7- 200. .. SIMATIC S 7- 200 customers have free use of the application tips These tips are only a general approach to using the S 7- 200 with various applications Your specific application may be different It is your responsibility to use the SIMATIC S 7- 200 properly in your applications S 7- 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 = 2 3 6 °C F5 F1 F6 F2 F7... │ │ │ │ │ │ AIW4┤IN1 OUT├VW200 │ │ VW252┤IN2 │ │ │ └───────┘ │ │ DIV─────┐ │ ├────────────┤ EN │ │ │ │ │ │ │ VW200┤IN1 OUT├VD198 │ │ VW250┤IN2 │ │ │ └───────┘ │ │ MUL─────┐ Copyright ©1997 by SIEMENS Status: 06/97 page 16 / 19 rzz1406913668 .doc Version 1.3 SIMATIC S 7- 200 customers have free use of the application tips These tips are only a general approach to using the S 7- 200 with various applications... 19 rzz1406913668 .doc Version 1.3 SIMATIC S 7- 200 customers have free use of the application tips These tips are only a general approach to using the S 7- 200 with various applications Your specific application may be different It is your responsibility to use the SIMATIC S 7- 200 properly in your applications S 7- 200 Tip PT100 Tip No 36 1 3 5 7 9 11 ON OFF OFF OFF ON OFF Phụ thuộc vào số kênh được sử dụng... a general approach to using the S 7- 200 with various applications Your specific application may be different It is your responsibility to use the SIMATIC S 7- 200 properly in your applications S 7- 200 Tip PT100 Tip No 36 Mô tả chương trình: Cảm biến nhiệt độ: PT 100 là thiết bị phát hiện nhiệt độ bằng điện trở bạch kim, dải nhiệt độ thích hợp sử dụng thiết bị này là từ -6 0 đến 400 oC Tính toán nguồn cấp . responsibility to use the SIMATIC S 7- 200 properly in your applications. S 7- 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. use the SIMATIC S 7- 200 properly in your applications. S 7- 200 Tip PT100 Tip No. 36 LD SM0.0 // Always load the measured MOVW AIW4, VW200 // value in VW200 -I VW252, VW200 // deduct 0°C-Offset. to use the SIMATIC S 7- 200 properly in your applications. S 7- 200 Tip PT100 Tip No. 36 Copyright 1997 by SIEMENS page 13 / 19 rzz1406913668 .doc Status: 06/97 Version 1.3 SIMATIC S 7- 200 customers

Ngày đăng: 02/08/2014, 00:21

TỪ KHÓA LIÊN QUAN

w