Documents

201962065-TIA-Portal-S7-1200-1500-Programming-Guideline.pdf

Categories
Published
of 69
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Share
Description
Applications & Tools Answers for industry. Programming Guideline for S7-1200/S7-1500 STEP 7 (TIA Portal) Background and system description October 2013 Warranty and Liability Programming Guideline for S7-1200/1500 V1.1, Entry ID: 81318674 2 C o p y r i g h t S i e m e n s A G 2 0 1 3 A l l r i g h t s r e s e r v e d Warranty and Liability Note The Application Examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The application
Transcript
   Applications & Tools  Answers for industry. Programming Guideline forS7-1200/S7-1500 STEP 7 (TIA Portal)Background and system description   October 2013  Warranty and Liability Programming Guideline for S7-1200/1500V1.1, Entry ID: 81318674 2      C    o    p    y    r     i    g     h     t            S     i    e    m    e    n    s     A     G     2     0     1     3     A     l     l    r     i    g     h     t    s    r    e    s    e    r    v    e     d Warranty and Liability Note The Application Examples are not binding and do not claim to be completeregarding the circuits shown, equipping and any eventuality. The applicationexamples do not represent customer-specific solutions. You are responsible for ensuring that the described products are used correctly. These ApplicationExamples do not relieve you of your responsibility to use safe practices inapplication, installation, operation and maintenance. When using theseapplication examples, you recognize that we cannot be made liable for anydamage/claims beyond the liability clause described. We reserve the right tomake changes to these Application Examples at any time and without prior notice. If there are any deviations between the recommendations provided in thisapplication example and other Siemens publications – e.g. catalogs – thecontents of the other documents have priority.We do not accept any liability for the information contained in this document. Any claims against us – based on whatever legal reason – resulting from the use of the examples, information, programs, engineering and performance data etc.,described in this application example will be excluded. Such an exclusion will notapply in the case of mandatory liability, e.g. under the German Product Liability Act(“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, bodyor health, guarantee for the quality of a product, fraudulent concealment of adeficiency or breach of a condition which goes to the root of the contract(“wesentliche Vertragspflichten”). The damages for a breach of a substantialcontractual obligation are, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury tolife, body or health. The above provisions do not imply a change of the burden of proof to your detriment. Any form of duplication or distribution of these application examples or excerptshereof is prohibited without the expressed consent of Siemens Industry Sector. Caution The functions and solutions described in this entry are mainly limited to therealization of the automation task. Please furthermore take into account thatcorresponding protective measures have to be taken in the context of industrialsecurity when connecting your equipment to other parts of the plant, the enterprisenetwork or the Internet. Further information can be found under the Entry ID50203404.http://support.automation.siemens.com/WW/view/en/50203404 Siemens Industry Online Support This document is an article from the Siemens Industry Online Support. Thefollowing link takes you directly to the download page of this document:http://support.automation.siemens.com/WW/view/en/81318674  Table of Contents Programming Guideline for S7-1200/1500V1.1, Entry ID: 81318674 3      C    o    p    y    r     i    g     h     t            S     i    e    m    e    n    s     A     G     2     0     1     3     A     l     l    r     i    g     h     t    s    r    e    s    e    r    v    e     d Table of Contents Warranty and Liability ................................................................................................. 21Preface ................................................................................................................ 52S7-1200/1500 Innovations ................................................................................. 6 2.1Introduction ........................................................................................... 62.2Programming languages ...................................................................... 72.3Optimized machine code ...................................................................... 82.4Block creation ....................................................................................... 82.5Optimized blocks .................................................................................. 92.5.1S7-1200: Setup of optimized blocks ................................................... 102.5.2S7-1500: Setup of optimized blocks ................................................... 102.5.3Best possible data storage in the processor on S7-1500 .................. 112.6Block sizes ......................................................................................... 142.7New data types for S7-1200/1500 ...................................................... 152.7.1Elementary data types ........................................................................ 152.7.2Date_Time_Long data type ................................................................ 152.7.3VARIANT data type ............................................................................ 162.8New CALCULATE instruction ............................................................ 172.9Symbolic and comments .................................................................... 172.10System constants ............................................................................... 192.11Internal reference ID for controller and HMI tags ............................... 202.12STOP mode in the event of errors ..................................................... 21 3General Programming ..................................................................................... 23 3.1Operating system and user program .................................................. 233.2Program blocks .................................................................................. 233.2.1Organization blocks (OB) ................................................................... 243.2.2Functions (FC) .................................................................................... 263.2.3Function blocks (FB) .......................................................................... 283.2.4Instance data block ............................................................................ 283.2.5Multi-instances ................................................................................... 293.2.6Global data blocks (DB) ..................................................................... 313.2.7Downloading without reinitialization ................................................... 323.2.8Reusability of blocks ........................................................................... 353.3Block interface types .......................................................................... 363.3.1Call-by-value with In interface type .................................................... 363.3.2Call-by-reference with InOut interface type ........................................ 373.4Storage concept ................................................................................. 373.4.1Block interfaces as data exchange .................................................... 373.4.2Global memory ................................................................................... 383.4.3Local memory ..................................................................................... 393.4.4Access speed of memory areas ......................................................... 403.5Retentivity ........................................................................................... 413.6Symbolic addressing .......................................................................... 423.6.1Symbolic instead of absolute addressing ........................................... 423.6.2ARRAY data type and indirect field accesses .................................... 443.6.3STRUCT data type and PLC data types ............................................ 463.6.4Slice access ....................................................................................... 473.7Libraries .............................................................................................. 483.7.1Types of libraries and library elements .............................................. 483.7.2Type concept ...................................................................................... 503.7.3Differences for typifiable objects for controller and HMI .................... 503.7.4Versioning of a block .......................................................................... 513.8Process interrupts .............................................................................. 563.9Other performance recommendations ............................................... 58  Table of Contents Programming Guideline for S7-1200/1500V1.1, Entry ID: 81318674 4      C    o    p    y    r     i    g     h     t            S     i    e    m    e    n    s     A     G     2     0     1     3     A     l     l    r     i    g     h     t    s    r    e    s    e    r    v    e     d 3.10SCL programming language: Tips and tricks ..................................... 593.10.1Using call templates ........................................................................... 593.10.2What instruction parameters are mandatory? .................................... 603.10.3Drag & drop with entire tag names ..................................................... 603.10.4Efficiently inserting CASE instruction ................................................. 613.10.5No manipulation of loop counters for FOR loop ................................. 613.10.6FOR loop backwards .......................................................................... 623.10.7Simple creating of instances for calls ................................................. 623.10.8Handling of time tags .......................................................................... 62 4Hardware-Independent Programming ........................................................... 64 4.1Data types of S7-300/400 and S7-1200/1500 .................................... 644.2No bit memory but global data blocks ................................................ 654.3Programming of clock bits ............................................................... 66 5The Most Important Recommendations ........................................................ 686Related Literature ............................................................................................ 697History............................................................................................................... 69
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks