SIEMENS - simatic ladder logic (LAD) for S7-300 and S7-400 programming

pdf
Số trang SIEMENS - simatic ladder logic (LAD) for S7-300 and S7-400 programming 218 Cỡ tệp SIEMENS - simatic ladder logic (LAD) for S7-300 and S7-400 programming 1,008 KB Lượt tải SIEMENS - simatic ladder logic (LAD) for S7-300 and S7-400 programming 0 Lượt đọc SIEMENS - simatic ladder logic (LAD) for S7-300 and S7-400 programming 0
Đánh giá SIEMENS - simatic ladder logic (LAD) for S7-300 and S7-400 programming
4.8 ( 20 lượt)
Nhấn vào bên dưới để tải tài liệu
Đang xem trước 10 trên tổng 218 trang, để tải xuống xem đầy đủ hãy nhấn vào bên trên
Chủ đề liên quan

Nội dung

s Preface, Contents SIMATIC Ladder Logic (LAD) for S7-300 and S7-400 Programming Reference Manual This manual is part of the documentation package with the order number: 6ES7810-4CA07-8BW1 Edition 01/2004 A5E00261407-01 Bit Logic Instructions 1 Comparison Instructions 2 Conversion Instructions 3 Counter Instructions 4 Data Block Instructions 5 Logic Control Instructions 6 Integer Math Instructions 7 Floating Point Math Instructions 8 Move Instructions 9 Program Control Instructions 10 Shift and Rotate Instructions 11 Status Bit Instructions 12 Timer Instructions 13 Word Logic Instructions 14 Appendix Overview of All LAD Instructions A Programming Examples B Working with Ladder Logic C Index Safety Guidelines This manual contains notices intended to ensure personal safety, as well as to protect the products and connected equipment against damage. These notices are highlighted by the symbols shown below and graded according to severity by the following texts: ! Danger ! Warning ! Caution indicates that death, severe personal injury or substantial property damage will result if proper precautions are not taken. indicates that death, severe personal injury or substantial property damage can result if proper precautions are not taken. indicates that minor personal injury can result if proper precautions are not taken. Caution indicates that property damage can result if proper precautions are not taken. Notice draws your attention to particularly important information on the product, handling the product, or to a particular part of the documentation. Qualified Personnel Only qualified personnel should be allowed to install and work on this equipment. Qualified persons are defined as persons who are authorized to commission, to ground and to tag circuits, equipment, and systems in accordance with established safety practices and standards. Correct Usage Note the following: ! Warning This device and its components may only be used for the applications described in the catalog or the technical description, and only in connection with devices or components from other manufacturers which have been approved or recommended by Siemens. This product can only function correctly and safely if it is transported, stored, set up, and installed correctly, and operated and maintained as recommended. Trademarks SIMATIC®, SIMATIC HMI® and SIMATIC NET® are registered trademarks of SIEMENS AG. Third parties using for their own purposes any other names in this document which refer to trademarks might infringe upon the rights of the trademark owners. Copyright © Siemens AG 2004 All rights reserved Disclaimer of Liability The reproduction, transmission or use of this document or its contents is not permitted without express written authority. Offenders will be liable for damages. All rights, including rights created by patent grant or registration of a utility model or design, are reserved. We have checked the contents of this manual for agreement with the hardware and software described. Since deviations cannot be precluded entirely, we cannot guarantee full agreement. However, the data in this manual are reviewed regularly and any necessary corrections included in subsequent editions. Suggestions for improvement are welcomed. Siemens AG Bereich Automation and Drives Geschaeftsgebiet Industrial Automation Systems Postfach 4848, D- 90327 Nuernberg ©Siemens AG 2004 Technical data subject to change. Siemens Aktiengesellschaft A5E00261407-01 Preface Purpose This manual is your guide to creating user programs in the Ladder Logic (LAD) programming language. This manual also includes a reference section that describes the syntax and functions of the language elements of Ladder Logic. Basic Knowledge Required The manual is intended for S7 programmers, operators, and maintenance/service personnel. In order to understand this manual, general knowledge of automation technology is required. In addition to, computer literacy and the knowledge of other working equipment similar to the PC (e.g. programming devices) under the operating systems MS Windows 2000 Professional or MS Windows XP Professional are required. Scope of the Manual This manual is valid for release 5.3 of the STEP 7 programming software package. Compliance with IEC 1131-3 LAD corresponds to the “Ladder Logic” language defined in the International Electrotechnical Commission's standard IEC 1131-3. For further details, refer to the table of standards in the STEP 7 file NORM_TBL.WRI. Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01 iii Preface Requirements To use this Ladder Logic manual effectively, you should already be familiar with the theory behind S7 programs which is documented in the online help for STEP 7. The language packages also use the STEP 7 standard software, so you should be familiar with handling this software and have read the accompanying documentation. This manual is part of the documentation package "STEP 7 Reference". The following table displays an overview of the STEP 7 documentation: Documentation Purpose STEP 7 Basic Information with Basic information for technical 6ES7810-4CA07-8BW0 personnel describing the methods of implementing control tasks with STEP 7 and the S7-300/400 programmable controllers. • Working with STEP 7 V5.3, Getting Started Manual • Programming with STEP 7 V5.3 • Configuring Hardware and Communication Connections, STEP 7 V5.3 • From S5 to S7, Converter Manual STEP 7 Reference with • Ladder Logic (LAD) / Function Block Diagram (FDB) / Statement List (STL) for S7-300/400 manuals • Standard and System Function for S7-300/400 Order Number Provides reference information 6ES7810-4CA07-8BW1 and describes the programming languages LAD, FBD and STL, and standard and system function extending the scope of the STEP 7 basic information. Online Helps Purpose Help on STEP 7 Basic information on Part of the STEP 7 programming and configuring Standard software. hardware with STEP 7 in the form of an online help. Reference helps on AWL/KOP/FUP Reference help on SFBs/SFCs Reference help on Organization Blocks Context-sensitive reference information. iv Order Number Part of the STEP 7 Standard software. Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01 Preface Online Help The manual is complemented by an online help which is integrated in the software. This online help is intended to provide you with detailed support when using the software. The help system is integrated in the software via a number of interfaces: • The context-sensitive help offers information on the current context, for example, an open dialog box or an active window. You can open the contextsensitive help via the menu command Help > Context-Sensitive Help, by pressing F1 or by using the question mark symbol in the toolbar. • You can call the general Help on STEP 7 using the menu command Help > Contents or the "Help on STEP 7" button in the context-sensitive help window. • You can call the glossary for all STEP 7 applications via the "Glossary" button. This manual is an extract from the "Help on Ladder Logic". As the manual and the online help share an identical structure, it is easy to switch between the manual and the online help. Further Support If you have any technical questions, please get in touch with your Siemens representative or agent responsible. You will find your contact person at: http://www.siemens.com/automation/partner Training Centers Siemens offers a number of training courses to familiarize you with the SIMATIC S7 automation system. Please contact your regional training center or our central training center in D 90327 Nuremberg, Germany for details: Telephone: +49 (911) 895-3200. Internet: http://www.sitrain.com Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01 v Preface A&D Technical Support Worldwide, available 24 hours a day: Nure nbe rg Be ijing Pe king Jo hns o n City Worldwide (Nuernberg) Technical Support 24 hours a day, 365 days a year Phone: +49 (180) 5050-222 Fax: +49 (180) 5050-223 E-Mail: adsupport@ siemens.com GMT: +1:00 Europe / Africa (Nuernberg) United States (Johnson City) Asia / Australia (Beijing) Authorization Technical Support and Authorization Technical Support and Authorization Local time: Mon.-Fri. 8:00 to 5:00 PM Local time: Mon.-Fri. 8:00 to 5:00 PM Local time: Mon.-Fri. 8:00 to 5:00 PM Phone: +49 (180) 5050-222 Phone: +1 (423) 262 2522 Phone: +86 10 64 75 75 75 Fax: +49 (180) 5050-223 Fax: +1 (423) 262 2289 Fax: +86 10 64 74 74 74 E-Mail: adsupport@ siemens.com E-Mail: simatic.hotline@ E-Mail: adsupport.asia@ GMT: +1:00 GMT: -5:00 GMT: +8:00 sea.siemens.com siemens.com The languages of the SIMATIC Hotlines and the authorization hotline are generally German and English. vi Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01 Preface Service & Support on the Internet In addition to our documentation, we offer our Know-how online on the internet at: http://www.siemens.com/automation/service&support where you will find the following: • The newsletter, which constantly provides you with up-to-date information on your products. • The right documents via our Search function in Service & Support. • A forum, where users and experts from all over the world exchange their experiences. • Your local representative for Automation & Drives. • Information on field service, repairs, spare parts and more under "Services". Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01 vii Preface viii Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01 Contents 1 Bit Logic Instructions 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 1.10 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.18 2 3 Overview of Bit Logic Instructions .....................................................................1-1 ---| |--- Normally Open Contact (Address) ......................................................1-2 ---| / |--- Normally Closed Contact (Address) ...................................................1-3 XOR Bit Exclusive OR......................................................................................1-4 --|NOT|-- Invert Power Flow ..............................................................................1-5 ---( ) Output Coil .............................................................................................1-6 ---( # )--- Midline Output ...................................................................................1-8 ---( R ) Reset Coil .............................................................................................1-9 ---( S ) Set Coil ...............................................................................................1-11 RS Reset-Set Flip Flop ..................................................................................1-12 SR Set-Reset Flip Flop ..................................................................................1-14 ---( N )--- Negative RLO Edge Detection........................................................1-16 ---( P )--- Positive RLO Edge Detection .........................................................1-17 ---(SAVE) Save RLO into BR Memory ...........................................................1-18 NEG Address Negative Edge Detection ........................................................1-19 POS Address Positive Edge Detection ..........................................................1-20 Immediate Read ..............................................................................................1-21 Immediate Write ..............................................................................................1-23 Comparison Instructions 2.1 2.2 2.3 2.4 2-1 Overview of Comparison Instructions ...............................................................2-1 CMP ? I Compare Integer ................................................................................2-2 CMP ? D Compare Double Integer ..................................................................2-3 CMP ? R Compare Real ..................................................................................2-4 Conversion Instructions 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 1-1 3-1 Overview of Conversion Instructions ................................................................3-1 BCD_I BCD to Integer......................................................................................3-2 I_BCD Integer to BCD......................................................................................3-3 I_DINT Integer to Double Integer .....................................................................3-4 BCD_DI BCD to Double Integer.......................................................................3-5 DI_BCD Double Integer to BCD.......................................................................3-6 DI_REAL Double Integer to Floating-Point ......................................................3-7 INV_I Ones Complement Integer .....................................................................3-8 INV_DI Ones Complement Double Integer......................................................3-9 NEG_I Twos Complement Integer .................................................................3-10 NEG_DI Twos Complement Double Integer ..................................................3-11 NEG_R Negate Floating-Point Number .........................................................3-12 ROUND Round to Double Integer..................................................................3-13 TRUNC Truncate Double Integer Part ...........................................................3-14 CEIL Ceiling ...................................................................................................3-15 FLOOR Floor..................................................................................................3-16 Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01 ix Contents 4 Counter Instructions 4.1 4.2 4.3 4.4 4.5 4.6 4.7 5 6 8 x 7-1 Overview of Integer Math Instructions ..............................................................7-1 Evaluating the Bits of the Status Word with Integer Math Instructions .............7-2 ADD_I Add Integer ...........................................................................................7-3 SUB_I Subtract Integer ....................................................................................7-4 MUL_I Multiply Integer .....................................................................................7-5 DIV_I Divide Integer .........................................................................................7-6 ADD_DI Add Double Integer ............................................................................7-7 SUB_DI Subtract Double Integer .....................................................................7-8 MUL_DI Multiply Double Integer ......................................................................7-9 DIV_DI Divide Double Integer ........................................................................7-10 MOD_DI Return Fraction Double Integer.......................................................7-11 Floating Point Math Instructions 8.1 8.2 8.3 8.3.1 8.3.2 8.3.3 8.3.4 8.3.5 8.4 8.4.1 8.4.2 8.4.3 8.4.4 8.4.5 8.4.6 8.4.7 8.4.8 8.4.9 8.4.10 6-1 Overview of Logic Control Instructions .............................................................6-1 ---(JMP)--- Unconditional Jump........................................................................6-2 ---(JMP)--- Conditional Jump............................................................................6-3 ---( JMPN ) Jump-If-Not....................................................................................6-4 LABEL Label ....................................................................................................6-5 Integer Math Instructions 7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11 5-1 ---(OPN) Open Data Block: DB or DI ...............................................................5-1 Logic Control Instructions 6.1 6.2 6.3 6.4 6.5 7 Overview of Counter Instructions ......................................................................4-1 S_CUD Up-Down Counter ...............................................................................4-3 S_CU Up Counter ............................................................................................4-5 S_CD Down Counter........................................................................................4-7 ---( SC ) Set Counter Value..............................................................................4-9 ---( CU ) Up Counter Coil ...............................................................................4-10 ---( CD ) Down Counter Coil...........................................................................4-12 Data Block Instructions 5.1 4-1 8-1 Overview of Floating-Point Math Instruction .....................................................8-1 Evaluating the Bits of the Status Word with Floating-Point Math Instructions ..8-2 Basic Instructions ..............................................................................................8-3 ADD_R Add Real .............................................................................................8-3 SUB_R Subtract Real ......................................................................................8-4 MUL_R Multiply Real .......................................................................................8-5 DIV_R Divide Real ...........................................................................................8-6 ABS Establish the Absolute Value of a Floating-Point Number.......................8-7 Extended Instructions........................................................................................8-8 SQR Establish the Square ...............................................................................8-8 SQRT Establish the Square Root ....................................................................8-9 EXP Establish the Exponential Value ............................................................8-10 LN Establish the Natural Logarithm ...............................................................8-11 SIN Establish the Sine Value .........................................................................8-12 COS Establish the Cosine Value ...................................................................8-13 TAN Establish the Tangent Value ..................................................................8-14 ASIN Establish the Arc Sine Value ................................................................8-15 ACOS Establish the Arc Cosine Value ..........................................................8-16 ATAN Establish the Arc Tangent Value .........................................................8-17 Ladder Logic (LAD) for S7-300 and S7-400 Programming A5E00261407-01
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.