Top Banner
Preface, Contents Product Overview 1 Getting Started 2 Installing the S7-200 3 PLC Concepts 4 Programming Concepts, Conventions and Features 5 S7-200 Instruction Set 6 Communicating over a Network 7 Hardware Troubleshooting Guide and Software Debugging Tools 8 Creating a Program for the Position Module 9 Creating a Program for the Modem Module 10 Using the USS Protocol Library to Control a MicroMaster Drive 11 Using the Modbus Protocol Library 12 Technical Specifications A Calculating a Power Budget B Error Codes C Special Memory (SM) Bits D S7-200 Order Numbers E Execution Times for STL Instructions F S7-200 Quick Reference Information G Index S7-200 Programmable Controller System Manual SIMATIC Edition 05/2003 A5E00212536-02 This manual has the order number: 6ES7298-8FA23-8BH0
10

help S7-200

Apr 29, 2023

Download

Documents

Khang Minh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: help S7-200

Preface, Contents

Product Overview 1

Getting Started 2

Installing the S7-200 3

PLC Concepts 4

Programming Concepts,Conventions and Features

5

S7-200 Instruction Set 6

Communicating over a Network 7

Hardware Troubleshooting Guideand Software Debugging Tools

8

Creating a Program for thePosition Module

9

Creating a Program for theModem Module

10

Using the USS Protocol Library toControl a MicroMaster Drive

11

Using the Modbus ProtocolLibrary

12

Technical Specifications A

Calculating a Power Budget B

Error Codes C

Special Memory (SM) Bits D

S7-200 Order Numbers E

Execution Times for STLInstructions

F

S7-200 Quick ReferenceInformation

G

Index

S7-200 Programmable ControllerSystem Manual

SIMATIC

Edition 05/2003A5E00212536-02

This manual has the order number:6ES7298-8FA23-8BH0

Page 2: help S7-200

Contents

ii

Safety Guidelines

This manual contains notices which you should observe to ensure your own personal safety, as well as toprotect the product and connected equipment. These notices are highlighted in the manual by a warningtriangle and are marked as follows according to the level of danger:

Danger

Danger indicates an imminently hazardous situation which, if not avoided, will result in death or seriousinjury.

Warning

Warning indicates a potentially hazardous situation which, if not avoided, could result in death or seriousinjury.

Caution

Caution used with the safety alert symbol indicates a potentially hazardous situation which, if notavoided, may result in minor or moderate injury.

Caution

Caution used without the safety alert symbol indicates a potentially hazardous situation which, if notavoided, may result in property damage.

Notice

Notice indicates a potential situation which, if not avoided, may result in an undesirable result or state.

Qualified Personnel

Only qualified personnel should be allowed to install and work on this equipment. Qualified persons aredefined as persons who are authorized to commission, to ground, and to tag circuits, equipment, and sys-tems 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 thetechnical descriptions, and only in connection with devices or components from other manufacturerswhich have been approved or recommended by Siemens.

This product can only function correctly and safely if it is transported, stored, set up, and installedcorrectly, and operated and maintained as recommended.

Trademarks

SIMATICR, SIMATIC HMIR and SIMATIC NETR are registered trademarks of SIEMENS AG.

Some of other designations used in these documents are also registered trademarks; the owner’s rights may be violatedif they are used by third parties for their own purposes.

We have checked the contents of this manual for agreement with the hardware andsoftware described. Since deviations cannot be precluded entirely, we cannot gua-rantee full agreement. However, the data in thismanual are reviewed regularly andany necessary corrections included in subsequent editions. Suggestions for impro-vement are welcomed.

Disclaimer of LiabilityCopyright Siemens AG 2003 All rights reserved

The reproduction, transmission or use of this document or its contents is notpermitted without express written authority. Offenders will be liable for damages.All rights, including rights created by patent grant or registration of a utility modelor design, are reserved.

Siemens AGBereich Automation and DrivesGeschaeftsgebiet Industrial Automation SystemsPostfach 4848, D- 90327 Nuernberg

E Siemens AG 2003Technical data subject to change.

Siemens Aktiengesellschaft 6ES7298-8FA23-8BH0

