Download Siemens Memory Specifications
Transcript
Table of contents Table of contents Siemens AG 2014 All rights reserved Warranty and liability................................................................................................... 2 1 Preface ................................................................................................................ 5 2 S7-1200/1500 Innovations ................................................................................. 6 2.1 2.2 2.3 2.4 2.5 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7 2.8 2.8.1 2.8.2 2.8.3 2.9 2.9.1 2.9.2 2.9.3 2.10 2.11 2.12 2.13 3 Introduction ........................................................................................... 6 Terms ................................................................................................... 6 Programming languages ...................................................................... 8 Optimized machine code ...................................................................... 8 Block creation ....................................................................................... 9 Optimized blocks ................................................................................ 10 S7-1200: Setup of optimized blocks................................................... 10 S7-1500: Setup of optimized blocks................................................... 11 Best possible data storage in the processor on S7-1500 .................. 12 Conversion between optimized and non-optimized tags ................... 15 Communication with optimized data .................................................. 16 Block sizes ......................................................................................... 17 New data types for S7-1200/1500 ...................................................... 17 Elementary data types........................................................................ 17 Date_Time_Long data type ................................................................ 18 VARIANT data type ............................................................................ 18 Instructions ......................................................................................... 20 CALCULATE ...................................................................................... 20 MOVE instructions .............................................................................. 20 RUNTIME ........................................................................................... 21 Symbolic and comments .................................................................... 22 System constants ............................................................................... 23 Internal reference ID for controller and HMI tags ............................... 24 STOP mode in the event of errors ..................................................... 25 General Programming ..................................................................................... 27 3.1 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.3 3.3.1 3.3.2 3.4 3.4.1 3.4.2 3.4.3 3.4.4 3.5 3.6 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 Operating system and user program .................................................. 27 Program blocks .................................................................................. 27 Organization blocks (OB) ................................................................... 28 Functions (FC) .................................................................................... 30 Function blocks (FB) .......................................................................... 32 Instances ............................................................................................ 33 Multi-instances ................................................................................... 33 Global data blocks (DB) ..................................................................... 35 Downloading without reinitialization ................................................... 36 Reusability of blocks........................................................................... 39 Block interface types .......................................................................... 40 Call-by-value with In interface type .................................................... 40 Call-by-reference with InOut interface type ........................................ 41 Storage concept ................................................................................. 41 Block interfaces as data exchange .................................................... 41 Global memory ................................................................................... 42 Local memory ..................................................................................... 43 Access speed of memory areas ......................................................... 44 Retentivity ........................................................................................... 45 Symbolic addressing .......................................................................... 47 Symbolic instead of absolute addressing ........................................... 47 ARRAY data type and indirect field accesses .................................... 49 STRUCT data type and PLC data types ............................................ 51 Access to I/O areas with PLC data types ........................................... 52 Slice access ....................................................................................... 53 Programming Guideline for S7-1200/1500 Entry-ID: 81318674, V1.2, 03/2014 3