Siemens SIMATIC S7-200 System Manual

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
Open Loop Motion Control with the S7-200
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
Using Recipes
13
Using Data Logs
14
PID Auto-Tune and the PID Tuning Control Panel
15
Appendices
Index
S7-200 Programmable Controller System Manual
SIMATIC
Edition 08/2008
A5E00307987--04
This manual has the order number:
6ES7298-8FA24--8BH0
ii
Safety Guidelines
This manual contains noticeswhichyou should observe to ensure your own personalsafety,as well as to protecttheproductandconnectedequipment. These notices are highlighted in the manual by a warning triangleand aremarkedas follows according tothelevelofdanger:
Danger
Danger indicates an imminently hazardous situation which, if not avoided,will result in death or serious injury.
Warning
Warningindicates a potentially hazardous situation which,ifnotavoided, could result in death or serious injury.
Caution
Caution used with the safetyalert symbol indicates a potentially hazardous situation which, if not avoided, may resultinminoror moderate injury.
Caution
Caution used withoutthesafety alertsymbolindicates a potentially hazardous situation which, if not avoided, may resultinproperty damage.
Notice
Notice indicatesa potential situation which,ifnotavoided, may resultin an undesirableresult or state.
QualifiedPersonnel
Only qualified personnelshould be allowed to installand work on this equipment.Qualified persons are defined as persons who are authorized to commission, to ground, and to tag circuits, equipment,and systems inaccordancewith established safety practicesand standards.
Correct Usage
Note the following:
Warning
This device and its components may only be used for the applicationsdescribed in the catalog or the technicaldescriptions, and only in connectionwith devices or components from other manufacturers which have been approved or recommended by Siemens.
This product can only functioncorrectly and safely if it is transported,stored, set up, and installedcorrectly,and operatedand maintained as recommended.
Trademarks
SIMATICR,SIMATIC HMIR and SIMATICNETR are registered trademarks of SIEMENS AG. Some of other designations used in these documents are also registered trademarks; the owner’s rights may be
violated if they are used by third parties for their own purposes.
Wehave checkedthe contentsof this manual fo r agreement with th e hardware and software described. Since deviations cannot be precluded entirely, we cannot guarantee fullagreement. However,thedata inthis manualare reviewed regularly and any necessary corrections included in subsequent editions. Suggestions for improvementare welcomed.
Disclaimer of LiabilityCopyright Siemens AG 2008All rights reserved
The reproduction, transmission or use of this document or its contents is not permitted without express writtenauthority.Offenders will be liable fordamages. Allrights,including rightscreated by patentgrantor registration ofa utilitymodel or design, arereserved.
Siemens AG Bereich Automation and Drives
Geschaeftsgebiet Industrial AutomationSystems
Postfach 4848, D- 90327Nuernberg
E SiemensAG 2008
Technicaldata subject tochange.
Siemens Aktiengesellschaft 6ES7298-8FA24-8BH0
iii
Preface
Purpose of the manual
The S7-200 series is a line of micro-programmable logic controllers(Micro PLCs) that can control a variety of automation applications. Compact design, low cost, and a powerful instruction set make the S7-200 a perfect solution for controlling smallapplications. The wide variety of S7-200 models and the Windows-based programming tool give you the flexibility you need to solve your automationproblems.
This manual provides information about installing and programming the S7-200 Micro PLCs and is designed for engineers,programmers,installers, and electricians who have a general knowledge of programmablelogic controllers.
Required Basic Knowledge
To understand this manual, it is necessary to have a general knowledge of automationand programmablelogic controllers.
Scope of the Manual
This manual is valid forSTEP 7--Micro/WIN,version 4.0 and the S7-200 CPU product family. For a complete listoftheS7-200products and order numbersdescribed in this manual, see AppendixA.
Changes compared to the previous version
This manual has been revised to include two new analog expansion modules and one additional appendix.
- EM 231 Analog Input RTD, 4 Inputs
- EM 231 Analog Input Thermocouple 8 Inputs
- Appendix H, S7-200CN Products
Certification
The SIMATIC S7-200 products have the following certification:
- Underwriters Laboratories, Inc.UL508 Listed(Industrial Control Equipment),
Registration number E75310
- Canadian Standards Association:CSA C22.2 Number 142 (Process Control Equipment)
- Factory MutualResearch:Class Number 3600, Class Number3611, FM Class I, Division 2,
Groups A, B, C, & D Hazardous Locations, T4A and Class I, Zone 2, IIC, T4
Tip
The SIMATIC S7-200 series meets the CSA standard. The cULus logo indicates that the S7-200 has been examined and certified by Underwriters
Laboratories(UL)to standards UL 508 and CSA 22.2 No. 142.
S7-200 Programmable Controller System Manual
iv
CE Labeling
Refer to the GeneralTechnical Specifications in Appendix A formoreinformation.
C-Tick
The SIMATIC S7-200 products are compliant with requirements of the AS/NZS 2064 (Australian) standard.
Standards:
The SIMATIC S7-200 products fulfilltherequirement and criteria of IEC 61131 -- 2, Programmable controllers -- Equipment requirements.
Refer to Appendix A for additional compliance information.
Place of this Documentation in the Information Environment
Product
Family
Documentation Order Number
S7-200 S7-200 Point-to-Point Interface Communication Manual (English/German) 6ES7298--8GA00--8XH0
SIMATIC Text Display User Manual (included on the STEP 7--Micro/WIN documentation CD)
none
HMI device OP 73micro, TP 177micro (WinCC Flexible) Operating Instructions (English)
6AV6 691--1DF01--0AB0
SIMATIC HMI WinCC flexible 2005 Micro User’s Manual (English) 6AV6691--1AA01--0AB0 SIMATIC NET CP 243--2 AS-Interface Master Manual (English) 6GK7 243--2AX00--8BA0 SIMATIC NET CP 243--1 Communications processor of Industrial Ethernet
Technical Manual (English)
J31069--D0428--U001--A2--7618
SIMATIC NET CP 243--1 IT Communications Processor of Industrial Ethernet and Information T echnology Technical Manual (English)
J31069--D0429--U001--A2--7618
SIMATIC NET S7Beans / Applets for IT--CPs Programming Tips (English) C79000--G8976--C180--02 SIMATIC NET GPRS/GSM--Modem SINAUT MD720--3 System manual
(English)
C79000--G8976--C211
SIMATIC NET SINAUT MICRO SC System manual (English) C79000--G8900--C210 SIWAREX MS Device Manual (English) (included with device) none S7-200 Programmable Controller System Manual (English) 6ES7 298--8FA24--8BH0
Preface
v
Finding Your Way
If you are a first-time user of S7-200 Micro PLCs, you should read the entireS7-200 ProgrammableController System Manual. If you are an experienced user, refer to the table of
contents or index to findspecific information. The S7-200 Programmable Controller SystemManualisorganized according to the following
topics:
- Chapter 1 (ProductOverview) provides an overview of some of the features of the S7-200
familyofMicro PLC products.
- Chapter 2 (Getting Started)provides a tutorial for creating and downloading a sample
control program to an S7-200.
- Chapter 3 (Installing the S7-200) provides the dimensions and basic guidelines for installing
the S7-200 CPU modules and expansion I/O modules.
- Chapter 4 (PLC Concepts) providesinformation about the operation of the S7-200.
- Chapter 5 (Programming Concepts, Conventions,andFeatures) provides information about
the featuresofSTEP7--Micro/WIN, the program editors and types of instructions (IEC 1131-3 or SIMATIC), S7-200 data types,and guidelines forcreating programs.
- Chapter 6 (S7-200 Instruction Set) provides descriptionsand examples of programming
instructions supportedby the S7-200.
- Chapter 7 (Communicating over a Network)provides information forsetting up the different
network configurations supported by the S7-200.
- Chapter 8 (HardwareTroubleshooting Guide and Software Debugging Tools) provides
information for troubleshooting problems with the S7-200 hardware and about the STEP 7--Micro/WINfeatures that help you debug your program.
- Chapter 9 (Open Loop Motion Controlwith the S7-200) provides informationaboutthree
methods of open loop motion control:Pulse Width Modulation, Pulse Train Output, and the EM 253 Position ControlModule.
- Chapter 10 (Creating a Program fortheModemModule) provides information about the
instructions and wizard used to create a programforthe EM 241 Modem module.
- Chapter 11 (Using the USS Protocol Library to ControlaMicroMaster Drive) provides
information about the instructions used to create a controlprogram foraMicroMaster drive. It also providesinformationabouthowtoconfigure the MicroMaster 3 and MicroMaster4 drives.
- Chapter 12 (Using the Modbus ProtocolLibrary)provides information about the instructions
used to create a program thatuses the Modbus protocolfor communications.
- Chapter 13 (Using Recipes)provides information about organizing and loading automation
program recipesinthememory cartridge.
- Chapter 14 (Using Data Logs) providesinformation about storing process measurement
data in the memory cartridge.
- Chapter 15 (PID Auto-Tune and the PID TuningControl Panel)providesinformation about
using these featurestogreatly enhance the utility and ease of use of the PID function provided by the S7-200.
- Appendix A (Technical Specifications)provides the technicalinformation and data sheets
about the S7-200 hardware.
The other appendices provide additional referenceinformation,suchas descriptions of the error codes, descriptionsofthe Special Memory (SM)area,part numbers for ordering S7-200 equipment,STL instruction execution times, and S7-200CN product information.
In addition tothis manual, STEP 7--Micro/WINprovides extensive online help forgetting started with programming the S7-200.Included with the purchase of the STEP 7--Micro/WIN software is a free documentation CD. On this CD you can find application tips,anelectronic version of this manual and other information.
S7-200 Programmable Controller System Manual
vi
Online Help
Help is only a keystroke away! Pressing F1 accesses the extensive onlinehelpfor STEP 7--Micro/WIN.Theonline help includes useful information about gettingstarted with programmingtheS7-200, as well as many other topics.
Electronic Manual
An electronic versionofthis S7-200 System Manual is availableon the documentation CD. You can installtheelectronic manual onto your computer so that you can easily access the information in the manual while you are working withtheSTEP7--Micro/WIN software.
Programming Tips
The documentation CD includes Programming Tips,asetofapplic ation examples with sample programs.Reviewing or modifying these examplescan help you find efficient or innovative solutions foryourownapplication. You can also findthemostcurrent version of Programming Tips on the S7-200 Internetsite.
Recycling and Disposal
Please contact a company certified in the disposalofelectronic scrap for environmentallysafe recyclingand disposalofyourdevice.
Additional Support
Local Siemens Sales Office or Distributor
For assistance in answeringany technicalquestions, for training on the S7-200 products,orfor ordering S7-200products , contact your Siemens distributororsales office.Becauseyoursales representatives are technically trained and have the most specificknowledgeaboutyour operations,process and industry, as wellas about the individual Siemens products that you are using, they can provide the fastestandmostefficient answers to any problems thatyou might encounter.
Service & Support on the Internet
In addition to ourdocumentation, we offer our Know-how online on the Internetat: http://www
.siemens.com/automation/service&support
where you will find the following:
- www.siemens.com/S7--200 for S7-200 productinformation
The S7-200 Internetsite includes frequently asked questions(FAQs), ProgrammingTips (application examples and sample programs), information about newly released products, and product updates or downloads.
- 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, whereusersand expertsfrom allovertheworld exchange theirexperiences.
- Your local representative for Automation & Drives.
- Information on field service,repairs, spareparts and more under “Services”.
Techn ical Services
The highly trainedstaff of the S7-200 Technical Services centerisalsoavailable to help you solve any problems that you mightencounter. You can call on them 24 hours a day, 7 days a week.
Preface
vii
A&D Technical Support
Worldwide, available 24 hours a day:
Johnson City
Nuernberg
Beijing
Technical Support
Worldwide (Nuernberg) Technical Support
24 hours a day, 365 days a year Phone: +49 (180) 5050-222 Fax: +49 (180) 5050-223 mailto:adsupport@siemens.com GMT: +1:00
United States (Johnson City) Technical Support and
Authorization
Local time: Mon.-Fri. 8:00 AM to 5:00 PM
Phone: +1 (423) 262 2522
+1 (800) 333--7421 (USA only) Fax: +1 (423) 262 2289 mailto:simatic.hotline
@
sea.siemens.com
Asia / Australia (Beijing) Technical Support and
Authorization
Local time: Mon.-Fri. 8:00 AM to 5:00 PM
Phone: +86 10 64 75 75 75 Fax: +861064747474 mailto:adsupport.asia@siemens.com
GMT: +8:00
Europe / Africa (Nuernberg) Authorization
Local time: Mon.-Fri. 8:00 AM to 5:00 PM
Phone: +49 (180) 5050--222 Fax: +49 (180) 5050-223 mailto:adsupport@siemens.com
GMT: +1:00
mailto:simati
c.hotline@sea.siemens.com
GMT : --5:00
The languages of the SIMATIC Hotlines and the authorization hotline are generally German and English.
S7-200 Programmable Controller System Manual
viii
ix
Contents
1 Product Overview 1.......................................................
What’sNew? 2....................................................................
S7-200 CPU 2....................................................................
S7-200 Expansion Modules 4.......................................................
STEP 7--Micro/WIN ProgrammingPackage 5..........................................
CommunicationsOptions 5.........................................................
Display Panels 6..................................................................
2 Getting Started 7..........................................................
Connecting the S7-200 CPU 8......................................................
Creating a Sample Program 10.......................................................
Downloading the Sample Program 14.................................................
Placing the S7-200 in RUN Mode 14..................................................
3 Installing the S7-200 15.....................................................
Guidelines for Installing S7-200 Devices 16............................................
Installing and Removing the S7-200 Modules 17........................................
Guidelines forGrounding and Wiring 20...............................................
4 PLC Concepts 23...........................................................
Understanding How the S7-200 Executes Your Control Logic 24..........................
Accessing the Data of the S7-200 27..................................................
Understanding How the S7-200 Saves and Restores Data 36.............................
Selecting the Operating Mode for the S7-200 CPU 40....................................
Using the S7-200 Explorer 41........................................................
Features of the S7-200 41...........................................................
5 Programming Concepts, Conventions, and Features 51.......................
Guidelines forDesigning a MicroPLC System 52.......................................
Basic Elements of a Program 53......................................................
Using STEP 7--Micro/WINtoCreate Your Programs 55..................................
Choosing Between the SIMATIC and IEC 1131--3 Instruction Sets 57......................
Understanding theConventions Used by the Program Editors 58..........................
Using Wizards To Help You Create Your Control Program 60..............................
Handling ErrorsintheS7-200 60.....................................................
Assigning Addresses and Initial Values in the Data Block Editor 62........................
Using the Symbol Table for Symbolic Addressing of Variables 62..........................
Using Local Variables 63............................................................
Using the Status Chart to Monitor Your Program 63......................................
Creating an Instruction Library 64.....................................................
Features forDebuggingYour Program 64..............................................
S7-200 Programmable Controller System Manual
x
6 S7-200 Instruction Set 65...................................................
Conventions Used to Describe the Instructions 67.......................................
S7-200 Memory Ranges and Features 68..............................................
Bit Logic Instructions 70.............................................................
Contacts 70...................................................................
Coils 73.......................................................................
Logic Stack Instructions 75......................................................
Set and Reset Dominant BistableInstructions 77....................................
Clock Instructions 78................................................................
CommunicationsInstructions 81......................................................
Network Read and Network Write Instructions 81....................................
Transmitand Receive Instructions (Freeport) 86....................................
Get Port Address and Set PortAddressInstructions 95..............................
Compare Instructions 96............................................................
Comparing NumericalValues 96..................................................
Compare String 98.............................................................
Conversion Instructions 99...........................................................
Standard ConversionInstructions 99..............................................
ASCII ConversionInstructions 103.................................................
String ConversionInstructions 107.................................................
Encode and Decode Instructions 112...............................................
Counter Instructions 113..............................................................
SIMATIC Counter Instructions 113.................................................
IEC Counter Instructions 116......................................................
High-Speed CounterInstructions 118...................................................
Pulse Output Instruction 133..........................................................
Math Instructions 140................................................................
Add, Subtract,Multiply,andDivideInstructions 140...................................
MultiplyInteger to Double Integer and Divide Integer with Remainder 142................
Numeric FunctionsInstructions 143................................................
Incrementand DecrementInstructions 144..........................................
Proportional/Integral/Derivative (PID)Loop Instruction 145.................................
Interrupt Instructions 153.............................................................
Logical Operations Instructions 161....................................................
InvertInstructions 161............................................................
AND, OR, and Exclusive OR Instructions 162........................................
Move Instructions 164................................................................
Move Byte, Word,Double Word,or Real 164........................................
Move Byte Immediate(Readand Write) 165.........................................
Block Move Instructions 166......................................................
Program ControlInstructions 167......................................................
ConditionalEnd 167.............................................................
Stop 167.......................................................................
Watchdog Reset 167.............................................................
For--Next Loop Instructions 169....................................................
Jum
p Instructions 171............................................................
Sequence Control Relay (SCR)Instructions 172.....................................
Diagnostic LED Instruction 178....................................................
Contents
xi
Shift and RotateInstructions 179.......................................................
Shift RightandShift Left Instructions 179............................................
Rotate Right and RotateLeftInstructions 179........................................
Shift RegisterBit Instruction 181...................................................
Swap Bytes Instruction 183.......................................................
String Instructions 184...............................................................
Table Instructions 189................................................................
AddToTable 189................................................................
First-In-First-Outand Last-In-First-Out 190..........................................
Memory Fill 192.................................................................
Table Find 193..................................................................
TimerInstructions 196................................................................
SIMATIC Timer Instructions 196...................................................
IEC TimerInstructions 201........................................................
Interval Timers 203..............................................................
Subroutine Instructions 204...........................................................
7 Communicating over a Network 209..........................................
Understanding theBasicsofS7-200Network Communications 210.........................
Selecting the Communications Protocolfor Your Network 214..............................
Installing and Removing Communications Interfaces 220..................................
Building Your Network 221............................................................
Creating User-Defined Protocolswith Freeport Mode 226.................................
Using Modems and STEP 7--Micro/WIN with Your Network 228............................
Advanced Topics 233................................................................
ConfiguringtheRS-232/PPI Multi-Master Cable forRemoteOperation 239...................
8 Hardware Troubleshooting Guide and Software Debugging Tools 243...........
Features forDebuggingYour Program 244..............................................
Displaying the ProgramStatus 246.....................................................
Using a Status Chart to Monitorand ModifytheDataintheS7-200 247......................
Forcing SpecificValues 248...........................................................
Running Your Program fora Specified Number of Scans 248..............................
Hardware Troubleshooting Guide 249..................................................
9 Open Loop Motion Control with the S7-200 251................................
Overview 252.......................................................................
Using the PWM (Pulse WidthModulation) Output 253.....................................
Basic Information for Open Loop Position ControlUsing SteppersorServos 255..............
Instructions Createdby the Position ControlWizard 260...................................
ErrorCodes forthePTO Instructions 264...............................................
Features of the Position Module 265...................................................
ConfiguringthePosition Module 267...................................................
Instructions Createdby the Position ControlWizard for the Position Module 273..............
Sample Programs forthePosition Module 285...........................................
Monitoringthe Position Module withtheEM253 ControlPanel 290.........................
ErrorCodes forthePosition Module and the Position Instructions 292.......................
Advanced Topics 294................................................................
Understanding theRP Seek Modes Supported by the PositionModule 303..................
S7-200 Programmable Controller System Manual
xii
10 Creating a Program for the Modem Module 307................................
Features of the Modem Module 308....................................................
Using the Modem Expansion Wizard to Configure the Modem Module 314...................
Overview of Modem Instructions and Restrictions 318....................................
Instructions fortheModemModule 319.................................................
Sample Program fortheModemModule 323............................................
S7-200 CPUs that Support Intelligent Modules 323.......................................
Special Memory Locationforthe Modem Module 323.....................................
Advanced Topics 325................................................................
Messaging Telephone Number Format 327..............................................
Text Message Format 328............................................................
CPU Data TransferMessageFormat 329...............................................
11 Using the USS Protocol Library to Control a MicroMaster Drive 331.............
RequirementsforUsing the USS Protocol 332...........................................
CalculatingtheTime Required forCommunicating with the Drive 332.......................
Using the USS Instructions 333........................................................
Instructions fortheUSS Protocol 334...................................................
Sample Programs fortheUSS Protocol 341.............................................
USS Execution ErrorCodes 342.......................................................
Connecting and SettingUp the MicroMaster Series 3 Drive 342............................
Connecting and SettingUp the MicroMaster Series 4 Drive 345............................
12 Using the Modbus Protocol Library 347.......................................
Overview 348.......................................................................
RequirementsforUsing Modbus Protocol 348...........................................
Initialization and Execution Time for Modbus Protocol 349.................................
Modbus Addressing 350..............................................................
Using the Modbus Master Instructions 351..............................................
Using the Modbus Slave Instructions 352...............................................
Instructions fortheModbus Protocol 353................................................
Advanced Topics 362................................................................
13 Using Recipes 365...........................................................
Overview 366.......................................................................
Recipe Definition and Terminology 367.................................................
Using the Recipe Wizard 367..........................................................
Instructions Createdby the Recipe Wizard 371..........................................
14 Using Data Logs 373........................................................
Overview 374.......................................................................
Using the Data Log Wizard 375........................................................
Instruction Created by the Data Log Wizard 379..........................................
15 PID Auto-Tune and the PID Tuning Control Panel 381..........................
Understanding thePIDAuto-Tune 382..................................................
Expanded Loop Table 382............................................................
Prerequisites 385....................................................................
Auto-Hysteresis and Auto-Deviation 385................................................
Auto-TuneSequence 386.............................................................
Contents
xiii
Exception Conditions 387.............................................................
Notes Concerning PV Out-of-Range (ResultCode3) 387..................................
PID Tuning ControlPanel 388.........................................................
A Technical Specifications 391.................................................
General Technical Specifications 392...................................................
CPU Specifications 396..............................................................
DigitalExpansionModules Specifications 405...........................................
Analog Expansion Modules Specifications 412...........................................
Thermocouple and RTD Expansion ModulesSpecifications 424............................
EM 277 PROFIBUS--DP Module Specifications 438......................................
EM 241 Modem Module Specifications 450..............................................
EM 253 Position Module Specifications 452.............................................
(CP 243--1) Ethernet Module Specifications 458.........................................
(CP 243--1 IT) Internet Module Specifications 460........................................
(CP 243--2) AS--Interface Module Specifications 463......................................
Optional Cartridges 465..............................................................
I/O Expansion Cable 466.............................................................
RS-232/PPI Multi-Master Cable and USB/PPI Multi-MasterCable 467......................
Input Simulators 471.................................................................
B Calculating a Power Budget 473..............................................
C Error Codes 477.............................................................
Fatal ErrorCodesand Messages 478..................................................
Run-TimeProgramming Problems 479.................................................
Compile Rule Violations 480..........................................................
D Special Memory (SM) Bits 481................................................
SMB0: Status Bits 482...............................................................
SMB1: Status Bits 482...............................................................
SMB2: FreeportReceiveCharacter 483................................................
SMB3: FreeportParity Error 483.......................................................
SMB4: Queue Overflow 483...........................................................
SMB5: I/O Status 484................................................................
SMB6: CPU ID Register 484..........................................................
SMB7: Reserved 484................................................................
SMB8 to SMB21: I/O Module ID and ErrorRegisters 485..................................
SMW22 to SMW26: Scan Times 486...................................................
SMB28 and SMB29: Analog Adjustment 486............................................
SMB30 and SMB130: Freeport ControlRegisters 486.....................................
SMB31 and SMW32: Permanent Memory (EEPROM) Write Control 487.....................
SMB34 and SMB35: Time IntervalRegisters forTimed Interrupts 487.......................
SMB36 to SMB65: HSC0, HSC1, and HSC2 Register 487.................................
SMB66 to SMB85: PTO/PWMRegisters 489............................................
SMB86 to SMB94, and SMB186 to SMB194: Receive Message Control 490.................
SMW98: Errorson theExpansionI/O Bus 491...........................................
SMB130: FreeportControl Register (see SMB30) 491....................................
SMB131 to SMB165: HSC3, HSC4, and HSC5 Register 491...............................
SMB166 to SMB185: PTO0, PTO1Profile Definition Table 492.............................
S7-200 Programmable Controller System Manual
xiv
SMB186 to SMB194: Receive Message Control (see SMB86 to SMB94) 492.................
SMB200 to SMB549: Intelligent Module Status 493.......................................
E S7-200 Order Numbers 495...................................................
F Execution Times for STL Instructions 499.....................................
G S7-200 Quick Reference Information 505......................................
H S7-200CN Products 511......................................................
Certifications and Approvals for S7-200CN Products 512..................................
S7-200CN Products 513..............................................................
1
Product Overview
The S7-200 series of micro-programmable logic controllers(Micro PLCs) can controla wide variety of devices tosupportyourautomation needs.
The S7-200 monitors inputsand changes outputs as controlled by the user program,which can include Boolean logic,counting, timing,complex math operations, and communications withother intelligent devices. The compact design, flexible configuration, and powerful instructionset combine to make the S7-200 a perfect solution forcontrolling a wide variety of applications.
In This Chapter
What’sNew? 2....................................................................
S7-200 CPU 2....................................................................
S7-200 Expansion Modules 4.......................................................
STEP 7--Micro/WIN ProgrammingPackage 5..........................................
CommunicationsOptions 5.........................................................
Display Panels 6..................................................................
S7-200 Programmable Controller System Manual
2
What’s New?
The new features of the SIMATIC S7-200 include two new analog expansion modules:
- EM 231 Analog Input RTD, 4 Inputs
- EM 231 Analog Input Thermocouple 8 Inputs
- Appendix H, S7-200CN Products
S7-200 CPU
The S7-200 CPU combines a microprocessor, an integrated power supply, input circuits, and output circuits in a compact housing to create a powerfulMic ro PLC. See Figure 1-1. After you have downloaded your program, the S7-200contains the logic required tomonitor and control the input and output devices in your application.
I/OLEDs
Status LEDs:
System Fault/Diagnostic (SF/DIAG) RUN STOP
Optional cartridge:
Memory Cartridge Real-time Clock Battery
Communications port
Terminal connector (removable on CPU 224, CPU 224XP
and CPU 226)
Clip for installation on a standard (DIN) rail
A
ccess door:
Modeselector switch(RUN/STOP) Analog adjustment potentiometer(s) Expansion port (for most CPUs)
Figure 1-1 S7-200 Micro PLC
Product Overview Chapter 1
3
Siemens provides different S7-200 CPU models with a diversity of features and capabilities that help you create effective solutions for your varied applications. Table 1-1 briefly compares some of the features oftheCPU.Fordetailed information about a specific CPU, see Appendix A.
Table 1-1 Comparison of the S7-200 CPU Models
Feature CPU 221 CPU 222 CPU 224
CPU 224XP CPU 224XPsi
CPU 226
Physical size(mm) 90 x 80 x 62 90 x 80 x 62 120.5 x 80 x 62 140x 80 x 62 190 x 80 x 62 Program memory:
with run mode edit without run mode edit
4096 bytes 4096 bytes
4096 bytes 4096 bytes
8192 bytes 12288 bytes
12288 bytes 16384 bytes
16384 bytes
24576 bytes Data memory 2048 bytes 2048 bytes 8192 bytes 10240 bytes 10240 bytes Memory backup 50 hours
typical
50 hours typical
100 hours typical
100 hours typical
100 hours
typical Local on-board I/O
Digital Analog
6In/4Out--8In/6Out
--
14 In/10 Out--14 In/10 Out
2In/1Out
24 In/16 Out
--
Expansion modules 0 modules 2 modules
1
7 modules
1
7 modules
1
7 modules
1
High-speed counters
Single phase Two phase
4at30kHz 2at20kHz
4at30kHz 2at20kHz
6at30kHz 4at20kHz
4at30kHz 2 at 200 kHz 3at20kHz 1 at 100 kHz
6at30kHz
4at20kHz
Pulse outputs (DC) 2at20kHz 2at20kHz 2at20kHz 2 at 100 kHz 2at20kHz Analog adjustments 1 1 2 2 2 Real-time clock Cartridge Cartridge Built-in Built-in Built-in Communications ports 1 RS--485 1 RS--485 1 RS--485 2 RS--485 2 RS--485 Floating-point math Yes Digital I/O image size 256 (128 in, 128 out) Boolean execution
speed
0.22 microseconds/instruction
1 Youmust calculateyourpower budget todetermine howmuchpower (or c urrent) the S7-200CPU canprovide foryour configuration.If theCPU
powerbudget is exceeded,you may notbeable to connectthe maximum numberof modules.See Appendix Afor CPU andexpansion module power requirements, and Appendix B to calculate your power budget.
S7-200 Programmable Controller System Manual
4
S7-200 Expansion Modules
To better solve your application requirements, the S7-200 family includes a wide varietyof expansion modules. You can use these expansion modules to add additionalfunctionality to the S7-200 CPU. Table 1-2 provides a list of the expansion modules that are currently available.For detailed information about a specific module, see Appendix A.
Table 1-2 S7-200 Expansion Modules
Expansion Modules
Type
Discrete modules
Input 8xDCIn 8xACIn 16 x DC In Output
4xDCOut 4xRelays 8xRelay 8xDCOut 8xACOut
Combination 4xDCIn/
4xDCOut
8xDCIn/ 8xDCOut
16 x DC In/ 16 x DC Out
32 x DC In/ 32 x DC Out
4xDCIn/ 4xRelay
8xDCIn/ 8xRelay
16 x DC In/ 16 x Relay
32 x DC In/ 32 x Relay
Analog modules
Input
4 x Analog In 8 x Analog In 4 x Thermocouple In 8 x Thermocouple In
2xRTDIn 4xRTDIn Output 2 x Analog Out 4 x Analog Out Combination 4x Analog In
4 x Analog Out
Intelligent modules
Position Modem PROFIBUS--DP
Ethernet Ethernet IT
Other modules
AS--Interface SIWAREX MS
1
1
Detailed information not included in Appendix A. Please refer to your module documentation.
Product Overview Chapter 1
5
STEP 7--Micro/WIN Programming Package
The STEP 7--Micro/WIN programming package provides a user-friendly environment to develop, edit, and monitorthe logic needed to controlyourapplication.STEP7--Micro/WIN providesthree program editors for convenience and efficiency in developing the control program foryour application.To help you find the information you need, STEP 7--Micro/WIN providesan extensive online help system and a documentationCD thatcontains an electronic versionofthis manual, applicationtips, and otherusefulinformation.
Computer Requirements
STEP 7--Micro/WINrunson eitherapersonalcomputer or a Siemens programming device, such as a PG 760. Yourcomputeror programming device should meet the followingminimum requirements:
- Operatingsystem:
Windows 2000, Windows XP, Vista
- At least 350M bytes of free hard
disk space
- Mouse (recommended)
Figure 1-2 STEP 7--Micro/WIN
Installing STEP 7--Micro/WIN
Insert theSTEP 7--Micro/WINCD intothe CD-ROM drive of your computer. The installation wizard starts automatically and promptsyou throughtheinstallation process. Refer to the Readme file for more information about installing STEP 7--Micro/WIN.
Tip
To install STEP 7--Micro/WIN on a Windows 2000, Windows XP, or Windows Vistaoperating system, you must log in withAdministratorprivileges.
Communications Options
Siemens provides two programming options forconnecting your computer to your S7-200:a direct connection with a PPI Multi-Mastercable,oraCommunications Processor(CP)card with an MPI cable.
The PPI Multi-Master programming cable is the most common and economical method of connecting your computertotheS7-200. This cable connects the communicationsportof the S7-200 to the serialcommunications of your computer. The PPI Multi-Masterprogramming cable can also be used to connect other communications devices to the S7-200.
S7-200 Programmable Controller System Manual
6
Display Panels
Text Display Units
The Text Display (TD) is a display device that can be connected to the S7-200. Using the Text Display wizard,youcan easilyprogram your S7-200 to display text messages and other data pertainingtoyourapplication.
The TD device provides a low cost interfacetoyourapplic ation by allowing you to view, monitor, and change the process variables pertaining to your application.
The S7-200 product familyprovides fourTD devices:
- The TD100C has a 4-line text
display with2 fontchoices.
- The TD 200C has a 2-line text
display with20 characters per line for a total of 40 characters.
- The TD 200 has a faceplate which
provides four keys withpredefined, set-bitfunctions and allowsup to eight set-bitfunctions.
- The TD400C can have a 2- or
TD 100C
TD 200C
TD 200
TD400C
-
TheTD400Ccanhavea2o
r
4-line textdisplay depending on your font and characterchoice.
Figure 1-3 Text Display Units
For more information about the TextDisplay Units,refer to the SIMATICText Display (TD) User Manual on the STEP 7--Micro/WIN docuCD.
The Text Display wizard in STEP 7--Micro/WINhelpsyou configure Text Display messages quickly and easily. Tostart the Text Display wizard, select the Tools > Text Display Wizardmenu command.
Operator and To u ch Panel Displays
The OP 73micro and TP 177micro panels are tailoredtoapplications with SIMATIC S7-200 Micro PLC and provide operating and monitoring functions for small-scale machines and plants. Short configuration and commissioning times, and their configuration in WinCC flexible form the highlights of these panels. In addition,thesepanelssupportup to 32 configuration languages and five online languages, includingtheAsian and Cyrillic charactersets.
The mounting dimensions of the OperatorPanelOP 73microwith its graphical 3”displayunitare compatible with OP3 and TD 200.
Touch Panel TP 177microreplaces the Touch Panel TP 070/TP 170micro.It can be mounted vertically to accommodate
additionalapplication
s.Thisfeature
enables its use even when space is restricted.
Figure 1-4 Operator and TouchPanelDisplays
Text Display
7
Getting Started
STEP 7--Micro/WINmakes iteasy foryoutoprogram your S7-200.Injusta few shortstepsusing a simple example, you can learn how to connect, program, and run your S7-200.
All you need for this example is a PPI Multi-Master cable, an S7-200 CPU, and a programming device running the STEP 7--Micro/WINprogramming software.
In This Chapter
Connecting the S7-200 CPU 8......................................................
Creating a Sample Program 10.......................................................
Downloading the Sample Program 14.................................................
Placing the S7-200 in RUN Mode 14..................................................
S7-200 Programmable Controller System Manual
8
Connecting the S7-200 CPU
Connecting your S7-200 is easy. For this example, you only need to connect power to your S7-200 CPU and then connect the communications cable between your programming device and the S7-200 CPU.
Connecting Power to the S7-200 CPU
The firststepistoconnecttheS7-200toapowersource.Figure 2-1 shows the wiring connections for eithera DC or an AC model of the S7-200 CPU.
Before you installorremove any electrical device, ensure thatthepowertothatequipment has been turned off.Always followappropriate safetyprecautions and ensure thatpowertothe S7-200 is disabled beforeattempting to install or remove the S7-200.
Warning
Attemptstoinstall or wiretheS7-200orrelated equipment with power applied could cause electricshock or faulty operation of equipment. Failure to disableallpowerto the S7-200 and related equipmentduring installation or removalprocedures could resultin death or serious injury to personnel,and/or damage to equipment.
Always follow appropriate safety precautions and ensure that power to theS7-200isdisabled before attempting to install or remove the S7-200 or relatedequipment.
DC Installation AC Installation
24VDC 85to 265 VAC
Figure 2-1 Connecting Power to the S7-200 CPU
Getting Started Chapter 2
9
Connecting the RS-232/PPI Multi-Master Cable
Figure 2-2 shows an RS-232/PPI Multi-Master cable connectingthe S7-200 to the programming device. To connect the cable:
1. Connect the RS-232 connector (marked “PC”)ofthe RS-232/PPI Multi-Master cable to the communicationsportofthe programmingdevice.(For this example, connect to COM 1.)
2. Connect the RS-485 connector (marked “PPI”) of the RS-232/PPI Multi-Master cable to Port0or Port 1 of the S7-200.
3. Ensure that the DIP switchesof
-
-
12345678
RS-232/PPI Multi-Master Cable
S7-200
Programming Device
1--On0--Off
theRS-232/PPIMult
i-Mastercable
are set as shown in Figure 2-2.
Figure 2-2 Connecting the RS-232/PPI Multi-Master Cable
Tip
Examples in this manual use the RS-232/PPIMulti-Master cable. The RS-232/PPIMulti-Master cable replaces the previous PC/PPIcable. A USB/PPIMulti-Master cable is also available. Refer to Appendix E for ordernumbers.
Starting STEP 7--Micro/WIN
Click on the STEP 7--Micro/WIN icon to open a new project. Figure 2-3 shows a new project.
Notice the navigation bar.You can use the icons on the navigation bar to open elements of the STEP 7--Micro/WIN project.
Click on the Communications icon in the navigation bartodisplay the Communicationsdialog box. Youuse this dialog box to set up the communicationsforSTEP7--Micro/WIN.
Navigation bar
Communications icon
Figure 2-3 New STEP 7--Micro/WIN Project
S7-200 Programmable Controller System Manual
10
Verifying the Communications Parameters for STEP 7--Micro/WIN
The example project uses the defaultsettings for STEP 7-- Micro/WIN and the RS-232/PPI Multi-Master cable.To verify these settings:
1. Verify that the address of the PC/PPI cable in the Communicationsdialog box is set to 0.
2. Verify that the interface for the network parameteris set for PC/PPI cable(COM1).
3. Verify that the transmission rateis set to 9.6 kbps.
If you need to change your communicationsparameter settings, see Chapter 7.
Figure 2-4 Verifying the Communications Parameters
Establishing Communications with the S7 -200
Use the Communications dialogbox to connect withyourS7-200CPU:
1. Double-clicktherefresh icon in the Communicationsdialog box.
STEP 7--Micro/WINsearchesfor the S7-200 stationand displaysa CPU icon fortheconnected S7-200 station.
2. Select the S7-200 and click OK.
If STEP 7--Micro/WINdoes not findyour S7-200 CPU, check the settings forthe communicationsparameters and repeat these steps.
After you have established communicationswith the S7-200, you
coucatostteS00,yo
u
are ready to create and download the example program.
Figure 2-5 Establishing Communications to the S7-200
Creating a Sample Program
Entering thisexample of a control programwillhelp you understandhow easy it is to use STEP 7--Micro/WIN.This program uses six instructions in three networks to createa very simple, self-starting timer that resets itself.
For this example,you use the Ladder (LAD)editor to enter the instructions for the program. The followingexampleshows the complete program in both LAD and Statement List(STL). The network comments in the STL programexplain the logic foreachnetwork. The timing diagram shows the operation of the program.
Getting Started Chapter 2
11
Example: Sample Program for getting started with STEP 7--Micro/WIN
Network 1 //10 ms timer T33 times out after
//(100 x 10 ms = 1 s) M0.0 pulse is // too fast to monitorwithStatusview.
LDN M0.0 TON T33, +100
Network 2 //Comparison becomes true at a
//rate that is visible with //Status view. Turnon Q0.0 after //(40 x 10 ms = 0.4s), fora // 40% OFF/60% ON waveform.
LDW>= T33, +40 =Q0.0
Network 3 //T33 (bit) pulse too fast to monitor with
//Status view. Reset the timer through //M0.0 after the (100 x 10 ms = 1 s) period.
LD T33 =M0.0
0.4s
0.6s
Timing Diagram
current = 100
current = 40 T33 (current)
T33 (bit) M0.0
Q0.0
Opening the Program Editor
Click on the Program Block icon to open the program editor. See Figure 2-6.
Notice the instruction tree and the program editor. Youuse theinstruction tree to insert the LAD instructions into the networks of the programeditor by dragging and dropping the instructions from the instruction tree to the networks.
The toolbar icons provideshortcuts to the menu commands.
After you enterand save the program, you can download the program to the S7-200.
Instruction tree
Program editor
Figure 2-6 STEP 7--Micro/WIN Window
S7-200 Programmable Controller System Manual
12
Entering Network 1: Starting the Timer
When M0.0 is off(0), this contact turns on and provides power flow to startthetimer. To enter the contact forM0.0:
1. Either double-click the Bit Logic icon or click on the plus sign (+) to display the bitlogic instructions.
2. Select the Normally Closed contact.
3. Hold down the left mouse button and drag the contact onto the first network.
4. Click on the “???” above the contact and enter the following address: M0.0
5. Press the Return key to enter the address for the contact.
Figure 2-7 Network 1
To enter the timer instruction for T33:
1. Double-clicktheTimers icon to displaythetimer instructions.
2. Select the TON (On-Delay Timer).
3. Hold down the left mouse button and drag the timeronto the first network.
4. Click on the “???” above the timerbox and enter thefollowing timernumber: T33
5. Press the Return key to enter the timernumber and to move the focus to the presettime (PT) parameter.
6. Enter the following value forthepresettime: 100
7. Press the Return key to enter the value.
Entering Network 2: Turning the Output On
When the timervalueforT33isgreater than or equal to 40 (40 times 10 milliseconds, or 0.4 seconds), the contactprovides power flow to turn on outputQ0.0oftheS7-200. To enter the Compare instruction:
1. Double-clicktheCompareicon to display the compare instructions. Select the >=I instruction (Greater-Than-Or-Equal-To-Integer ).
2. Hold down the left mouse button and drag the compare instruction onto the second network.
3. Click on the “???” above the contact and enter the address for the timervalue:T33
4. Press the Return key to enter the timernumberandtomove the focus to the other value to be compared with the timervalue.
5. Enter the following value to be compared with the timervalue: 40
p
6. Press the Return key to enter the value.
Figure 2-8 Network 2
To enter the instruction forturning on outputQ0.0:
1. Double-clicktheBitLogic icon to displaythebitlogic instructions and select the outputcoil.
2. Hold down the left mouse button and drag the coilontothesecond network.
3. Click on the “???” above the coil and enter the following address: Q0.0
4. Press the Return key to enter the address forthecoil.
Getting Started Chapter 2
13
Entering Network 3: Resetting the Timer
When the timerreachesthepresetvalue (100)and turnsthetimer bit on, the contact for T33 turns on. Power flow fromthis contactturns on the M0.0 memory location.Because the timer is enabled by a Normally Closed contact forM0.0, changing the state of M0.0 fromoff (0) to on (1) resets the timer.
To enter the contact for the timerbitof T33:
1. Select the Normally Open contact from the bitlogic instructions.
2. Hold down the left mouse button and drag the contact onto the third network.
3. Click on the “???” above the contact and enter the address of the timerbit: T33
4.PresstheReturnkeytoenterthe
address for the contact.
Figure 2-9 Network 3
To enter the coil for turning on M0.0:
1. Select the outputcoilfrom the bit logicinstructions.
2. Hold down the left mouse button and drag the outputcoilonto the third network.
3. Double-clickthe“???”above the coil and enterthefollowing address: M0.0
4. Press the Return key to enter the address forthecoil.
Saving the Sample Project
After entering the three networksofinstructions,you have finishedentering the program. When you save the program, you create a projectthatincludes the S7-200 CPU type and other parameters.To save the project:
1. Select the File > Save As menu command from the menu bar.
2. Enter a name for the projectinthe Save As dialog box.
3. Click OK to save the project.
After saving theproject, you can download the program to the S7-200.
Figure 2-10 Saving the Example Program
S7-200 Programmable Controller System Manual
14
Downloading the Sample Program
Tip
Each STEP 7--Micro/WIN projectisassociated with a CPU type (CPU 221, CPU 222, CPU 224, CPU 224XP, or CPU 226). If the project type does not match the CPU to which you are connected, STEP 7--Micro/WINindicates a mismatchandprompts you to take an action. Ifthis occurs, choose “ContinueDownload”for this example.
1. Click the Download icon on the toolbar orselectthe File > Download menu command to download the program.See Figure 2-11.
2. Click OK to download the elements of the program to the S7-200.
If your S7-200 is in RUN mode, a dialog box prompts you to place the S7-200 in STOP mode. ClickYes to place the S7-200 into STOP mode.
Figure 2-11 Downloading the Program
Placing the S7-200 in RUN Mode
For STEP 7--Micro/WIN to place the S7-200CPU in RUN mode, the mode switch of the S7-200 must be set to TERM or RUN. When you place the S7-200 in RUN mode, the S7-200 executes the program:
1. Click the RUN icon on the toolbar or select the PLC > RUN menu command.
2. Click OK to change the operating mode of the S7-200.
When the S7-200 goes to RUN mode,
g
the outputLED for Q0.0 turns on and o
f
f
as the S7-200 executes the program.
Figure 2-12 Placing the S7-200 in RUN Mode
Congratulations! You have just completed your first S7-200 program. You can monitor the programby selecting the Debug > Program Status menu command.
STEP 7--Micro/WINdisplays the values for the instructions. To stop the program, place the S7-200 in STOP mode by clicking the STOPiconorbyselecting the PLC > STOP menu command.
15
Installing the S7-200
The S7-200 equipment is designed to be easy to install.You can use the mounting holes to attach the modules to a panel, or you can use the built-inclips to mount the modules onto a standard (DIN)rail. The small size of the S7-200 allows you to make efficientuseofspace.
This chapter providesguidelines forinstalling and wiring your S7-200 system.
In This Chapter
Guidelines for Installing S7-200 Devices 16............................................
Installing and Removing the S7-200 Modules 17........................................
Guidelines forGrounding and Wiring 20...............................................
S7-200 Programmable Controller System Manual
16
Guidelines for Installing S7-200 Devices
You can install an S7-200 eitheron a panel or on a standard rail,andyou can orientthe S7-200 either horizontally or vertically.
Warning
The SIMATIC S7-200 PLCs are Open TypeControllers. It is requiredthatyouinstall the S7-200 in a housing, cabinet,orelectric control room. Entry to thehousing,cabinet, or electric control room should be limitedto authorized personnel.
Failure tofollow these installation requirements could result in deathorserious injury to personnel, and/ordamagetoequipment.
Always followtheserequirements when installing S7-200 PLCs.
Separate the S7-200 Devices from Heat, High Voltage, and Electrical Noise
As a general rule for layingoutthedevicesofyoursystem, always separate the devices that generate high voltageand high electrical noise from the low-voltage,logic-type devices such as the S7-200.
When configuringthelayoutof the S7-200 inside your panel, consider the heat-generating devices and locate the electronic-type devices in the cooler areasofyourcabinet. Operating any electronicdeviceinahigh-temperature environment willreduce the timetofailure.
Consider also the routing of the wiring forthedevicesinthepanel.Avoid placing low voltage signal wires and communications cables in the same tray with AC power wiringand high-energy, rapidly-switched DC wiring.
Provide Adequate Clearance for Cooling and Wiring
S7-200 devices are designed for naturalconvection cooling. For proper cooling, you must provide a clearance of at least 25 mm above and below the devices. Also, allowatleast75 mm of depth.
Caution
For verticalmounting, the maximumallowable ambienttemperature is reducedby 10 degrees C. Mount the S7-200 CPU below any expansion modules.
When planning your layout forthe S7-200 system, allow enough clearanceforthe wiring and communicationscableconnections. For additional flexibility in configuring the layout of the S7-200 system, use the I/Oexpansioncable.
75 mm
Frontofthe enclosure
Side View
Mounting surface
35 mm
7.5 mm
1mm
DIN Rail
25 mm
Clearance
Horizontal DIN Rail Mounting with Optional
Expansion Cable (limit one per system)
Vertical Panel
Mounting
Figure 3-1 Mounting Methods, Orientation, and Clearance
Loading...
+ 524 hidden pages