Page 3: help S7-200

iii

PrefaceThe S7-200 series is a line of micro-programmable logic controllers (Micro PLCs) that can control avariety of automation applications. Compact design, low cost, and a powerful instruction set make theS7-200 a perfect solution for controlling small applications. The wide variety of S7-200 models and theWindows-based programming tool give you the flexibility you need to solve your automation problems.

Audience

This manual provides information about installing and programming the S7-200 Micro PLCs and isdesigned for engineers, programmers, installers, and electricians who have a general knowledge ofprogrammable logic controllers.

Scope of the Manual

The information contained in this manual pertains in particular to the following products:

- S7-200 CPU models: CPU 221, CPU 222, CPU 224, CPU 226, and CPU 226XM

- S7-200 EM 22x expansion modules

- STEP 7--Micro/WIN, version 3.2, a 32-bit programming software package for the S7-200

- STEP 7--Micro/WIN Instruction Libraries and TP-Designer for TP070, Version 1.0, a set ofsoftware tools for customers who use an S7-200 with other components, such as the TP070Touch Panel, Modbus, or a MicroMaster drive

Standards Compliance

The SIMATIC S7-200 series meets the following standards:

- European Community (CE) Low Voltage Directive 73/23/EECEN 61131--2: Programmable Controllers -- Equipment requirements

- European Community (CE) EMC Directive 89/336/EEC

Electromagnetic emissions standardEN 61000--6--3: residential, commercial, and light industryEN 61000--6--4: industrial environment

Electromagnetic immunity standardsEN 61000--6--2: industrial environment

- Underwriters Laboratories, Inc.UL 508 Listed (Industrial Control Equipment) Registration number E75310

- Canadian Standards Association: CSA C22.2 Number 142 (Process Control Equipment)

- Factory Mutual Research: FM Class I, Division 2, Groups A, B, C, & D Hazardous Locations, T4Aand Class I, Zone 2, IIC, T4

Refer to Appendix A for compliance information.

Tip

The SIMATIC S7-200 series meets the CSA standard.

The cULus logo indicates that the S7-200 has been examined and certified by UnderwritersLaboratories (UL) to standards UL 508 and CSA 22.2 No. 142.

Page 4: help S7-200

Contents

iv

Maritime Approvals

The S7-200 products are periodically submitted for special agency approvals related to specific marketsand applications. This table identifies the agency and certificate number that the S7-200 products havebeen approved for. Not all S7-200 products in this manual have been approved for these special agencyapprovals. Consult your local Siemens representative if you need additional information related to thelatest listing of exact approvals by part number.

Agency Certificate Number

Lloyds Register of Shipping (LRS) 99 / 20018(E1)

American Bureau of Shipping (ABS) 01--HG20020--PDA

Germanischer Lloyd (GL) 12 045 -- 98 HH

Det Norske Veritas (DNV) A--8071

Bureau Veritas (BV) 09051 / A2 BV

Nippon Kaiji Kyokai (NK) A--534

How to Use This Manual

If you are a first-time (novice) user of S7-200 Micro PLCs, you should read the entire S7-200Programmable Controller System Manual. If you are an experienced user, refer to the table of contentsor index to find specific information.

The S7-200 Programmable Controller System Manual is organized according to the following topics:

- Chapter 1 (Product Overview) provides an overview of some of the features of the S7-200 familyof Micro PLC products.

- Chapter 2 (Getting Started) provides a tutorial for creating and downloading a sample controlprogram to an S7-200.

- Chapter 3 (Installing the S7-200) provides the dimensions and basic guidelines for installing theS7-200 CPU modules and expansion I/O modules.

- Chapter 4 (PLC Concepts) provides information about the operation of the S7-200.

- Chapter 5 (Programming Concepts, Conventions, and Features) provides information about thefeatures of STEP 7--Micro/WIN, the program editors and types of instructions (IEC 1131-3 orSIMATIC), S7-200 data types, and guidelines for creating programs.

- Chapter 6 (S7-200 Instruction Set) provides descriptions and examples of programminginstructions supported by the S7-200.

