Transcription of SIMATIC S7 S7-1200 Programmable controller
1 SIMATIC S7 S7-1200 Programmable controller _____Preface Product overview 1 Installation 2 PLC concepts 3 Device configuration 4 Programming concepts 5 Programming instructions 6 PROFINET 7 Point-to-Point (PtP) communications 8 Online and diagnostic tools 9 Technical specifications A Calculating a power budget B Order numbers C SIMATIC S7 S7-1200 Programmable controller System Manual 04/2009 A5E02486680-01 Legal information Legal information Warning notice system This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are graded according to the degree of danger. DANGER indicates that death or severe personal injury will result if proper precautions are not taken.
2 WARNING indicates that death or severe personal injury may result if proper precautions are not taken. CAUTION with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken. CAUTION without a safety alert symbol, indicates that property damage can result if proper precautions are not taken. NOTICE indicates that an unintended result or situation can occur if the corresponding information is not taken into account. If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property damage. Qualified Personnel The device/system may only be set up and used in conjunction with this documentation. Commissioning and operation of a device/system may only be performed by qualified personnel.
3 Within the context of the safety notes in this documentation qualified persons are defined as persons who are authorized to commission, ground and label devices, systems and circuits in accordance with established safety practices and standards. Proper use of Siemens products Note the following: WARNING Siemens products may only be used for the applications described in the catalog and in the relevant technical documentation. If products and components from other manufacturers are used, these must be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance are required to ensure that the products operate safely and without any problems. The permissible ambient conditions must be adhered to. The information in the relevant documentation must be observed. Trademarks All names identified by are registered trademarks of the Siemens AG.
4 The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owner. Disclaimer of Liability We have reviewed the contents of this publication to ensure consistency with the hardware and software described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this publication is reviewed regularly and any necessary corrections are included in subsequent editions. Siemens AG Industry Sector Postfach 48 48 90026 N RNBERG GERMANY Ordernumber: 6ES7 298 8FA30 8BH0 03/2009 Copyright Siemens AG 2009. Technical data subject to change S7-1200 Programmable controller System Manual, 04/2009, A5E02486680-01 3 Preface Purpose of the manual The S7-1200 series is a line of Programmable logic controllers (PLCs) that can control a variety of automation applications.
5 Compact design, low cost, and a powerful instruction set make the S7-1200 a perfect solution for controlling a wide variety of applications. The S7-1200 models and the Windows-based programming tool give you the flexibility you need to solve your automation problems. This manual provides information about installing and programming the S7-1200 PLCs and is designed for engineers, programmers, installers, and electricians who have a general knowledge of Programmable logic controllers. Required basic knowledge To understand this manual, it is necessary to have a general knowledge of automation and Programmable logic controllers. Scope of the manual This manual is valid for STEP 7 Basic and the S7-1200 product family. For a complete list of the S7-1200 products described in this manual, refer to the technical specifications (Page 283). Certification, CE label, C-Tick, and other standards Refer to the technical specifications (Page 283) for more information.
6 Service and support In addition to our documentation, we offer our technical expertise on the Internet at: Contact your Siemens distributor or sales office for assistance in answering any technical questions, for training, or for ordering S7 products. Because your sales representatives are technically trained and have the most specific knowledge about your operations, process and industry, as well as about the individual Siemens products that you are using, they can provide the fastest and most efficient answers to any problems you might encounter. Preface S7-1200 Programmable controller 4 System Manual, 04/2009, A5E02486680-01 S7-1200 Programmable controller System Manual, 04/2009, A5E02486680-01 5 Table of contents 3 1 Product 9 Introducing the S7-1200 Signal Signal modules ..11 Communication modules ..12 TIA Portal software.
7 12 Different views to make the work Help when you need it ..14 Display 2 Installation .. 19 Installation and removal Installing and removing the CPU ..24 Installing and removing a signal Installing and removing a communication Installing and removing a signal board ..28 Removing and reinstalling the S7-1200 terminal block Wiring 3 PLC concepts .. 35 Execution of the user Operating modes of the Event execution priorities and CPU Password protection for the S7-1200 Data storage, memory areas and Data Saving and restoring Understanding how the S7-1200 saves and restores Using the memory card as a "Program" card ..58 Using the memory card as a "Transfer" 4 Device configuration .. 63 Inserting a Configuring the operation of the Adding modules to the configuration.
8 66 Configuring the parameters of the Creating a network connection ..69 Configuring a permanent IP Table of contents S7-1200 Programmable controller 6 System Manual, 04/2009, A5E02486680-01 5 Programming 73 Guidelines for program 73 Structuring your user program .. 74 Using blocks to structure your program .. 75 Organization block (OB).. 76 Function (FC) .. 78 Function block (FB).. 78 Data block (DB).. 79 Selecting the programming language .. 80 Copy 82 Debugging and testing the 83 6 Programming 85 Basic instructions .. 85 Bit 85 Set and reset 87 Positive and negative edge 89 Timers .. 91 94 CTRL_HSC 97 99 Math .. 101 MOD instruction .. 102 108 Swap 112 113 Scale and normalize instructions .. 115 Program 116 Logical 118 Shift and Rotate.
9 122 Extended 124 Clock and calendar 124 String and character instructions .. 128 String conversion 128 String operation 137 Program control instructions .. 146 Reset scan cycle watchdog 146 Stop scan cycle 147 Get Error instructions .. 147 Communications 151 Open Ethernet 151 Point-to-Point 164 Interrupt 165 Attach and detach 165 Start and cancel time delay interrupt 168 Disable and Enable alarm interrupt instructions ..170 PID 171 Motion control instructions .. 171 Pulse 172 CTRL_PWM 172 Global library 175 175 Requirements for using the USS 175 Table of contents S7-1200 Programmable controller System Manual, 04/2009, A5E02486680-01 7 USS_DRV USS_PORT instruction ..179 USS_RPM instruction ..180 USS_WPM USS status codes.
10 183 MODBUS ..184 MB_SLAVE ..198 7 PROFINET .. 207 Communication with a programming Establishing the hardware communications Configuring the devices ..209 Assigning Internet Protocol (IP) addresses ..210 Assigning IP addresses to programming and network Assigning a temporary IP address online ..213 Configuring a permanent IP Testing the PROFINET network ..220 HMI-to-PLC Configuring the logical network connections between an HMI and a CPU ..223 PLC-to-PLC communication ..224 Configuring the logical network connections between two Configuring transmit (send) and receive Configuring the TSEND_C instruction transmit (send) Configuring the TRCV_C instruction receive Reference Information ..235 Locating the Ethernet (MAC) address on the Configuring Network Time Protocol 8 Point-to-Point (PtP) 239 Using the RS232 and RS485 communication Configuring the communication ports.