intTypePromotion=1
zunia.vn Tuyển sinh 2024 dành cho Gen-Z zunia.vn zunia.vn
ADSENSE

Simatic S7 - 200 tips

Chia sẻ: Do Huy Son | Ngày: | Loại File: DOC | Số trang:19

132
lượt xem
27
download
 
  Download Vui lòng tải xuống để xem tài liệu đầy đủ

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.

Chủ đề:
Lưu

Nội dung Text: Simatic S7 - 200 tips

  1. S7-200 Tip PT100 Tip No. 36 S IMATIC S7-200 Tips 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.
  2. S7-200 Tip PT100 Tip No. 36 0V +24V PT100 M L+ C+ C- Io L+ M C PU 214 EM 235 TD 200 T E M P E R A T U R E = 2 3 .6 ° C F5 F6 F7 F8 F1 F2 F3 F4 S H IF T ESC E NTER 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.
  3. S7-200 Tip PT100 Tip No. 36 Program Structure Program Start Initialization: delete operands, load 1 °C-value, load 0 °C-Offset, specify monitoring limits. Write value from output current to AQW0. 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 No Temperatur > high limit? Yes Reset enable bit for Message Nr. 2 Set enable bit for Message Nr. 2; switch off furnace No Temperatur < low limit ? Yes Reset enable bit for Message Nr. 3 Set enable bit for Message Nr. 3< switch on furnace Figure 36.2 END 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.
  4. 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 0 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 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 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.
  5. S7-200 Tip PT100 Tip No. 36 I0 PT100 ANALOG RA A+ A- RB B+ B- RC C+ C- V0 I0 L+ M I In-Out-PB EM 235 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.
  6. 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 I0 Copyright ©1997 by SIEMENS page 6 / 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.
  7. 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 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.
  8. 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 ├───────┤
  9. 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 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.
  10. 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 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.
  11. S7-200 Tip PT100 Tip No. 36 Tham khảo Chương trình ví dụ này bàn luận một vài điều sau: Đo nhiệt đ ộ và hiển thị nhi ệt đ ộ chỉ định bằng cách dùng khối mở rộng EM235, trong đó có một kênh khối analog, có c ảm bi ến nhiệt độ là PT 100 được nối vào khối. Chuyển đổi nhiệt độ được qui định thông qua điện trở của PT100 sang điện áp, đầu ra analog được sử dụng là nguồn dòng. Nguồn đầu ra cấp cho cảm biến PT100 với dòng cố đ ịnh là 12,5 mA. Với mạch này, một điện áp tuyến tính đầu vào 5mV/ o C sẽ được sinh ra. Khối EM235 chuyển đổi điện áp này sang giá trị số mà chương trình sẽ cập nhật liên tục. Từ giá tr ị đọc được này, chương trình sẽ tính ra nhiệt độ bằng công thức: T[°C] = Digital Value - 0°C-Offset 1°C-Value Digital Value là giá trị được chứa trong AIWx (x = 0,2,4) 0oC – Offset là giá trị số đo được ở 0 oC, trong trường hợp này là 4000 1oC – Value là giá trị thay đổi khi nhiệt độ tăng được 1oC. Trong ví dụ này là 16 Chương trình sẽ tính giá trị đến 1 số sau dấu phẩy thập phân và hiển thị kết quả “Nhiệt đ ộ = xxx.xoC” ra màn hình TD 200. Trong phần khởi tạo của chương trình, người dùng có thể nhập vào giá trị giới hạn nhiệt độ cao và thấp. Chương trình sẽ hiển thị giá trị nhiệt độ đo đ ược và đưa ra cảnh báo nếu giá trị đó vượt ra ngoài khoảng giới hạn thông qua màn hình TD 200. Thông báo “Nhiệt độ > xxx.x oC” sẽ xuất hiện ở dòng thứ 2 của màn hình nếu nhiệt độ lớn hơn nhiệt độ giới hạn trên. Và thông báo “Nhiệt độ < xxx.x oC” sẽ được hiện ra nếu nhiệt độ đo được giảm xuống dưới mức giới hạn nhiệt độ thấp. Sơ đồ đấu nối thiết bị được cho dưới đây: Copyright ©1997 by SIEMENS page 11 / 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.
  12. S7-200 Tip PT100 Tip No. 36 0V +24V PT100 M L+ C+ C- Io L+ M C PU 214 EM 235 TD 200 T E M P E R A T U R E = 2 3 .6 ° C F5 F6 F7 F8 F1 F2 F3 F4 S H IF T ESC E NTER Lưu đồ thuật toán chương trình được cho dưới đây: Copyright ©1997 by SIEMENS page 12 / 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.
  13. 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 1oC và tại 0oC, chỉ định giá trị giới hạn, ghi giá trị dòng điện ra AQW0 Chuyển giá trị đo được về nhiệt độ trong AIWx Thực hiện tính toán nhiệt độ: giá trị đo được trừ đi giá trị đo được tại 0oC, chia cho độ chênh tương ứng với 1oC Chia phần dư nhân 10 cho độ chênh tương ứng 1oC sau đó cộng vào giá trị đã tính được. Ghi vào vùng nhớ cập nhật ra thông báo 1 TD200 Hiển thị thông báo 1 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; 2 Tắt lò Sai Nhiệt độ
  14. S7-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ừ -60 đến 400 oC. Tính toán nguồn cấp cho PT100 PT100 có giá trị điện trở là 100 Ω ở nhiệt độ là 0oC. Điện trở này thay đổi tuyến tính với nhiệt độ với tỷ lệ xấp xỉ 0,4 Ω/ oC R [O h m ] 110 108 106 104 102 T [°C ] 100 0 10 20 Để sinh ra một điện áp 5 mV/ oC, một nguồn dòng 12,5 mA được cấp cho PT 100. Độ phân giải ở đầu ra analog là 10uA/ 1 đơn vị. Vì thế, giá trị để tạo ra dòng 12,5 mA là 1250. Do vùng nhớ cho đầu ra analog AQW là 16 bít. Do vậy, phải nạp ra vùng nhớ này giá trị là 20000 để 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 = 20000) I0 PT100 ANALOG RA A+ A- RB B+ B- RC C+ C- V0 I0 L+ M I In-Out-PB 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 page 14 / 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.
  15. S7-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 trong module EM235, địa chỉ tương ứng của các vùng nhớ đầu vào sẽ là AIW0 – kênh vào 1 AIW2 – kênh vào 2 AIW4 – kênh vào 3 AQW0 – kênh ra 1 Những đầu vào không dùng của EM235 phải được nối ngắn mạch. Main Program Copyright ©1997 by SIEMENS page 15 / 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.
  16. S7-200 Tip PT100 Tip No. 36 // Đo nhiệt độ và hiển thị lên màn hình TD 200 │ 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 │ │ │ │ └───────┘ // Vòng quét đầu tiên LD SM0.1 MOVD 0, VD196 // xóa VW196 và VW198 // lấy giá trị độ chênh 1°C = 16 đưa vào VW250 MOVW 16, VW250 // lấy giá trị tại 0°C = 4000 đưa vào VW252 MOVW 4000, VW252 // Giới hạn nhiệt độ cao 30°C MOVW 300, VW260 // Giới hạn nhiệt độ thấp 20°C MOVW 200, VW262 // Tạo dòng Io MOVW 20000, AQW0 │ SM0.0 SUB_I───┐ 2 ├─┤ ├───────────────────────────┬────────────┤EN │ │ │ │ │ │ │ AIW4┤IN1 OUT├VW200 │ │ VW252┤IN2 │ │ │ └───────┘ │ │ DIV─────┐ │ ├────────────┤EN │ │ │ │ │ │ │ VW200┤IN1 OUT├VD198 │ │ VW250┤IN2 │ │ │ └───────┘ │ │ MUL─────┐ Copyright ©1997 by SIEMENS page 16 / 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.
  17. S7-200 Tip PT100 Tip No. 36 │ ├────────────┤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 17 / 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.
  18. S7-200 Tip PT100 Tip No. 36 // Luôn luôn cập nhật giá trị đo được LD SM0.0 // Chuyển giá trị đo được vào VW200 MOVW AIW4, VW200 // Trừ đi giá trị đo được tại 0oC -I VW252, VW200 // Chia cho độ chênh tương ứng 1oC DIV VW250, VD198 // Phần dư x 10 MUL 10, VD196 // 10 x Phần dư / 30 = 1 số sau dấu phẩy DIV VW250, VD196 // lưu lại số sau dấu phẩy MOVW VW198, VW160 MOVW 0, VW198 // xóa VW198 // Giá trị nhiệt độ x10 MUL 10, VD198 // Giá trị nhiệt độ X10 + 1 số sau dấu phẩy +I VW160, VW200 // chuyển kết quả ra VW116 để hiển thị trên TD200 MOVW VW200, VW116 // Bật thông báo 1 S V12.7, 1 │ │ VW200 VW260 V12.6 3 ├───────┤ >= W ├───────────┬────────────( ) │ │ │ │ Q0.0 K1 │ ├────────────( R ) │ │ │ │ MOV_W───┐ │ └────────────┤EN │ │ │ │ │ VW260┤IN OUT├VW136 │ │ │ │ └───────┘ // Nếu vượt quá giới hạn nhiệt độ cao LDW>= VW200, VW260 // Hiện thông báo 2 = V12.6 // Tắt lò R Q0.0, 1 // Chuyển giá trị giới hạn nhiệt độ cao ra VW136 để hiện lên TD 200 MOVW VW260, VW136 │ VW200 VW262 V12.5 4 ├───────┤
  19. S7-200 Tip PT100 Tip No. 36 │ 5 ├───────────────────────────────────────( MEND ) // Kết thúc chương trình MEND Data Block DB1 (V Memory): Đây là khối thông số cho TD 200 điều khiển việc đọc, hiển thị thông báo với giá trị được cập nhất của nhiệt độ đo và cảnh báo với giá trị giới hạn nếu có. // Bắt đầu khối TD200_BLOCK 0 // (Những chú thích trong đoạn ch ương trình này không nên b ỏ đi ) // TD 200 chỉ định VB0 'TD' // Chọn ngôn ngữ là tiếng Anh, cập nh ật nhanh nh ất có th ể VB2 16#10 // Chọn chế độ hiển thị 20 ký t ự, phím tăng là V3.2, phím gi ảm là V3.3 VB3 16#00 // Số lượng thông báo VB4 3 // Các phím chức năng từ M0.0 đến M0.7 VB5 0 // Địa chỉ bắt đầu của thông báo là VW100 VW6 100 // Byte cho phép hiển thị các thông báo là VW12 VW8 12 // MESSAGE 1 // Bit cho phép hiển thị là V12.7 VB100 'Temperature = ' // Không thay đổi; Không xác nh ận; Không m ật kh ẩu; VB114 16#00 VB115 16#31 // Unsigned Word; 1 Digits to the right of the decimal; // Chuyển dữ liệu vào vùng nh ớ này để hi ển th ị nhi ệt đ ộ hi ện t ại VW116 16#00 VB118 'ßC' // MESSAGE 2 // Message Enable Bit V12.6 VB120 'Temperature > ' // Không sửa đổi, xác nh ận và m ật khẩu VB134 16#00 // O nhớ dạng số thực không d ấu, 1 ch ữ s ố sau d ấu ph ẩy VB135 16#31 // Chuyển dữ liệu về nhi ệt độ gi ới hạn m ức cao vào đây đ ể hi ển th ị VW136 16#00 VB138 'ßC' // MESSAGE 3 // Message Enable Bit V12.5 VB140 'Temperature < ' // Không sửa đổi, xác nh ận và m ật khẩu VB154 16#00 // O nhớ dạng số thực không d ấu, 1 ch ữ s ố sau d ấu ph ẩy VB155 16#31 // Chuyển nhiệt độ giới hạn về m ức th ấp vào đây đ ể hi ển th ị VW156 16#00 VB158 'ßC' // Kết thúc TD200_BLOCK 0 Copyright ©1997 by SIEMENS page 19 / 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.
ADSENSE

CÓ THỂ BẠN MUỐN DOWNLOAD

 

Đồng bộ tài khoản
2=>2