- Chapter 7 (Communicating over a Network) provides information for setting up the differentnetwork configurations supported by the S7-200.

- Chapter 8 (Hardware Troubleshooting Guide and Software Debugging Tools) provides informationfor troubleshooting problems with the S7-200 hardware and about the STEP 7--Micro/WINfeatures that help you debug your program.

- Chapter 9 (Creating a Program for the Position Module) provides information about theinstructions and wizard used to create a program for the EM 253 Position module.

- Chapter 10 (Creating a Program for the Modem Module) provides information about theinstructions and wizard used to create a program for the EM 241 Modem module.

- Chapter 11 (Using the USS Protocol Library to Control a MicroMaster Drive) provides informationabout the instructions used to create a control program for a MicroMaster drive. It also providesinformation about how to configure the MicroMaster 3 and MicroMaster 4 drives.

- Chapter 12 (Using the Modbus Protocol Library) provides information about the instructions usedto create a program that uses the Modbus protocol for communications.

- Appendix A (Technical Specifications) provides the technical information and data sheets aboutthe S7-200 hardware.

The other appendices provide additional reference information, such as descriptions of the error codes,descriptions of the Special Memory (SM) area, part numbers for ordering S7-200 equipment, and STLinstruction execution times.

Page 5: help S7-200

Preface

v

Additional Information and Assistance

Information about the S7-200 and STEP 7--Micro/WIN

In addition to this manual, STEP 7--Micro/WIN provides extensive online help for getting started withprogramming the S7-200. Included with the purchase of the STEP 7--Micro/WIN software is a freedocumentation CD. On this CD you can find application tips, an electronic version of this manual andother information.

Online Help

Help is only a keystroke away! Pressing F1 accesses the extensive online help for STEP 7--Micro/WIN.The online help includes useful information about getting started with programming the S7-200, as wellas many other topics.

Electronic Manual

An electronic version of this S7-200 System Manual is available on the documentation CD. You caninstall the electronic manual onto your computer so that you can easily access the information in themanual while you are working with the STEP 7--Micro/WIN software.

Programming Tips

The documentation CD includes Programming Tips, a set of application examples with sampleprograms. Reviewing or modifying these examples can help you find efficient or innovative solutions foryour own application. You can also find the most current version of Programming Tips on the S7-200Internet site.

Internet: www.siemens.com/S7--200

For additional information about Siemens products and services, technical support, frequently askedquestions (FAQs), product updates, or application tips, refer to the following Internet addresses:

- www.ad.siemens.de for general Siemens information

This Siemens Automation & Drives Internet site includes information about the SIMATIC productline and other products available from Siemens.

- www.siemens.com/S7--200 for S7-200 product information

The S7-200 Internet site includes frequently asked questions (FAQs), Programming Tips(application examples and sample programs), information about newly released products, andproduct updates or downloads.

Page 6: help S7-200

Contents

vi

Technical Assistance and Purchasing S7-200 Products

Local Siemens Sales Office or Distributor

For assistance in answering any technical questions, for training on the S7-200 products, or for orderingS7-200 products, contact your Siemens distributor or sales office. Because your sales representativesare technically trained and have the most specific knowledge about your operations, process andindustry, as well as about the individual Siemens products that you are using, they can provide thefastest and most efficient answers to any problems that you might encounter.

Technical Services

The highly trained staff of the S7-200 Technical Services center is also available to help you solve anyproblems that you might encounter. You can call on them 24 hours a day, 7 days a week:

- For calls originating from within the United States of AmericaLocal time: Monday to Friday 0800 to 1900 Eastern timeTelephone: +1 800 241--4453Fax: +1 (0) 770 740--3699E-Mail: [email protected]

- For calls originating from the Americas outside of the USALocal time: Monday to Friday 0800 to 1900 Eastern timeTelephone: +1 (0) 770 740--3505Fax: +1 (0) 770 740--3699E-Mail: [email protected]

- For calls originating from Europe and AfricaLocal time (Nuremberg): Monday to Friday 0700 to 1700Telephone: +49 (0) 180 5050--222Fax: +49 (0) 180 5050--223E-Mail: [email protected]

- For calls originating from Asia and AustraliaLocal time (Singapore): Monday to Friday 0830 to 1730Telephone: +65 (0) 740--7000Fax: +65 (0) 740--7001E-Mail: [email protected]

Page 7: help S7-200

vii

Contents

1 Product Overview 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

S7-200 CPU 2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

S7-200 Expansion Modules 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

STEP 7--Micro/WIN Programming Package 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Communications Options 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Display Panels 4. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 Getting Started 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Connecting the S7-200 CPU 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Creating a Sample Program 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Downloading the Sample Program 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Placing the S7-200 in RUN Mode 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3 Installing the S7-200 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Guidelines for Installing S7-200 Devices 14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Installing and Removing the S7-200 Modules 15. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Guidelines for Grounding and Wiring 18. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 PLC Concepts 21. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Understanding How the S7-200 Executes Your Control Logic 22. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Accessing the Data of the S7-200 24. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Understanding How the S7-200 Saves and Restores Data 34. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Storing Your Program on a Memory Cartridge 36. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Selecting the Operating Mode for the S7-200 CPU 37. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using Your Program to Save V Memory to the EEPROM 38. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Features of the S7-200 39. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5 Programming Concepts, Conventions, and Features 47. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Guidelines for Designing a Micro PLC System 48. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Basic Elements of a Program 49. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using STEP 7--Micro/WIN to Create Your Programs 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Choosing Between the SIMATIC and IEC 1131--3 Instruction Sets 53. . . . . . . . . . . . . . . . . . . . . . . . . . . .

Understanding the Conventions Used by the Program Editors 54. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using Wizards To Help You Create Your Control Program 56. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Handling Errors in the S7-200 56. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Assigning Addresses and Initial Values in the Data Block Editor 58. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using the Symbol Table for Symbolic Addressing of Variables 58. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using Local Variables 59. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using the Status Chart to Monitor Your Program 59. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Creating an Instruction Library 60. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Features for Debugging Your Program 60. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 8: help S7-200

Contents

viii

6 S7-200 Instruction Set 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conventions Used to Describe the Instructions 63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

S7-200 Memory Ranges and Features 64. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Bit Logic Instructions 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contacts 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Coils 69. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Logic Stack Instructions 71. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Set and Reset Dominant Bistable Instructions 73. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Clock Instructions 74. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Communications Instructions 75. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Network Read and Network Write Instructions 75. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Transmit and Receive Instructions (Freeport) 80. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Get Port Address and Set Port Address Instructions 89. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Compare Instructions 90. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Comparing Numerical Values 90. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Compare String 92. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conversion Instructions 93. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Standard Conversion Instructions 93. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

ASCII Conversion Instructions 97. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

String Conversion Instructions 101. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Encode and Decode Instructions 106. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Counter Instructions 107. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

SIMATIC Counter Instructions 107. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

IEC Counter Instructions 110. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

High-Speed Counter Instructions 112. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pulse Output Instruction 126. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Math Instructions 141. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Add, Subtract, Multiply, and Divide Instructions 141. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Multiply Integer to Double Integer and Divide Integer with Remainder 143. . . . . . . . . . . . . . . . . . . . . .

Numeric Functions Instructions 144. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Increment and Decrement Instructions 145. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Proportional/Integral/Derivative (PID) Loop Instruction 146. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Interrupt Instructions 156. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Logical Operations Instructions 163. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Invert Instructions 163. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

AND, OR, and Exclusive OR Instructions 164. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Move Instructions 166. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Move Byte, Word, Double Word, or Real 166. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Move Byte Immediate (Read and Write) 167. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Block Move Instructions 168. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Program Control Instructions 169. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Conditional End 169. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Stop 169. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Watchdog Reset 169. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

For--Next Loop Instructions 171. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Jump Instructions 173. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sequence Control Relay (SCR) Instructions 174. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 9: help S7-200

Contents

ix

Shift and Rotate Instructions 180. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Shift Right and Shift Left Instructions 180. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Rotate Right and Rotate Left Instructions 180. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Shift Register Bit Instruction 182. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Swap Bytes Instruction 184. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

String Instructions 185. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Table Instructions 190. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Add To Table 190. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

First-In-First-Out and Last-In-First-Out 191. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Memory Fill 193. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Table Find 194. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Timer Instructions 197. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

SIMATIC Timer Instructions 197. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

IEC Timer Instructions 202. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Subroutine Instructions 204. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7 Communicating over a Network 209. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Understanding the Basics of S7-200 Network Communications 210. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Selecting the Communications Protocol for Your Network 214. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Installing and Removing Communications Interfaces 220. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Building Your Network 222. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Creating User-Defined Protocols with Freeport Mode 227. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using Modems and STEP 7--Micro/WIN with Your Network 229. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Advanced Topics 235. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Configuring the RS-232/PPI Multi-Master Cable for Remote Operation 241. . . . . . . . . . . . . . . . . . . . . . . . .

8 Hardware Troubleshooting Guide and Software Debugging Tools 245. . . . . . . . . . . . . . . . .

Features for Debugging Your Program 246. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Displaying the Program Status 248. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using a Status Chart to Monitor and Modify the Data in the S7-200 249. . . . . . . . . . . . . . . . . . . . . . . . . . . .

Forcing Specific Values 250. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Running Your Program for a Specified Number of Scans 250. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Hardware Troubleshooting Guide 251. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9 Creating a Program for the Position Module 253. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Features of the Position Module 254. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Configuring the Position Module 256. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Position Instructions Created by the Position Control Wizard 267. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sample Programs for the Position Module 279. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Monitoring the Position Module with the EM 253 Control Panel 284. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Error Codes for the Position Module and the Position Instructions 286. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Advanced Topics 288. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10 Creating a Program for the Modem Module 297. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Features of the Modem Module 298. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using the Modem Expansion Wizard to Configure the Modem Module 304. . . . . . . . . . . . . . . . . . . . . . . . .

Overview of Modem Instructions and Restrictions 308. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Instructions for the Modem Module 309. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 10: help S7-200

Contents

x

Sample Program for the Modem Module 313. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

S7-200 CPUs that Support Intelligent Modules 313. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Special Memory Location for the Modem Module 314. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Advanced Topics 316. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Messaging Telephone Number Format 318. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Text Message Format 318. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CPU Data Transfer Message Format 320. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11 Using the USS Protocol Library to Control a MicroMaster Drive 321. . . . . . . . . . . . . . . . . . .

Requirements for Using the USS Protocol 322. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Calculating the Time Required for Communicating with the Drive 323. . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using the USS Instructions 324. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Instructions for the USS Protocol 325. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Sample Programs for the USS Protocol 332. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

USS Execution Error Codes 333. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Connecting and Setting Up the MicroMaster Series 3 Drive 334. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Connecting and Setting Up the MicroMaster Series 4 Drive 337. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12 Using the Modbus Protocol Library 339. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Requirements for Using the Modbus Protocol 340. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Initialization and Execution Time for the Modbus Protocol 340. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Modbus Addressing 341. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Using the Modbus Slave Protocol Instructions 342. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Instructions for the Modbus Slave Protocol 343. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A Technical Specifications 347. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .General Technical Specifications 348. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CPU Specifications 351. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Digital Expansion Modules Specifications 357. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Analog Expansion Modules Specifications 363. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Thermocouple and RTD Expansion Modules Specifications 373. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

EM 277 PROFIBUS--DP Module Specifications 385. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

EM 241 Modem Module Specifications 397. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

EM 253 Position Module Specifications 399. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(CP 243--1) Ethernet Module Specifications 405. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(CP 243--1 IT) Internet Module Specifications 407. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(CP 243--2) AS--Interface Module Specifications 410. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Optional Cartridges 412. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

I/O Expansion Cable 412. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

RS-232/PPI Multi-Master Cable and USB/PPI Multi-Master Cable 413. . . . . . . . . . . . . . . . . . . . . . . . . . . .

Input Simulators 417. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

B Calculating a Power Budget 419. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

C Error Codes 423. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Fatal Error Codes and Messages 424. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Run-Time Programming Problems 425. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Compile Rule Violations 426. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .