Professional Documents
Culture Documents
STEP 7 in 7 Steps - A Practical Guide To Implementing S7-300 - S7-400 Programmable Logic Controllers
STEP 7 in 7 Steps - A Practical Guide To Implementing S7-300 - S7-400 Programmable Logic Controllers
ID
A Practical Guide to Implementing
S7-300/S7-400
Programmable Controllers
This book is dedicated to my friend,
Russell Briskey
II
•
ID
A Practical Guide to Implementing
S7-300/S7-400
Programmable Controllers
First Edition
C.T. Jones
Copyright© 2006 by C .T. Jones
ISBN l-689101-03-6
No port of this publication may be reproduced in any form o, by any means, nor be
translated or converted in a ny form. or stored in o dotobose. without written permission from
the copyright holder. Moking copies of ony port of this book witho ut permission is o violation
o f United Stoles copyright lows and is subject to penalty.
This book is sold as is, without •,vorronty o f any kind. either express or implied. respecting the
conten ts of this book, inc lud1ng but not limited to implied warranties for the book's quality,
performance. merchantability. or fitness for a ny particula r p urpose. This book is no t intended
to be. nor should ii be. used as a uthority fo r design. implementation. or ins1altotion of any
con trol systems. Such tasks should only be undertaken by trained professionals using curre ntly
accepted design and engineering p ractices. a nd the guidance of required user manuals.
Trademarks:
ET-200, S?-300, S7-400. HiGroph, HMI. SIMATIC. SIMATIC HMI. SIMATIC NET. SINEC, SOFTNET.
STEP, a nd WinCC, a re Siemens registered trademarks. O ther product names mentioned in this
book may be trademarks o r regis1ered trode marks of their respective companies. ond is the
sole property of their respective owners and should be treated as such. Furthermore. use o f o
term in this book should not be regarded as affecting the validity of a ny trade ma rk or service
mark.
With the exceptio n of screen captures. this book wos done entirely in Microsott Word. Screen
captures in this book were created using Full Shot 6.02. lnbit Inc .. Mountain View. CA.
IV
About the Author
C.T. Jones, rec eived his Bachelor of Science in Elec trical Engineering from Howard University,
ond hos mode his career in the Industrial Automation Industry for over twenty-five years.
During this time, he hos served bolh os o PLC user and in marketing, applica tions
engineering. and technical training roles for several automation vend ors. II was in the role of
Control Syslems Engineer, for Procter and Gamble, where his fasc ination wilh PLCs and their
endless p ossibilities in ou tomolion, drew him info this field. w hich he hos pursued since.
Early on as o Controls Engineer, he b ecome a cutely aware of the unique position of end-
users. who hove the tough balancing -act or keeping the pion! opera tional and sta ying
abreast of automation technologies. As o result, he authored two books on p ro grammable
conlrollers. including lhe first PLC book "Programmable Logic Controllers Concepfs ond
App lico fions." and "Programmable Logic Con trollers: The Complete Guide fo the
Technology." While serving eight years a s ap plications engineer and Technical Instruc tor for
SIMATIC equipmen t. he devoted much or his time lo developing step-by-step application
no tes and other educa tional materials for users.
For several yea rs now. C .T. has b een a SIMATIC consultant and freelance technical writer. In
this role. he hos worked with software companies in the develop men I of user
documentation, training and tu torial coursewore. and in product development involving
Integra tion with STEP 7. He also provides applic allons consulting a nd on.site training for end
users.
Acknowledgement
Garon Hort. Graphic Designer and friend. hos worked with me in the developmen t of books
since I started writing in 1984. Writing a book. Jokes o lo t of lime and involves mony costs.
along the way, for whic h writers usually cannot offer compensation. Garon, nonetheless. has
always been very generous with his time. skills, and know ledge. To put It simply. he has always
helped make it possible tor me to p roduce a new book. Thonks Garon!
I also extend thanks to Claude Kouokou, software developer and friend. During the
development of this book. I encountered many problems related lo early choices I hod
mode for the book's layou t and title. Claude, who during the tim e o f the books development
was writing cod e to integrate STEP 7 with ano ther software p a cka ge. was always my
sounding board. He always hod on uncanny way of making simple. that wtiich appeared lo
be insurmountable. Thanks Cloudel
V
About This Book
This book is organized in seven practical areas associa ted with getting the job done
efficiently. It is a task-oriented guide to configuring, programming, deploying,
troubleshooting, and maintaining S7-300/S7-400 PLCs and SIMATIC Networks. Each of the
seven ta sk areas is introduced with a brief tu torial that is fallowed by a number of ac tual
tasks. Each losk is presented in on identical two-page layout. On the left-hand page. a task is
briefly described under the headings - Basic Concept, Essential Elements, and Appllca tlon
Tips. On the right-hand page. the task is presented in a s1ep-by-step format.
At the time this bool:: was developed. STEP 7 was at version 5.2 and 5.3. Its usefulness.
however. should serve well into the future of new releases. This is true since the tutoria l
discussions at the beginning of each chop ler and for each losk example. ore based on
orchltecturol and operaHonol features and concepts, inherent to S7-300 and S7-400 PLCs
and SIMATIC Networks.
VI
Preface
It is easy ta say tha t this new book is for anyone involved wi th S7-300/S7-400 and SIMA TIC NET
networks, but in foci . this is the case. If you ore o controls engineer, responsib le for design
and programming, o maintenance technician, a n applications engineer, or sales
representa tive, you'll find that this book provid es much usefu l information. The book offers
significant cove-rage of configura tio n concepts. addressing memory and 1/0, programming
in STEP 7, defining network configurations, as we ll os a guide to using the tools for monitoring
the p rogram, and diagnosing problems In lhe hardware, software. or in the process.
II you ore a controls or applications engineer, your work will likely involve both configuring
the hardware and p rogramming for 57-300/57-400 and SIMATI C networks. You 'll find
examples of the most typical conflguro lions. os well as on explonolion tor various module
parameters. In most coses, you 'II find that the default parameters are g enerally usable, but
you will learn how to ob tain different operational behavior in the C PU and other modules.
The Chopler on Working with STEP 7 Programs ond Do to is a great re ference for learning
about program d esign. data types and forma ts, instru c tion sets. and how lo write cod e tor
Functions (FCs) and Func tion Blocks (FBsJ. You 'll also learn the basics for slruc luring a
program and call1ng blocks.
If you are responsible for maintaining on S7-300 or 57-400 system, then you should certainly
rea d chapters one and two to gain o basic underslonding of S7 hardware and STEP 7
software - especially navigating the SIMATIC Mana ger. Chapters Sand 6 o ffer many of the
tasks tha t will likely serve your needs, and in Chapter 3, you con gain on understanding of
how to configure new hardware and address the 1/0 system. While wrillng p rograms and
configuring networks may not b e your main concern, these topics are presen ted in on easily
understood format. So. don' t hesitate to use Chaplers 4 and 7. to broaden your knowledge
of STEP 7 program operation, the instruc1ion sefs, and how your p lant network is configured.
Much considera tion wen t into the content and the design for this book. I hove o ften heard
users speak of their difficulty in quickly getting their orn1s around the S7 implementa tion and
in determining where to look for pertinent information: so. my first goal was lo determine the
ta sks tha t as a user. you would eventually need to perform. Then. to present each of these in
a manner tha t would cover lne basic concepts of the task, the essential elements involved,
and then to present the task in a brief and ea sily understo od fa shion. The idea was lo gather
and e xplain in one place, topics essential to allowing you to get righl to the task.
Finally, how you should c onsid er using this book is largely linked to its design. Not every task
hos been included; how ever, you will likely find wh at you ore looking for. Should you read the
book from cover-lo-cover? You may if you'd like. but tha t is not necessary. If you ore a new
user, the tu torial at the b eginning of each chapter will be a good start. As your p roject c alls
for a sp ecific ta sk. turn to the appropriate chapter lo g el o quick introduc tion. Step-b y-step
procedures for several common rosks ore provided in every chapter. You con also use the
ind ex to quickly find and use a sp ecific task, and the Appen dices lo iind other useful
information.
vu
..
Contents
STEP 1: GETTING STARTED WITH STEP 7 ............................................................. 1
S7-300/S7-400 PROGRAMMABLE CONTROLLER STRUCTURE , ,.,,,,,,,., "" tctP ttttC t ..... "" "2
The Com o.n ents ............................................................................................................................................ 2
THE STEP 7 PRO,IEGT MANAGEMENT SYSTEM 4
Standard Tools and Utilities I Sltle: cntr 5 511 I 5111 e: r El Fl , re NEIil 4
0 tio-nal L-a n ua e Tools .................................... , u . . ..... .. . . . , . . . H u , . . . . . . .. . . . . . H . ...... . .... . . . . . . . . . . . . . . . ....... . . . . . . . . . . . . . . . . . . . . . . . . . . 6
NAVIGATING THE STEP 7 PROJECT $TRUCJ1JRE ... ,.........,. ................................,. ............. ,.........,. ••• , ...... , 38
NAVIGATING SIMATIC MANAGER MENUS AND TootBAR ..... ,,............................,. ...............,. ......,. .. ,,....... 40
X
Contents
CONFIGURING THE S7-400 AS A DP MASTER ,.... , ........... ,........ ,.... ,.. ,............ ,.... ,.......... , ......... , ...... , .. 140
CONFIGURING S7-400 LOCAL 1/0 EXPANSION.... , .......... ,.. ,...... ,.... ,.... ,............, .. ,.......... , .................... ,.. 142
CONFIGURING S7-400 REMOTE 1/0 EXPANSION .... , ....... ,.. ,................ ,.... , .... , ......................... ,.... ,........ 144
CONFIGURING S7-400 CPU GENERAl PROPERTIES ......................................................,,,,. .... ,,.,.,. ....... 146
CONE!GtfRING 57-400 CPI/ 5IARI•I/P PRQPfRilfS , " t '"" ''''"' 148
CONEIGI IRING 57-400 CPI I Cyc1 E AND CtQCJ< MEMORY .. ' t t t " t '
150
CONFIGURING 57-400 CPI/ RETENIII/E MEMORY ' " t t t
t '
152
CONFIGURING 57-400 CPI/ I OQAI lli1EMORY .. t t t t t ' t t " '
154
CONFIGURING S7-400 CPU DIAGNOSTICS ANO CLOCK PROPERTIES, .......... ,.,. .......... ,.,.., ......... ,..,. .. 156
CONFIGURING S7-400 CPU Access PROTECTION ............ ,..,. ...... . ,,,,.,,.,, 111 ·· 1,1111P1111110 ·· 111 t1P1:1:1u1 ·· 1 158
CONFIGURING S7-400 CPU INTERRUPT PROPERTIES ........ ,.,. ........ I I t f ' I I I I t f l f t .. I t I I tf P 111 I I t f l ·· I t I tf PI t IC 1101 I 160
CONFIGURING S7:400 CPU I IME-QF-DAY INTEBBLJ PTS 11111 !!Pit 11111111111111111100111111111111111S1111111111111neo11 1 1 6 2
CONFIGURING S7:400 CPU CYCLIC INTERRUPTS flllllltllllll ,, .. ,. tl'IIIIIIZ'llltt tl'IIIIIIZ'lllllltlfflllllltllllll flfllll 164
CONE!GllRJNG S7-400 DJGITAL INPUT MODULE PROPERTIES 166
CONE!GllRJNG S7-400 INIEBRl!PI INPUT PROPERTIES 168
CONE!GllRJNG S7-400 DJGITAL OUIP!IT MODULE PBOPEBIIES 170
CONF!GJIRING $7-400 DJGITAI 1/0 AODRESSES 172
CCNE!GI IRING $7-400 ANAi OG INPI IT MODI II E PBQPEBilfS 174
CCNE!GI IRING $7-400 ANAi OG INPI IT SIGNAi PARAMEIFBS 176
CCNE!GI IRING $7-400 ANAi OG 0! !IP! II Mon1/I f PBOPERTIES 178
CONFIGURING S7-400 ANALOG 1/0 ADDRESSES,.,.,,. .... ,.,,, , ......... ,, ........ ,,,.,.,,,. ,.,..,.,.,,. .... ,.,. ,.,.,,, 180
CONFIGURING 1/0 MODULES FOB MULTI-COMPUTING OPERATION .. ,,, ...... ,. -,.,.,,,.,,,,.,,, , ..,. .... ,.,,, , .. ,. 182
'
XI
STEP 7 in 7 Steps
STEP 4: WORKING WITH STEP Z PROGRAMS AND DATA ..... ,.. ,.., ..................... 185
INTROQLJCDDN IQ STEP 7 PROGRAMMING PRINGIPI Fs 186
Program Design Strategy............................................................................................................... 186
oYEBYI ew OE IHE LAD/EBD/STL EOIJOB "" .. d cc ut /o, tt l t i t · 1111ett1>te etcOt\tl e ltltCtt\ d cc ut,t,tec tt \ ,I cc .. 209
lnfraductlon ,209
Menus and Toolbar 209
Program Elements/Call Structure Window..................................................................................... 210
..
XII
Contents
NAVIGATING THE LAD/EBD(SIL EDITOR , , ...,.,. .. .,. ...... ,., ........ ,. ... ,. ,....... ,. .. .., .... .,.,. .. ,........ ., ..., ......,., 234
OPENING, EDITING. AND SAVING A B LOCK .. .. ......... .. .. .. ...... ............................. ......... ......... ........ ... ...... .... 236
DOCUMENTING A CODE BLOCK ,...... ,. ..... ,.. .,.,. .. ,....,. .. ,. ...., .... .,. ...... ,. ........ ,. ..... ,........ ,. ....,., .. ., ..., ......,., 238
xiii
STEP 7 in 7 Steps
XIV
Contents
USING D:1E HARD~/ARE DIAGNOSTICS UTILITY.. 11:lcl t It I 11 1111 I tt f I \ 11 1111 t tt f I I I t tnlt 11:lcl t I t n l t f ttrnlcf 338
LI SING JHE CPI l 01AGNQSIIC 6UEEf8 t t t 340
USING THE cpu $JACKS TO D IAGNOSE PROGRAM FA( ti TS 342
GENERATING AND DISPLAYING PROGRAM REFERENCE DATA It ti I I t n t f :I I t f It f n I t It 11 1 .. 344
STEP 7: WORKING WITH SIMATIC NET NETWORKS ........................................347
INIBQDUCIION IQ SIMATIC NET NETWORKS .....,......... ,.. ...................... .,. ................... .., ..................... 348
Netwodss and Subnets 348
CaMMl INICAJ1QNS CONNECTION$ ANO SERVICES 350
Communicallon Connections t t t t t t t
"'''' ''"' " 350
Comm11nicatioo Services 351
PRQFtaUS COMMUNICAIIQNS PROCESSORS ......... ,., .........................................................................,., 357
Profibus GPs for S7-300 and SZ-400 Stations .. .357
Profibus GPs for PC and PG/PC Stations . 358
ETHERNET COMMUNiCAIJONS PROCESSORS ...................... . " " Cf " " t
.. ......................................... 359
Ethernet CPs for S7- 300 and S7-400 Stations 359
Ethernet CPs for PC and PG/PC Stations 360
THE NETWORK CONFIGURATION TOOL ........... .................... ., .......... .,., ............................... 362
Configuring the Network ................................................................................................................ 362
Menu and Toolbar, ...... ... . . .. ..... . ............... ,, ..... . ... , ...... . ........... . ... 362
Network Com onents Catal Window ......... u• .... . . . . . . .... . .. .... . . . . . . .... . . . ... . . . . . . . .... . .. .. .. . . . . . . .. . . . ...... . . . . . 36-3
Configuration Window - Network layout ....................................................................................... 364
Confi uration Window - Connection Table.................................................................................... 364
Comments on Workin with SIMATIC NET Networks ................................................................... 365
Checklist: Workin with SIMATIC NET Networks .......................................................................... 365
BUILDING A NETWORI< CONFIGURATION USING NEJPRO .......................................... . ...................... 366
DOV~NI OAQING A NETWORK CoNFIGIIBAI(ON IJslNG NEJPBO 368
AQQING AND CoNflGI IRING AN MPI Sl lRNFT 370
6110 PING AN MPI NETWORK WITH PEER S7-300/S7-400 STATIONS 372
CONFIGURING A PROGRAMMING S TATION (PG/PC) ON MPI ....•................•........................•.. ..............•.. 374
Bun DING A PROJECT WITH S7-300 PEER PROEIBUS STATIONS ., .. . t<t C :Cit C Ot <> ttC,,c t tt > t ltC .382
INSTALLING, CONFIGURING, AND A TTACHING AN S7-400 PROFIBUS CP ................................................. 384
xv
STEP 7 in 7 Steps
XVI
Getting Started
with STEP 7
.... .... ....
Objectives
The Components
The S7-300 and S7-400 systems are both modular in nature, each built-up from the same
basic types of components. These components. listed below. o re briefly described later in
Chapter 4. The programming device provides the common user interface for creating.
storing, troubleshooting, and managing control programs. Each o f these component types
represent the various porls from which your S7-300/S7-400 system will be configured.
2
Gelling Started with STEP 7
Roil/RAC K
Power Supply
ln tertoce Modules
CPUs
CPs
FMs
SMs
0
S7 Station
- I1
II! :I- 11111
Figure 1-1. S7-300 and S7-400 Programmable Controller Structure.
3
STEP 7 in 7 Steps
Windows ul)dato
~ •. Proo.d not.es •
.. SIMAIIC NET ►
,.'-J
SIMAllC Mllllbger NCM S7 PRO!'lllUS
If,~ Prl)O'ams • •
• 57 1'.o,:p.ds
11'1-l
• 1z::1 Corl1QUrc Slt-'-ATIC Wori<sp:,ce
'
~ Oocume~
•..==-------- iffl Conf,guf'fl/1 Networl<s
,!,;, Corr,,;rtlng SSfi'el:
\ll> settnos • W ln>teled softw«e
~ 5-.fl • .I) Me1110<Y C..dP11rM1eltt ~ r t
• Hclp 0 PID Control Por,mete, Assi9rvnont
~ Settt,g the l'(;.PC Irlerfl!Cc
~ Run ...
t!l TI 405-57 G:nVl!rtlno TI Fil~s
Iii TI 505-57 ConvmlnQ Tt Fles
{s Notes
@!I ':il Pl.GIN Srnuletlnq ModJ.es
~
SIMATIC Manager
The SIMATIC Manager is the top-level toot for managing SIMATIC automation
projects. Other standard software components. for example the hardware and
ne twork configura tion tools and optional lang uage editors, once installed, may b e
la unched from the SIMATIC Manager.
4
Gelling Started with STEP 7
Configuring Networks
Th e Ne/Pro configuro tion toot allows graphical configuration o f the MPI. Profibus,
and Industrial Ethernet subnets. The tool depicts network stations. communications
interfaces. and physical connectio ns: it a lso supports setting of module a nd network
parameters and the creation of communications connections between partners.
Converting S5 Flies
The STEP S to STEP 7 Conversio n Utility allows existing STEP S programs to be converted
to equiva lent STEP 7 code. T11e purpose of the utility is to convert as muc h o f the
instruction set o f existing STEP 5 programs as possible to STEP 7. The conversion resu lt is
presented as Statement List (STL) instructions.
5
STEP 7 in 7 Steps
(s NOIS7 Jrdum,laJ,,,no, •
(s NP,~7 PROFl~S •
li'9 confll,Jro SIM'ITIC W-0115paco
~ conn~~ fl«wo<t,
/4 conweono SSfil!<
<i> ln,lc/led..i..-,....
li',i: I.JIO, S'l1., F!IO- l'ro9,_'9 S1 ll>crJ
lllJ M!,nor/ Ca,dPar-ter " 6 - ( "
E[°J ,_OIFi:e ~
12:l PIO Ccrbol P;,,•mct•• A s l ~
~ S.tu,g tho PG.pc: '"""'"'"
OpM Offlce 00clffl!r.t w Tl iOS-57 C:""...tlno lI FIOf
fl nsos-57conwetlno TI FI.,
\t,lrdow, ~ · (s NOl>\t •
(st,.Jtt,«:,W •
(s 0-....tooon
(sJ l'fC<MtnollbS ► iii S7HGlaphVS•l';<)l1"«m>no-•u4fl,s
► ca S!>'AllC t.Ef • ~ CfC • Wt<c,..- bb!~
~ S7 ~ • "'o;r- ,ng S7 lliclOS
•'1 s;J,'AllC 11'"""11e<
""Ill"""' •(a S7 .,..,..,., •
~ Oocun<ru •
'$ 5"~.lilQ!( I
~ S!!fch •
•
-~
t1d,,
/<uo ...
-!iJl Shl..l.~...
Figure 1-3. SIMATIC Start Menu wilh Standard and Op tional Tools
6
Gelling Started with STEP 7
S7-CFC
S7-CFC, or Continuous Function Chart, is o graphical programming tool. suited for
writing the code for operations thot ore continuous in na ture. CFC programs, also
referred to as charts, ore characterized by the interconnecting of canned
operations having d efined inputs and outputs. New functions may be created.
however most commonly required functions including arithmetic and logic, timers
ond counters. comparisons and conversions. trigonome tric functions and many
others ore already available. CFC allows complex programming of process
operations without focusing on the d e tails of the programming method.
Pro~•tt '"uo11er
S..uu>_ AVI corrr_c
Si1dt av•r.a ♦ Conc"ln\l.ou, tt:D
l BO IN -UO BO - BO 11.Ul 011
11 I N OUT JI
30 re n
0.
7
STEP 7 in 7 Steps
S7-Graph
S7 Graph is o llowchort•like lang uage involving sequences lhot describe the
operations of a machine or process as individual steps and lhe transitions between
each step. It is especially suited to sequen tial operations. A sequence may consist
of bo th sequential and concurrent palhs. The code describing the operations of a
step and the transitions between steps may be programmed in lhe lang uage of
c hoice (e.g ., LAD, FBD. STL. or SCL).
•• ••
,_ - l
~ II II -----------· ~an•l.
-. ----
Soes,l
S2
3ti<ep2 I\ "Dt:SUS'B"
I\ "DDSrTV''
. I\ "3CJ:TV\J'U
2
~ I I
............ -.
------
SJ
St:cp~
13oep3
S !"SCCTV\J" I
3
~ II 11 I ----·······- lt l::&J\!1 3
------
S4 ::,o•v•
3t.ep4 I\ ''SCtT\111''
I\ 11 DbLT1 II
~ II 11 I . --------. --
ss ...... ,.,:-e-,p-j-
.. 0-B_L_T_
l -
' '- - - - - - , ,
◄
'
"
.
..,.
Figure 1-5. Window w ilh S7 Graph programming.
8
Gelling Started with STEP 7
S7-SC L
Structured Con trol Language (SCL) is a textual high-level language which supports
PASCAL-like operations like FOR-NEXT Loop, IF-THEN -ELSE, CASE, DO-WHILE statements,
and variable declarations. S7-SCL simplifies the programming o f loops and
conditional branches. and is quite suited for formula calculations, complex
optimization algorithms, or th e management of large quantities of data. S7-SCL
supports developmenl o f sourc e files Iha! ore c ompiled into bloc ks lhol c on be
combined in an S7 p rogram with other blocks.
FlfNCTl:OH SQUARE: I MT
BEGDI
l:F value -<a 181 T HEN
SOUAI\E := value ~ value; //C alculates fun~1on value
ELSE
SQUAI\E - 32_7 6 7; // Sets ~aximUJD value if overflov
EJ\111 l:11 ;
ENJI FUNCTl'.ON
(Pl####l#f#l####l#l#IOll#########l########O#f####I#«########
Ne~t bloci< #1######### ##### ## #########1######## # #
### # # J
#############################################~############•)
CONST
LIMIT :~ 7 ;
END CONST
VlUl XN OUT
sortbu ffer · ARRAY ( □ . LIHI TI OE I MT;
END Vllll
VlUl OUTPUT
cAlcbu f far lUlllY IO.• Lil!IT I OF
STRlfCT
Figure 1-6. Window w ith S7-SCL (Structured Control Language); a text-based language.
9
STEP 7 in 7 Steps
S7-HIGraph
S7-HiGroph is a graphical language. based upon what is known as the "stole
machine" or "sla te diagram" method of programming. HiGraph is especially suited
for asynchronous operations. With this method. o system is broken down into
au tonomous functional units, each of which con accept various slates. The actual
behavior of each functional unit is described by what is called a stole graph. and
transitions ore defined to control the switching among these sla te graphs.
"""''
•w_o_·"
~-~~( ..
° ___.,,.
,-.,_-_
.... ..
~
••
'
11,• ..,• •:.v-41 n,1.1 ,,_ .,.._.
t ,II.lb• 0
•
r
.!.C
Figure 1-7. Window w ith S7 Hi-Graph; a slate machine programming language.
10
Gelling Started with STEP 7
Once you hove installed your software. become somewha t familiar with navigating the
SIMATtC Manager software. and performed some of these important p reliminary tasks. you'll
be ready lo proceed to the first step of Working with your STEP 7 Project.
• lnsloll NCM for Industrial Ethernet and NCM for Profibus. during lhe Installation
ff these networks will be lnstolled.
• Install Avthorlzafion keys for NCM Industrial Ethernet and NCM Profibus, if
these packages were installed.
• create Windows folders lor holding STEP 7 projects, Ubrories, and archives.
• From the SIMATIC Manager, define STEP 7 language, storctge path, and
archiving, and other operating preferences.
• Establish a ph~ical connection between the CPU, of your initial work, and
the programming system (PG/PC} vsing serial cable ond PC Adopter
(adapter only for PC),
• Set the PG/PC interface to PC Adopter, for STEP 7 online connections to the
programming system.
11
STEP 7 in 7 Steps
Essential Elements
In addition to the Basic STEP 7 package, STEP 7 releases ofter 5.0 include: (1) A crobat Reader,
softwa re for o pe ning and viewing user manua ls, a nd other rela ted documenta tion; (2/ NCM
for Industria l Etherne t , the Ethernet config uratio n software; (3) NC M for Pro/ibus, the Profibus
configuration software; and (4) Au thorsW, the Windows program for installing and removing
authorizatio ns for sta ndard and optional toots.
Application Tips
If Ethernet and Profibus network m odules ore no t visib le from the SIMATIC Ma nager projec t
tree or ovoilobte In lhe hardware configura tion, then it m ay be tha t NCM Profibus and
Ethernet p ackages have not been installed. Re member, a lthough included on the standard
CD, a sepa rate license must b e p urchased for these NCM packages.
Components
Programs to be iMtalled
·. ;___<_J!_ook
_ _,[__ _
ll_e_
x t_
>_ _.! __c_an_c:e_l_...l
Figure 1-8 . STEP 7 Setup dialog for selecting Install components.
12
Gelling Started with STEP 7
r Setupsprache: Deutsch
f.' Setup language: f.nglsh
r langue d'll'lstallation; Frani;ais
C" lcioma de instalaci6n; E~ai\ol
r Lingua di installazione: !taliano
SIEMENS
-
_ _«_[ a
_~______l. __N
_e11_t_> _ ..., _ _ l
c_an_c_a_.....
Figure 1-9. STEP 7 setup d ia log for selecting native languages to install.
ACTION
1
2 If the installation is on upgrade to a STEP 7 versio n o lder than V3.2. then the previous
version and all optional packages must be removed prior to the new installation.
3 Ensure tha t your PC hard d rive hos a dequate space for the installa tion. Depending
o n your component selection from 200-380 MB will be required.
4 From the Windows Explorer navigate lo the SETUP.exe installa tion program on the
STEP 7 CD and double -c lick on th e p rogram to start the installa tion.
5 From the STEP 7 Setup d ialog Setup Language, c lick and select the language o f
c ho ice to use for the STEP 7 installatio n se tup d ia logs.
6 From the STEP 7 Setup dialog Components. place a check mark in each box to
select whot software components should be installed.
7 From the STEP 7 Setup d ialog Install Language - Specific Files. p lace a check mark in
the box besides each native language in which STEP 7 should be available.
8 From the STEP 7 Se tup d ialog Start-up Language. click and select the language of
c hoice to sta rt-up with whe n STEP 7 is launc hed.
9 Answer re ma ining questions as the setup program guides you through the
installation.
10 Toward the end of the installation, you will be g iven the option to allow the setup
program to install the STEP 7 authorization. Simply insert the diskette when prompted.
13
STEP 7 in 7 Steps
Essential Elements
The yellow STEP 7 Authorizatio n disk. provided with STEP 7, supports management of multiple
oulhorizolion keys as shown in the dialogue below. Each optional package requires
au thorizatio n and is p rovided w ith its own au thorization disk if p urchased separa te ly. Once
on authorizatio n is installed on the drive, when later removed it may be moved back to the
STEP 7 mulli•authorizotion d isk for central management.
Application Tips
By default. authorizations ore placed in a hidden folder, C:\AX NF ZZ. This folder must not be
deleted, copied, or moved. Authoriza tions should be removed before performing disk
opera tions such as ghost.imaging or de-fragmenting. If o drive is compressed, authorizatio ns
should be placed o n th e host drive. In the event the authorization for STEP 7 BASIS is lost. a 14-
doy Emergency key is provided on the yellow disk, to be used until the lost key is replaced.
14
Gelling Started with STEP 7
ACTION
Install Authorization:
2 From 1he Windows Start (bu llon) , selec t SIMATIC, ► AuthorsW folder. ► AuthorsW.
3 Selec1 1he Transfer tab. to lis-1lhe authorizalion keys fo und on lhe diskette. if It is nol
already displayed. The counter value lor the key must be " l " on the d iskelte.
4 To install the authorizatio n on the hard drive, find and select from the window
displaying 1he aulhorizalions. the correct version of STEP 7-BASIS for unlimited use.
5 With 1he key selected. press the install b utton -+ lo p loce the authorizatio n on lhe
hard drive.
6 Remove lhe aulhorization d isk from the d rive and store until required again.
Remove Authorization:
2 From the Windows Start (bu tto n). selec t SIMATIC ;.AuthorsW.
3 Select lhe Transfer tab. lo lisl lhe aulhorizalions, ir it is not already displayed.
4 To remove lhe authorization from th e hard drive, select lhe STEP ?-BASIS key from the
window displaying the aulhorizations round on lhe hard d rive. The coun ler value for
lhe key must be "O" on the d lske lte and " 1" on the ha rd drive.
5 Press the remove button ~ to return the authorization to the aulhorization d isk.
6 Remove the a uthorization disk from the d rive a nd store until required again.
15
STEP 7 in 7 Steps
~ AuthorsW
,:U Documentation ► II English
WlnZ'ip Cs Product notes ► D Deutsch
. ...
~" Ji
Te.mp ►
SJMATIC NET
STEP 7
►
►
~
• ~!~:1 Progr-ams ►
.~ 57Manuals
SJMATIC Manager
►
~ Documents ►
~ Settings ►
Search ►
~ Help
• ~ Run .. .
-
Figure 1-11. Opening SIMATIC Software Components from Windows Siert Menu.
16
Gelling Started with STEP 7
Name ...
mFms:l Steps with S7 Graph
~ S7 Graph · Progianming Sequential Control Sl'$(ems
;!\'g S7-GRAPH • Fir~ Steps wrth S7 Graph
,:J s7-PLCSIM • Tetting Your S7-CPU Programs · manu~
l
· ~ S7-SCL · Working with S7-SCL
ffl s7-SCL for S7-300 and 57-400 • manual
ffls TEP 7 • Conliguling Haidware with STEP 7
. STEP 7 · From 55 to S7
STEP 7 · Function Block Diagram for S7·300 and S?-400
STEP 7 · Laddel Logic for S7-300 and S7-400
~ STEP 7 • Modifyr,g the SY$1em During Operation via CiR
ffl STEP 7 · PID Contiol
lj STEP 7 · PIO Ternperature Control
.m STEP 7 · Programming with STEP 7
. ~ STEP 7 · Stetement Li$l for S7•300 end S7-400
;11 STEP 7 · System 11nd Standard Functions lor S7-300 and S?-400
ffl sTEP 7 • System end Standard Functions for Tl·S7·Converle1
m STEP 7 · Working with STEP 7 ...
~ fi•
j22 ob,eeUs) Lf.J
My Co~er
Figure 1- 12. Shor1cu1s to typicol ins1olled S7/STEP 7 documenlotion.
■ 1
ACTION
Click Start ► SIMATIC ► AuthorsW ► AuthorsW to open the u tilily is used 10 install ond
remove software ou1horizations.
2 Click Start ► SIMATIC ► Documentation ;.. English (or Deutsch, French, Italian. Spanish)
lo locale STEP 7 documen1otion in one of lhe installed no1ive languages.
3 Click Start ;. SlMATIC ► Product Notes ► English (or Deutsch, French, Italian. Spanish) 10
locale Important product notes not inclu ded in the user manual a t release.
4 Click Start ► SIMATIC NET; lo a ccess configuration or diagnostic tools for Industrial
Ethern et. Profibus. or other installed SIMATIC NET componen ts.
5 Click Start ► SIMATIC :.- STEP 7 ► to access standard editors and u tnities (e.g.
LAD/ FBD/ STL) or op tional editors (e.g., CFC) and utilities if they have been installed.
6 Click Start ► SIMATIC ► SIMATIC Manager; or from your desktop double•c lick on the
SIMATI C Manager icon lo open lhe SIMATIC Manager program.
7 Click Start ► SI.MATIC ► S7 Manuals lo locale other rela ted user manuals that hove
been installed (e.g., optional packages).
17
STEP 7 in 7 Steps
Essential Elements
The multi-user configuration is possible for workstations on NT and Novell networks, ofter each
workstation is configured using the Configure SIMATIC Workspace utili1Y. to operate in o multi-
user environment. Shored projects may be p laced on a local drive. o f one workstation and
accessed by all other stations. or on a network server. where other workstations access the
server. Shored projects may also be distribu ted among the local drives and one or more
network servers. and all works ta tions have access to all projects.
Application Tips
The multi-user configuration is possible for workstations on NT and Novell networks. ofter each
workstation Is configured using the Configure SIMA TIC Workspace utility. to operate in a multi-
user environment. The shored project or projects may be p laced on o local drive of one
workstation and accessed by all others; or on a network server. and other workstations
access the server; or distributed among the local drives and one or more network servers.
and all workstations hove access to all projects.
i) !'n_ , i l li
CorJiguration Notes W01krtation Cor{tgt.1ation J TCP/IP Conliguration fo, Mutiple Node S~tems l
Network Topology Configuration Settlnge
You m.a_y configure you, sysll!lll ~ • ~ $Ingle 01 multiple node sysll!lll. When coolig.Jring a multiple node
sy;lem. ~ is important to ensure Iha! the prope, ne(work prolocol end ackli= ae used
!i:!_1
~ r Single node sy~em
M NetBIOS
~p r ll¾'SP.I<
~I~ r♦' Mukiple node system
P' 1CPt1P
..
I Seivet was started w~h protocols.
18
Gelling Started with STEP 7
i31Ili,i't11ii1f#td-Jii1Mtiffiil·· ) I - - - -----
I
Con/igLriKion Notes W ~ c.orligv,~on TCP/IP ConfQ!la!ion 101 Mutt:>le Node Syiterl\$ j
Cletll aoo Set vet IP P•ameter OonR11111 .tllon
Mutipl,e nelwork ~ ,cl$ ~n be p,-nt i, JIOl.f s;,1lem. ~
rrust lhen be indMcl~ oonf9)1ed Ada ei no.: IPAddtett
Adcftional in/om,olion ii ovaW,lc fn the onlno help.
0 169.254.91.6
1 169 254.150 53
.OB Serve,
r Only u;e Utt host Cldaeu
j
r
08 Cier1t=========================
r. F"nd •~lngs f1om IP p111<!1nele,s ~ 1254 .1
~ -~
r Use the tob.w,g eddieu: ~ - ~ . J:-.l!i 1255
II 1
ACTION
From lhe Windows Start bu tton, select SIMATIC ► STEP 7 ► Configure SIMATIC
Workspace to open the workslotion configuration dialog.
2 From the Configuration Workstation dialog, select the Workstation Configuration lob.
3 Select Single Node System. if the workstation will work atone on STEP 7 projects on the
local drive, and not access projects on o centra l server or on other workstations.
5 Selecf the communication protocols tha t may be used for communica tion by this
worksta tion (e.g., TCP/IP, Net-BIOS, or /PX/SPX}.
6 If TCP/IP is used, select lhe TCP/ IP Configuration for Multiple Node Systems tab; selec t
the network adapter if multiple cards are installed and set the workstation IP address
8 Under the DB Client box, choose the setting Find settings from IP Parameters. to allow
the wor1<.stolion client to obtain its IP parameters dynamically; or use the field
designated Use Following Address, lo set the IP address for lhe c lient. This se tting allows
you to specify the broadcast address to be used for the corresponding subne t when
more than one subnet exists. If several cords exist, adopter O is used to determine the
b roadcast address.
19
STEP 7 in 7 Steps
Essential Elements
The Essential Elemen ts of this task involve defining or, if necessary. c reating the d efault
d irectory poths for STEP 7 projects ond libraries. Since b y defoull STEP 7 stores projects in
Siemens\STEP 7\S7 _Pro]. ond libraries in Siemens\STEP 7\S7_lib. you moy wont to ensure that
your project work and tibrories are p laced in the right location in your compuler's file system.
Application Tips
Each newly created p roject and library is crea ted in the defoull poths currently set in STEP 7.
To avoid loss o r pro]ec l data ii is recommended that you ploce project folders on o drive
o1her thon the one where th e Windows swap file is loca ted.
Customize
Figure 1- 15. STEP 7 Customize dialog for d efining Project/Library storage pa ths.
20
Gelling Started with STEP 7
■
ACTION
1 Create o new folder for your STEP 7 projects (e.g., C:\S7 _Projects). Each newly creeled
projec t is generated in o sub folder. inside of the main project folder that you creole.
2 Creo le o new folder for your STEP 7 libraries (e.g .. C:\S7_libraries). Each newly created
library is generated in o subfolder, inside of the main library folder that you creole.
3 Launch the SIMA TIC Manager and from the menu select Options ► Customize.
4 Open the General lob lo define your default storage path settings.
5 Type a folder path in the "Storage Location for Projects" field. or use the Browse button
to find and select a folder to hold new projects (e.g., folder created in Step I).
6 Type o folder polh in the "Storage location for libraries" field. or use the Browse button
to find and select a I older to hold new libraries (e.g .. folder created in Step 2).
7 Activate the Open New Objects Automatically check box. if you wish to hove each
newly generated objec t (e.g.. stolion. block, or subnet) open automatically in its
associated editor or tool ofter it is created.
8 Place o check in the Archive Automallcally check box. if you wish to hove o backup
copy mode of the los t revision of your project or Obrory on each new opening o f the
projec t or tibrory,
9 Close on STEP 7 tools and the SIMATIC Manager orter any changes to the General tab.
for changes to take affect: then reopen STEP 7.
21
STEP 7 in 7 Steps
Essential Elements
This task involves setting th e na tive language to use iF mutliple languages hove been
instatted; and to ensure that address mnemonics to be used in th e p rogram a re set lo your
choice. The mnemonics setting determines whether Germon or English instruction operands
and address identifiers will be used as you create and d isplay your program. If the
mnemonics a re set differently from what you expec t and are using, errors will be reported as
you enter your p rogram.
Application Tips
By default. after initial instoflolion. the language setting for the program mnemonics is
German. English is the only other choice. II any language change is mode. STEP 7 and on of
its components must be closed and restarted for the change to toke affect.
Customize
Language f General] I I
View ] Gok.lmns Message nutrbefs AichM'lg I
Naoonal Language Mnemonics
l!!nglish £><ample 1 E~ample 2
deuttch r Geiman U El.O S A4.0
• r. English
lra~ais A 11.0 S Q4.0
espenol
ila~ano
OK
CT J
Figure 1- 16. STEP 7 Customize dialog for defining Language preferences.
22
Gelling Started with STEP 7
1 launch the SIMATIC Manager and from the menu select Options ► Customize.
3 Under lhe National Language lisl box, if multiple languages were installed you will see
the curre nt setting in the field just above the list box.
4 Setecl the native language of choice (e.g. English) to use within the STEP 7 application.
5 From the group box labeled Mnemonics, select English or German, lo determine what
instruction mnemonics ore lo be used in your programs ( e.g.. set for English I = Inputs.
Q = Outputs; set for Germon, E =Inputs.A= Outputs).
7 Close all STEP 7 tools and the SIMATIC Manager ofter any changes lo the Language
lob, for changes to take affect then reopen STEP 7.
23
STEP 7 in 7 Steps
Essential Elements
Setting preferences for archiving involves d efining and. if necessary, crea ting the defa ult
archive d irectory path for storing backups or STEP 7 p rojec ts a nd libraries; and defining lhe
d efault directory path in which projects should be placed upon re trieving and archived
c o py. In addition the program (e.g.• WinZip) to use for a rc hiving projects or libraries must be
specified.
Customize ~.
OK
Figure 1- 17. Customize dialog for defining Project/Library a rchiving preferences.
24
Gelling Started with STEP 7
■
ACTION
1 If you Intend to hove STEP 7 outomoticotty archive your projects, you may wish to
crea te a new folder for this purpose if you have not already done so (e.g.,
S7..Archive_Prol).
2 Launch the SIMA TIC Manager and from the menu select Options ► Customize.
4 From lhe "Preferred Archive Program" drop list. select the program to use in creating
archives (e.g .. Win Zip). Use the Configuring button to find and poinl to its location.
5 In the Archiving field. define a target directory and activate the Use checkbox if this
direc1ory should be targeted first for storing archives (e.g., folder crea ted in Step 11. If
the "Use" check box is not activated, then archive projects will be targeted for the
location last used for storing archives.
6 In the Retrieving field, define a target directory and activate the Use checkbox if this
directory should be searched first when retrieving an archive project: If the "Use"
check box is no t activated, the search for archives w ilt start in the directory used lost.
7 Activate the Check Options check box, to cause the archiving dialog to be
presented each time you archive mes. This se tting is ignored if LHARC. PKZIP 2.50. or
WinZip is set as the "Preferred archive program".
8 Activate the check box for Check Target Directory, lo cause o directory selection
dialog presented on each archive retrieval. This dialog allows you to specify o
directory in which lo restore a retrieved archive project. Otherwise, archived projects
and libraries ore restored to their respec tive default STEP 7 projec t or library directory.
9 Activate Iha Generate Archive Pafh Automatically check box. to have the name of
the archive file automatically derived from the name of the project to be archived.
The direc tory selection dialog is not presented.
25
STEP 7 in 7 Steps
Essential Elements
With the PC adapter (PN 6ES7-972-00A22-0X), and the standard serial coble (PN 6ES7-901-
IBFOO-OX) you ho ve all that is required for the online conneclion too CPU via ils DP/MPI port.
An off-the-shelf serial coble w ith 9-pin connectors and the appropria te gender may be
substituted for the previously mentioned serial coble. The PC Adopter perform s the
conversion to allow the sta ndard RS232 serial port on your PC lo support online connection to
the MPI/Profibus-DP port of an S7-300 or S7-400 CPU.
PG/PC
S7--400
MPI/DP
Conn~ctor
Serial
Cable
26
Gelling Started with STEP 7
ACTION
1 Se t the slide sw itch on the PC adopter to ei ther 19.2 or 38.4. according to your
required transmission speed. This setting mus! match the transmission set in !he MPI
Poro meters.
2 Connect one end of the serial coble lo the RS-232 connector on the PC Adopter.
3 Connec t the opposite end of the serial coble to the RS-232 serial porl of your PC.
Connect the opposite or cable end o f th e PC Adop ter. marked MPI/DP, to the
MPI/DP port of the CPU to which lhe online connection is being established.
5 With the coble in place the STEP 7 online interface must b e set to use the PC
Adopter.
6 From the SIMATIC Manager menu. select Options ► Set PG/ PC Interface to launch
the utility for setting the online Interface for the PC or PG programming system.
7 Ensure thol lhe lleld labeled "Access Point of lhe Application" ls set as follows:
S70NLINE (STEP 7) ~ PC Adopter.
27
STEP 7 in 7 Steps
Essential Elements
Setting the PG/PC Interface is to assign on " Interface Poromeler" set to the S70NLINE access
point. The "Access Paint of /he Application.'; is the uniq ue name, known to on application
(in this case STEP 7). tha t g ives ii the connection info rmation b y w hich it makes on o nline
connec tion. The Access Poin t is linked to on Interface Parameter Assignment, which defines
a specific Interface (i.e., pro tocol driver and/or network interface) and its set properties. The
interface parame ter in this case is ''PC Adopter." The assignment the n would be S70NLINE
(STEP7). bound lo the PC Adopter (MPI): the selection is shown as S70NLINE (STEP7) + PC
Adopter (MPI).
Application Tips
A direct connection may also be required ii network connections tha t allowed remote online
connection lo a CPU ho ve been lost. Direct connection is no t o nly possible with the PC
adopter. b ul a lso in the case where the PG/PC hos on installed MPI cord that allows
connection to a CPU's MPI programming port.
Access Palh I
Access Point of the Applic.ition:
I.;,7ilNLIME i&TEP7J pr Adai>1e1tMPI) 3
(S tandard lor STEP 7)
~ Interfaces- - - - - - - - - - - - - - - - - - ,
Add/Remove'. Seleel..
l
OK
I Cancel Help
I
Figure 1-19. Dialog for defining PG / PC Interface connection.
28
Gelling Started with STEP 7
1 Launch the "Setting the PG-PC lnlerface" utility rrom the SIMA TIC Manager menu.
select Options ► Set PG/ PC Interface.
2 Once lhe Selfing /he PG/ PC Interface dialog Is presented. ensure that the S70NLINE
(STEP 7) access point is displayed in the field labeled "Access Poin t of the
Application."
3 The current setting for the Interlace Parameter Assignment is displayed to the righ1
of the S70NLINE (STEP 7) access point. ofter the symbol (+ ). If no interface hos be-en
selected. w ha l sho uld be displayed is 'S70NLINE (STEP 7) + None'.
4 From the Interface Parameter Assignment Used" list box, click on and selec1 PC
Adapter (MPI) as the interface parameter to se t o s the S70NUNE interface.
5 Once lhe selec tion is made the Access Poin t o f 1he Application will renect the newly
selected interface. The setting should show S70NLINE (STEP 7) + PC Adapter (MPI) .
6 Setec1 the Properties bulion to set opera ting parameters of the PC Adopter
interface (e.g., Transmissio n rote}. This setting must molch the switch setting on lhe
adopter. If you set the adopter to 38.4 K Baud, I hen the d ia log setting must be set to
match.
7 Press OK lo save p roperties and se1 the interface for the new S70NLINE connectio n.
29
Working with STEP 7
Projects and Libraries
Objectives
In the SIMATIC Manager. multiple projects may be opened simultaneously. Two STEP 7 project
windows ore shown opened below. As seen in the two windows. a p roject may vary in size
from o slngle machine involving one PLC. to on entire p lant involving many PLCs and
networks. Also illustrated ore some of lhe objec ts tha t you will work with under the SIMATIC
Manager [e.g .. SIMATIC PLCs. PG/PC programming systems. and networks.
So,ter_3
PG/PC(l )
MPl[l J
PROFlBUS[l ]
Figure 2- 1. (a) Project with Single PLC. (bl Project with multiple PLCs and networks.
32
Wor1-ing with STEP 7 Projects ond Ubrories
Project Objects
Under the SIMATIC Manager, the objects of each project are presented in a split window.
Objects contoining other objects ore connected in the tree structure o f !he left pone of the
project window, while i1s contents ore d isplayed in the right-pone. The hierarchy of the
objec ts in the tree is based o n the physical relationship they hove within o real project. The
Project. which contains oil o ther objects, is at the lop. Next is the SIMATIC Station. which
represents o PLC. A project may contain several stations. Each station conloins o CPU; and
each CPU contains on S7 Program. Each p rogram contains o Source Flles and o Blocks
!older. The Source folder contains user-created source text files: the Blocks folder contains
blocks of the user program.
Progra ms in a library ore simply a method of mainta ining code that you wish lo keep and
perhaps use a t another time. Like o project. o library is developed in the SIMATIC Manager.
where you may insert as many program folders as needed. Program folders may also be
copied from o project to o library.
33
STEP 7 in 7 Steps
In addition to libraries that you might creole. there ore also libraries o f conned functions
available for purchase to S7 users. There is olso the so-coiled Standard library. which is
included in lhe STEP 7 Basic package. The Standard Library is shown opened in the window
below. The library hos seven program folders. which hove been renamed according lo the
type of b locks that each contains.
_ox
S t:] Comment
IE @I uirmu,iu,llon Block• ',,1Communlcabxrt Blocks S7Ptcgcm h.ncbcrn (FC) for the d:slrbuted 1/0 and fDL cam(
ff) @I IEC Function Bk>cki SJ IEC Func:lion Blocks S7 Plog,r..-n blocks foi IEC funciicn, (IEC lrlernolionol Elcc~ok
t!l' fill Org,orization Block• ';,I Organizal.,., Blocks S7 Ptcg,rn slandNd orgonrzabon Mock• roe I
[El @I PIO Con!lol Blcct.t
.!!) PIO Conticl Block, S7PlcgMI h.nc6t:n blocks (FD Ifor PIO con!rcl
lfl·@J S5-S7 COl\Vejthl B~k.s
~ uiJ Syttem F~noticn Bloclw
al 55-S7 Conve~ing 81:>d(i S7 Ptogi.m blocks for c0nve1tr,g STEP 5 pro,ramt
IE·@! Tl•S7 Converlfng Bbckt 1f.l Syolern Functi>n Bk!ciu S7 PtC9i""' oytlan lunci!l:lnt (SFCJ ond oyllem functrc.n blocko
:?fl TI-S7Convernr,;i Blocks s1 Proor.m blocks foi conve,tng Tl ~~ams and le, oene,af u
f
Figure 2-4. STEP 7 Standard Library, delivered w ith the STEP 7 Basic package.
Blocks thal ore integrated as port of S7 CPUs. for example organization blocks and system
blocks, ore included in the Standard library so that they may be used during offline
developmenl of your control program. Since these b locks ore actually incorporated in lhe 57
CPU operating system. the library versions of these blocks are nol actually code. The library
conloins the colling interface in the case of System Functions (SFCs) and System Funclion
Blocks (SFBs). and the declaration loble In the case o f orgonlzolion blocks.
IEC Function Blocks Loadable functions lor editing variables w ith complex dolo
lypes (STRING. DATE_AND_TIME).
Organiza tion Blocks Templates for the standard organization b locks; essentially the
required 20-byle variable declaration loble for each OS's start
lnformolion. The ocluol code of on O B is in lhe S7 operoling
system.
S5-S7 Converting Blocks Loadable funclions for 55 -to- S7 conver5ion. The blocks also
replace S5 standard function blocks as port of the conversion.
System Blocks Contains the colling interfaces for S7 System Functions (SFCs)
and System Function Blocks (SFBs), to allow incorporation into
!he user program duri ng offline development.
.
TI-S7 Converting Blocks Loadable functions for the TI 505 -to- S7 conversion. The blocks
replace Tl standard function blocks as part of the conversion.
34
Working with STEP 7 Projects and Ubrories
Slep 7 Toolbor but tons, os briefly described below, represent the mosl frequently used
operations or tools of lhe SIMATIC Manager. Toolbar buttons are a va ilable for performing File.
PLC, Edil, and window View operations. There ore a lso buttons to launch some of the
important software tools like the Ne/Pro Ne/work Configuration and Find Active MP/ Nodes.
Tab Ie 2•.
2 SIMATC
I Manoaer T00Ibor Icons.
Icon Toolbar Function Icon Toolbar Function
[I!] Find Active MPI Nodes (:8 Display Objects as Small Icons
~ Download lo CPU
~ Toggle Simulation Tool ON/OFF
35
STEP 7 in 7 Steps
Project Windows
The SIMATIC Manager allows the STEP 7 prajecl and its objects to be opened and displayed.
When navigating downward through the STEP 7 object tree, when on object containing other
objec ls is o selec ted. the object opens as o folder with its contents displayed in the right-
pane. Object a t the lowest level of o container objec t do not con tain other objects. and ore
always listed in the right-pone. Double-clicking on on object a l lhe lowest level of o
container causes the object to open in its associa ted editor. Block objects, wt1ich ore
con tained in the Blocks folder for example, ore opened in the LAD/ FBD/STL editor, unless the
block was compiled from o source editor, in which case the associa ted editor opens.
Offllne Window
The offline window of o project, displays components of the p rojec t thoi ore contained in
o fmne mes slored on your PG/PC. All or lhe documentation associated with lhe programs
and contigurotion data ot a project are stored in the ottline files of the project. Therefore.
when you go online with o CPU program without the use o f the project. offline commen ts
and data ore not generally available. Although in some later CPU. comments and symbol
address information may be stored in the CPU.
_ 0 X
S- . M41""9..A106
tffl,- ·--............_,.,.......,~.....___,......... ,_,....,__, ·-··-·-'--'-•-.................... - ....___._.... ~•....-...............__ -"•···~
El (ij) ~iMA11C 401(1J
S Iii CPl.l41 3·1 "'--1~~!'! ~9~" ::: ..... ... --~;._ -~.Q.!t ••. ... - .!.~9.~.?0~ .!1-~~3 ....:::
0 0 B1 LAO Or!IOr,,l!ljQn .,. 1112.2003 12:24.SO
I?. !ii] S7 f'loo,,rr{l I OF8100 LAO fU'ICli>n Block 1811 tll03 1114,32
I (DJ So,,c.,. O FCI LAD fu>c:6:rn l&.03.2004 21 5l:J9 Sr.ola Ladder Loi
' 0 Block> f"1Clnn 08.112001 14 3803
O fC2 LAD Sr.cle Ladoo, Loi
O FC3 LAD Fr.noc»n 14 40.05
08.11 .tll01 S.rn,le Ladoo, LOj
O FCIO Bo,c_ Ccunt.!-IS LAO ftndion !la032004 15 45<42 UringCo..,.•180
O FC11 Cci_Ccuit en LAO f u>clron 04 01 tll0111 :n25 E~ • Cotn
O FC12 FBD fu,ct;,n 09.03 .004 15 24:07 Uong Timt< Box I
OFCIOO Sfl fr.nocl:m 31. 12.2003 16:39'24 Smile Laddo1 Lo,
~
0 0 910 DB DatoBlock 13.12.2003 122044
•
Figure 2-5. Ofnine Projec t Window with detoil view.
Online Window
The online window of o projecl is o separate window that displays the projecl components
that are contained in the currentl y selected PLC sta·tion. An online connection is required in
order lo view lhe conlents of o CPU. or lo work with the projec t online. Some o tmne objec ls
ore not ln the CPU and ore not seen in the onllne window (e.g .. Source files). Comments and
d ocumentation associated w ith a block or o hardware objec t and viewed online, ore
actually stored in the offiine files of the projecl. When you go online with a CPU without the
use of the project, otlline comments and data is not ava~oble. In some later CPUs. however,
certain offline comments and documentation may be stored on the CPU.
El JjJ CPU413-1
~ System D~a ·- - soa ·- - '
36
Wor1-ing with STEP 7 Projects o nd Ubrories
In building lhe project. you ore essentially creating a framework or the bosic container
objec ts whose con tents will be filled as you perform tater tasks such as configuring lhe
hardware, developing the program, and defining a network. These steps, which are outlined
below, ore described in the examples provided in this chapter. Once you hove created the
project and lhe basic componen ts that it will contain, you w ill be ready lo proceed to
Working with the Hard ware Configurolion, the next step of developing the S7 p roject.
• If you will be working pr/morlfy with projects /hot already exist, then you moy
use the Open command from lhe SIMA TIC Manager menu or too/bar to
browse your directory structure and open STEP 7 projects.
• You moy also wish to creole o separate folder where archive projects and
libraries may be stored.
• If you ore starting by developing your own project, the first step is to,create or
generate the new project conlofner. trom /he SIMA TIC Manager.
• From the 5rMATIC Manager, use the Options/Customize menu to ensure that
you have defined the target storage paths for your S7 Projects and 57
Ubrorfes.
• Create o Project using the New Project Wizard or Using the New Command.
• If you create the project using the New command, you will need to insert on
57-300 or 57-400 station from the SIMATIC Manager menu; if the Project
Wizard is used, you will select the firs/ station from one of the wizard dialogs,
37
STEP 7 in 7 Steps
Essential Elements
The Project object, at the top of the tree, contains the projec t' s hardware stations, and
nelworks; the Station. which represents o PLC, contains the configuration doto for lhe
station' s hardware components. The CP U is contained within the station. along w ith other
programmable modules (e.g., CPs and FMs). Eoch CPU contains on S7 Program; each S7
Program con ta ins a Sources folder, a Blocks folder, and a Symbols object. The Sources fo lder
will hold any text source files that you create; the Blocks folder will ho lds individual blocks
[code b locks and data blocks) creoled for lhe user program. The Symbols object opens too
table of symbolic addresses assigned to absolute addresses used in the program.
Application Tips
Double-clicking on on object at !he !owes! level of a container will open that objecl in its
associated editor. Block objects os shown in the window below, ore at the lowest level ol the
Blocks folder o f a p rogram. Blocks, which will be described in the next chapter, contains STEP
7 code or doto . A block is opened in the editor it was created in [e.g.. LAD/FBD/STL).
38
Wor1-ing with STEP 7 Projects and Ubrories
1 Clicking on the (+) sign o f lhe Project displays Sl-300 or S7-400 Station objecls
already inserl ed in the project; Stations also contain objects.
2 Clicking on the (+)signor o Station objecl, reveals lhe CPU and o ther
p rogrammable modules already inserted in the station; programmable modules
include CPUs. CPs, and function modules (FMs).
3 Clicking the (+) sign of o CPU object reveals an S7 Program object. Each CPU and
other programmable modules contain a p rogram. You will work primarily with C PU
programs.
4 Clicking the (+) sign of the S7 Program objec t displays a !old er for Sources and
Blocks. The Sources folder will hold un-compiled source files {e.g .. created using the
STL or SCL text editors); the Blocks folder, will hold program code and data b locks.
5 Selecting the Blocks fold er o f a Program displays, in th e right pone, any blocks tha t
hove been generated; OB 1 is generated when the program is firs t generated; you
will genera te other b locks as you build your STEP 7 program incrementally.
6 Selecting the Sources folder of a Program displays. in the right pone. any source files
that hove b een developed; this folder is inilially empty and remains empty unless
you cre a te tex1 source files using a standard or oplionol tex1 e ditor.
7 Selecting the S7 Program displays. in the right pane. its Sources folder, Blocks folder.
and Symbols object. Double-clic king on the Symbols object opens the symbols
editor. in w hich symbolic names for absolu te address ore created and edited.
8 Selecting o CPU object in the tree slruc ture displays its S7 Program folder and
Connec tions object in the right pane. Double-clicking on the Connections objec t
opens the network configuration tool, w here communications connections ore
created or edited for the selected CPU.
9 Selecting any Station objecl will display the station's Hardware configuration object,
and any programmable modules (e.g.. CPUs. CPs. and FMs), already inserted in the
station. Double cllcking the Hordwore object opens the station 's hardware
configuration. allowing you to crea te or edit the s1ations c onfiguration.
10 Selecting the Project d isplay its con tents in 1he right pone. SIMATIC 300/ 400 stations,
H-slo tions: S5 stotlons, PG/ PCs. Other stations, and subnets may also be displayed.
11 The name of any object con be c hanged by righ t clicking on the object. and
selectlng Rename . Simply type over the name when ii is highlighted
12 To edit the general information and comments on any objec t. right-click on the
object and select Object Properties.
13 Finally. selecting View ► Expand All. from the menu. opens the folders of all
container objects in lhe project tree; selec ting View ► Collapse All closes oil
container objec t folders.
39
STEP 7 in 7 Steps
Essential Elements
The complete of operations or the SIMATIC Manager may be accessed from its menus.
including File. Edit. Insert, PLC, View. Options, Window, and Help. The toolbar, o set of buttons
position d irectly beneath the menus, provide quick access more frequently used operations.
As you move through the project lree. you will notice that the various command and options
of th e menus and loolbors change to reflect lhe c urrent selection.
Application Tips
Multiple projects may be opened simultaneously, each being p laced in its own window.
Simplify using the Copy and Pos1e commands by opening multiple windows displayed
horizontally or vertically. To copy from one project window you may drag and drop objects
or use Cul/Paste. Make sure that before you pas te. Iho t you select the correct objecl to
which you wish to paste. For example to copy a Station select the Projec t object in both
windows. since stations ore con ta ined within the project and may only be copied too
project. Programmable modules (e.g., CPU. CP, FM), seen in the project tree, may o nly be
copied a nd pos1ed while inside the Hardware Configurolion Tool.
Move your mouse tip across the Icon and View b uttons; a tool lip message defines each.
Show objec ts as: Large icons: as Small icons; as a list: or with Detail information.
'
S l '1AT1C Mar1<1oer · N.ewJut l!lf!iJEJ
40
Wor1-ing with STEP 7 Projects and Ubrories
ACTION
'
The Ale menu and toolbor options allow you to work with existing projects and libraries
and lo creole and manage new ones.
I By selec ting File ► Open, you may open o project from the detoull project directory
or browse for o project or library in anotner loca tion on your computer.
2 File ► New, allows you to crea te a project or library in the default or in o new p a th.
Edit menu and toolbor options allows properttes of selected objects such as stations.
networks, and blocks lo be edited, os well as copied dnd posted.
3 To copy a Station, you would select the sta tion then select Copy; clic k inside the
projec t window of the some projec t or In another project and then from the Edit
menu. or using the right-click, selec t Paste.
Selec t any object. right-click and select Object Properties to view its properties.
View and Window menus and toolbor options allow projects lo be viewed online and
ofOlne. adjustments lo Jeon size and window o rrangemenl, and detans given on a
selec ted object.
5 With the NewProi window selected. select View ► Online lo open the online window.
The Insert menu allows the insertion or new objec ts into the selected contoiner objec t.
Only objects that ore correct for the se1ecled container object may be Inserted.
7 Selecting the Projec t fold er, allows new Slalfons. Subnets, or Programs lo b e crea ted.
8 Selecting !he Blocks objec t allows new program blocks (e.g., FB. FC ) lo b e creeled.
9 With the otfline Blocks folder o f on S7 Program selected, selecting PLC ;.. Download
trans fers o ffline blocks to the associated C PU.
The Options menu allows you to set SIMATIC Manager operating preferences, and lo
launch standard and optional tools.
10 Selecting Options ► Configure Network, for example, opens the graphical ne twork
configura tion tool.
11 Selecting Options ► Customize opens the dialogue for setting various SIMATIC
Manager opera ting parame ters (e.g .. storage p ol hs, and language preferences).
41
STEP 7 in 7 Steps
Application Tips
If the searc h a nd find option is used from a programming edito r (e.g., LAD/FBD/STL), then
only user projects may be searched (and not sample projec ts or libraries). You may search
for User projects, sample projects, and libraries from the SIMATIC Manager. User projects ore
projects tha t you creo le yourself; sample projects are the projects tha t were installed during
lhe initial instollo lion of the STEP 7.11 you choose to, you may adopt and expand any of these
sample projec ts. and re-save os user projects.
Open Project
I I l
User piojec!$ Libfaries Sample projects Multiproiecis J
Selected
User Projects: r
Lib r.!!lies:
Sample Projects:
n
[J
Multiprojects; n Browse...
I
OK
I Cancel Help
l
Figure 2-10. Dialog for opening STEP 7 projects a nd libraries.
42
Wor1-ing with STEP 7 Projects a nd Ubrories
Uruw,e •
I
If!3 ~ My Video:
EB a
\tiebResearchS luff
~ DP_P,oj3
~DP_P,oj4
C:\P,,uick\S7_P,ojech\O P_Proj
C:\Patrick\S7_P,ojecls\DP_Proi4
J
~ c;) Shared Ooc'-"'lonla
! lp i,.i Local Disk (C!') l.@Durnrrq C:\Pa1Jiok\S7_Pioiect1\Du~
, iE S
DVD/CD.ffi,/ Drive [D :) li)En!'in& C:\P,,1Iick\S7_Piojecls_old\Engine
CB ~ My Helwoik Places
liJ Etl-._300 C:\Patiick\57_P,ojecls\Eth,_300
~ · My Ooc1.1nenls [ii Ell11_400 C:\P,,lriok\S7_P,ojecla\Ethi_400
[ti-·:, Share~o-Web Uplood Foljer ID!! Hrdwaie C:\Patticl\57_P,ojecis\Hui,vare ~
~ 1....---.L, r.,o........,;_L.,c7 0.....:. . . . ,..,1-~.J -
~ I
Siad Search
I
Caricel
■
ACTION
1 Launch the SIMATIC Manager and selec t FIie ► Open. The User Projects tabs lists user
p rojec ts currently in the project fist and ore known to the SIMA TIC Manager.
2 Select the corresponding lob lo d ispla y all known S7 libraries or Sample Projects.
3 Click Browse button to searc h for unlisted User Projects. Libraries, and Sample Projects .
4 From 1he Brow;e dia log. select o specific d rive or folder lo searc h through.
6 When !he search is completed. lhe number o f User Projects. Ubraries. or Sample
Projects is fisted under the Found column.
7 Select the appropria te fob lo display fo und User Projects. Libraries, or Sample Projects.
8
~ The check mark symbol. shown to the left of the Project/ library, indicates that the
found entry is olreody in the project or lib rary fisl.
9
~ The symbol shown to the lett of the Project/library indicates that the found entry
was marked as " Hidden." but c on be added to th e project or library fist.
10 Select one or more entries lo odd to the project or library fist; confirm !he selec flo n and
close the dia log with OK.
43
STEP 7 in 7 Steps
Application Tips
New p rojects ore placed in the default project p ath for STEP 7 or in the path currently set os
the default path. You may won I lo c reate o new STEP 7 project folder or set o new defaul t
project location prior to crea ting your project. Before completing the lost d ialogue of the
wizard, you m oy backup a nd mod ify any of your selections. Modifications are a lso possible
la ter. inside of STEP 7. o fter the project is generated.
~
IJ Which CPU are Jou using in JOUr project? 2{4)
~--,,-....,,..--=====-·
;, S7_P1ol
,-----"'T""------..-----,
Block Neme I Sumboic Name I
El II S11,IATIC 300 Station 0081 Cycle E~ect.'lion
EJ- 1)CPU312(11
R .:.!J S7 P1og,an(1 )
8 Block1
Figure 2-12. Project Wizard , Step 2: defining CPU, CPU name, and MPt address.
44
Wor1-ing with STEP 7 Projects ond Ubror/es
ACTION
2 If th e New Project Wizard does not start automatically, from th e menu. select Flle ►
New Project Wizard .
3 Remove the check mark o n the dialog, to disable the Wizard from opening each time
you start the SIMATlC Manager. ond c lick Preview button to open preview window.
4 Click the Next button lo con tinue the New Project procedure.
5 Select from the CPU Type list, the S?-300 or S7-400 CPU lo use in this project. You may
change the default name of the CPU. displayed in the CPU Name field.
6 Selecl on MPI Address for your multlpolnl inlerfoce connection of this CPU, or accept
the default address of 2, temporarily. and change the address later.
7 Click the Next bu11on lo con tinue the New Project procedure.
8 Select. from the Blocks window. organization b locks you wish generated for your first
program. leave OB 1 (the main cyclical block of o STEP 7 prog ram) checked .
9 Select the language represen1ation (LAD. Ladder). (STL Statement List). or (FBD.
Func tion Block Diagrams) you w ish to use for creating the OBs you selec ted.
10 Click the Next button to con tinue the New Project procedure.
11 In the lino! d io log, type o name for your project. Names longer than eight chara c ters
ore used by lhe STEP 7 software, b ut will be shortened to eight charac ters in Windows.
12 Click the Finish button lo generote the new project, otherwise you may press the Back
button to bock up and moke changes or Cancel to oborl the new p rojecl.
13 Use Windows Explorer to find the Project fold er you created. to verify the neWly
created project folder.
45
STEP 7 in 7 Steps
Essential Elements
A project generated with the New command is empty excep t f0t a defa ult MPI subnet
objec t. You must insert al least one PLC station. using the Insert ► Station command. Since an
inserted S7-300 or S7-400 station does not generate o C PU objec t, you will have to open 1he
hardware configuration tool a nd configure the station. at least partially. lo include the
appropriate rock and CPU (i.e., central rock). The Program object. which contains source file
and offline block folder, is generated automa tically when the CPU is inserted into the
configuration. The essen tial objects of the projec t are thereby comple ted.
Application Tips
New projec ts are placed in a directory, currently set as the default project path. You may
wont lo creole a new STEP 7 project d irectory or set a new location as the default prior lo
creating your project. Remember, although STEP 7 supports o long name internally, the
Windows Explorer will use the first e ight characters of your long name as th e projec l file
name. To o void possible problems, you should make o il name changes inside of STEP 7.
46
Wor1-ing with STEP 7 Projects and Ubror/es
ACTION
2 From the menu select FIie ;. New, or press the New Project icon on the toolbar.
3 Type in o name for the new project (e.g.. Ware house), Remembe<. STEP 7 supports
long names. b ut Windows Explorer will only use 8-cha racters for the actual p roject Fite
name.
4 From the menu, select Insert ► Station ► SIMATIC 300 Station (SIMATl C 400 for S7-400).
5 Click on the (+) sign of the project folder a nd then click on the S7-300 Station. The
hardware object of the selected station is d isplayed in the right pone of the project
window.
7 If the Hardware Catalog is not in view on the screen, select View ► Catalog.
8 Click on the(+) sign of the SIMATIC 300 (SIMATIC 400 for S7-400) catalog objecl.
9 Click on the (+) sign of the Rack- JOO (Rack-400 for S7-400) fo lder lo open.
10 Select lhe Rail (CR or UR rack for S7-400) object. d rag, and drop into the upper pone
of the Configuration Window.
11 Click on the(+) sign of the CPU-300 (CPU-400 for S7-400) catalog object lo d isplay the
CPU porls fo lders.
12 Find the CPU folder Iha! matches your CPU hardware and click on lhe (+) sign to open
the folder. Select the CPU port number tha t matches the actual port number for your
hardwore, ond drag and drop in slo l-2 of lhe rac k In th e configurotion window.
47
STEP 7 in 7 Steps
Essential Elements
Station objects that may be added to an S7 project include, StMATIC-300 or SIMATIC-400
station; SIMATIC H-Stofion for redundan t configurations; SIMATIC PC-Station. for representing
a PC or Siemens PG programming system; SS Sta tion . lo represent ea ch SS PLC; or Other
Station. lo represent any non-Siemens system. as port of the STEP 7 projec t.
Application Tips
If several stations of the some type ore required. use of the C ut and Paste features or the
SIMATIC Manager will reduce your work. Simply selec t the station, copy and then pas te in the
right-pone of the project w indow. If the stations will be very similar or identical, however. you
may w ish ·to comple te as much as possible of the configura tion o f the one station p rior to
copying ii to new sta tions.
Figure 2-1 5. Adding new Stations too Project from the SIMATIC Manager menu.
◄ .!.J
Figure 2-16. Project window, ofter inserting four new Stations from lhe SIMATIC Monoger.
48
Wor1-ing with STEP 7 Projects o nd Ubror/es
ACTION
1 From lhe SIMATIC Manager, open the req uired projecl and select lhe project folder.
2 From lhe menu select Insert ► Station ► SIMATIC 300 Station (or SIMATIC 400 Sla tio n); or
rig ht click on the projecl folder, select Insert ► New Objec t, and selecl a slo lion type.
3 Rig hi-click o n the statio n object, then select Object ► Properties to modify the sta tion
name or o ther properties (e.g.. e nter comme nts on station's functio n in this project.)
5 Click in the Comments field and e nter a description of the slation's role in this project.
7 Wi th the station installed, you ore now reody to install the required rocks a nd the
modules that will be installed in each. Configuration is done using lhe ha rdware
configuration tool.
8 Repeat Step 2 and Step 3 for as many sta tions as required, or consider creating lhe
entire station module contents first, and then using the c ut and posle features if the
slalions will be similar or idenlicol.
Nome, jSIMATIC300ll J
Project p<1th:
Author: jc.T.Jones
Oete c:realed: 16.09.2003 11:18:06
Lesl modified: 16.09.2003 11:18:06
Comment This stalion wiR control !he motOJs for the main and catousel lines, as !'iel -
as all ptoduction tracking c1nd accounting for the -enous~
.:J
I, OK 1 I
Figure 2-17. Ge neral Properties dialog for documenting a SIMATIC 300 slo tion.
49
STEP 7 in 7 Steps
Archiving -
I
Usei proje,cts J Libraries Sample piojects I
Name
Ethr_300 D:\S7Course_Pr ojects\Ethr_ 300
Ethr_4DO D:\S7Course_Projects\Ethr_400
Making_Area C:\S7_Projects\Making_A
Mul_CPUs D:\S7Course_Projects\Mul_CPUs
Netw01ks D: \S ?Course_Projects\Networks
Prj300_5 D:\S7Course_Projects\Prj300_S
Prof_300 D:\S7Course_Projects\Prof_300
Prof_400 D:\S7Course_Proiects\Prof_400
ProL3 C:\S7_Proiects\ProL3
Warehouse_1 D:\S7Course_Projects\Warehous
Selected
User Ptojects: 11
Libraries; I,
Sample Projects: I Browse,..
I
OK 1 Cancel l I
Figure 2-18. Archiving dialog for archiving STEP 7 Projects or Libraries.
so
Wor1-ing with STEP 7 Projects o nd Ubror/es
!I lti
--
Save in: j8 S7_Aidwe_Projects
~\akilg_t. zip
~Networks.zip
~ Prj300_s.zip
~ S7 _Pro6.zip
~ s7Projects.~
~ Warehoos.zci
Re name: Sm !
Sa\le as type: jWirZip-Archive (•.~) .:] Car.eel j
/4
Figure 2-19. Dia log for se tting archive name and storage location.
II 1
ACTION
Before using the SIMATIC Ma nager "Archive" menu command to store backup copies
of projects, you moy wont to first review STEP 7 p reference settings for Archiving.
2 Open the StMATIC Manager and If lhe project you wish lo archive opens
automoticolly. because it was the lost project open, then you must first close the flfe
before It con be archived.
4 Select the appropria te tab and the desired file from " User Projects," "Libraries," or
"Sample Projec ts". w hen The STEP 7 Archiving dialog is presented.
5 Press OK lo continue wi th the archiving opera tion on the selected STEP 7 projecl or
library. The Windows dia log "Archiving - Select an Archive" is presented for naming the
archive file ond the fo lder in which the archive should be stored.
6 Either accept the default d irectory and file name, or c hange as required. The storage
location p resented, is either the folder specified for "Arc hiving " or the lost location
where an a rchive was stored.
51
STEP 7 in 7 Steps
Application Tips
It is important when retrieving an archived project that, when promp ted to do so. you ensure
to selec t lhe project folder where you wish lo hove the retrieved projec t stored. When your
d efault storage path is displayed. you must be careful to select the project path and not the
project file.
I I l
~tln!ll'1!11!·HMil· II1:al~D - ~
EE D S7_Archive_Proj
&1 CJ S7_Lbr~ries
I ao
1
'' ' DP_Proj
'
;
I
' DP_Proj4
Ethr_300
Ethr_400
Hrdware
J
! Making_1
'•' l'
. ,i.. Making_A
I
MPI_Prj
MPI_Prj2
1 ~··- Mul_CPUs ..:.I
OK.
I Cen~I I l
Figure 2-21. Selecting destination for restored
project or library.
52
Wor1-ing with STEP 7 Projects o nd Ubrories
ACTION
1 Berore using the SIMATIC Manager "Retrieve" menu command to retrieve o backup
projec t or library, you may wont to review STEP 7 pre ference settings for archiving.
2 Open lhe SIMA TIC Manager and if lhe p roject you wish to retrieve opens
outomoticolly because of being the lost project opened, you must close the p roject
before it con be restored.
3 From the SIMATIC Manager menu. select Retrieve ... the Windows dialog "Retrieving •
Select on Archive'' is presented lor you to select the archive project file lo restore. The
raider presenled is the loco lion specffied in Archive preferences or in which on archive
was lost stored.
4 From the listed files. select the archive projec I or library file to retrieve.
5 Press Open to continue retriev ing the selected 01chive project or library. The target
projec t/library storage path is presented in the "Selec t Destination Directory" dialog,
along with stored projects.
6 Select the !older in which you wish lo hove the project or library restored; do not select
the project file icon of the project you are restoring.
7 The uncompressed archive will be placed in lhe directory specified under the
Archiving tab under Customize options, unless you specify otherwise.
53
Working with
Hardware Configurations
STEP 7 in 7 Steps
Racks
Each S7-300 or S7-400 is built up using one or more rocks Iha! provides the mounting
mechanism for modules. As o system expands. additional rocks ore interconnected using bus
cables and interface modules (IMs). S7 rock systems uses two busses: o high-speed 1/0 signal
bus (P-bus). and o communications bus (C-bus, or K•bus in some documents). which supports
data transfer to and from communications modules and that connects the programming
interface and CPU with installed programmable modules (e.g.. CPs and FMs). Rocks having a
P-bus only (no C-bus) will only support the Installation of signal modules (SMs) .
Tobie 3-1. S7-400 Controller !CR). Universal (UR). and Exoonsion Rocks !ER).
Rack ShOlt Name Brief Description
Roil (UR) S7-300 Universal rock: o DIN standard roil for mounting all modules.
CR3 S7-400 Controller rock: 4-slot, not suitable for redundant P.S.
S7-300 Rack
The S7-300 rock is a standard DIN Rail. The rail is available in d ifferent lengths and is used lo
configure both central and expansion rocks. Before o module is installed. you must insert the
molded U-shoped bus connector, p rovided w ith each module. in1o module's right-edge.
Each module is installed by hooking it onto the top edge of the roil and firmly pressing
downward until snapping into place. With each module in place. the right-edge of the
connec tor, which extends out from the module will insert Into the tell-edge of the next
module. thereby forming the S7-300 backplane bus. The bus is daisy-chained from module-
to-module starting with lhe CPU. In the S7-300, o central rock and three e)(pansion rocks may
be connected. using the appropriate interface modules.
56
Working with Hordware Configurations
Controller rocks ore designed with o bockplone that is divided in two segments - each
segment having nine slots. The controller rack {CR2). w hich supports both the P-bus a nd C·
bus. will allow a CPU and its associated 1/0 residing in each segment to operate in parallel,
but independently. Universal racks include the UR 1. UR2. and the UR2-H. The UR2-H must be
used In S7-400H systems. but may also be used for standard S7-400 systems.
Table 3-2. S7-300/S7•400 Interface Modules (IMs) ror local and remote 1/0 exoansion.
Interface Module Pair
Brief Description Distance
CPUIM Exp. RacklM
IM 365 IM365 S7-300 Local Expansion (1 -Tier Max. Expansion) I m
IM 463-2 IM 314 S7-400 Remote Expansion using S5 Rocks & 1/0 600m
Note: No C-Bus implies that only signal modules will be supported in the expansion rock.
S7-300 IMs
The S7-300 may be expanded up to a maximum of three additional racks for o total of four
tiers. Expansion lo a maximum of one oddi1ionol lier ftolal of 2) is accomplished using the IM
365- two interface modules permanently attached by a fixed coble length of l meter. One
lnlerface module Is placed in the central rock {CR) and the other in the expansion rock (ER).
A maximum of eight modules may be placed in the expansion rock. Expansion up to three
additional tiers (total or 4) is accomplished using the IM 360/IM 361 combination. A single IM
360 is placed in the central rock (CR) and a single IM 361 in each additional expansion rock
(ER) . A maximum ot three expansion racks may be installed and a maximum of eight
modules may be placed in each expansion rock.
$7-400 IMs
The S7-400 supports centralized 1/0 expansion from 1.5 meters to 3 meters and remote 1/0
expansion up lo 100 meters. using interface modules (!Ms). In Tobie 3-2, both the IM 460-0/IM
461 -0 and the IM 460- 1/IM 461 - 1 publisher/receiver interface module pairs support local
expansion. The IM 460-3/IM 461-3 pair and the IM 460-4/IM 461 -4 pair both suppor1 remote
expansion. S7-400 remo te 1/0 expansion up to 600 meters may also be configured using
existing or newly inslolled SS 1/0 rocks that ore connected using the IM 463-2. Altogether, o
maximum o f six interface modules o f any combination may be p laced In lhe central rack.
The IM 460-3 may be installed in the central ro ck with up to a to tal of six o ther interface
modules to form any combination of local and remote 1/0 ex.pension.
57
STEP 7 in 7 Steps
CPU 31x-x IFM CPUs with integrofed 1/0 Functions (e.g .• d lgftol/analog. HS covnters)
CPU 3l x-x DP S7-300; CPUs w ith integrate d Profibus DP (DP m a ster/DP sla ve p ort I
CPU 41x-x DP S7-400 Pro fibus DP CPUs; CPUs with in leg rated Profibus DP master.
58
Working with Hordware Configurations
PG/PC $7-400
O P Devices
ca OM
:::
'"
'"
'"
11111,11111 1111111111
Figure 3-1 Mutti-Poinl Interface programming interface and network.
111111111:1
59
STEP 7 in 7 Steps
The completed configura tion is checked for errors. compiled and then saved. The
configuration is saved lo the System Doto object. which is p laced in the ofnine Blocks folder.
The System Doto object may then be downloaded lo the CPU. thereby providing lhe CPU
with comple te information of the hardware configuration. The CPU in turn transfers
con figuration parameters to the installed modules. Once created and downloaded. the
hardware configuration is a powerful diagnostic tool. The status of all configured
components may lhen be viewed online, showing lhe correct or malfunctioning operation.
a e 35Hd
Tbl • • or wore C on f'iauro I'10n T00lbor Buttons.
Icon Toolbc:w Function Icon Toolbar Function
60
Working with Hordware Configurations
The major componen t con tainers of the ca talog. Profibus DP. Pralibus PA . SIMATIC 300,
SIMATIC 400. S/MA11C PC Based Contra(. and S/MATIC PC Stafion, ore p resented in o tree.
Profibus-DP and Profibus-PA containers include port for DP or PA slave devices. The SIMA TIC
300 and SIMATI C 400 containers each contain lolders of the various port numbers for rocks
and modules used lo build on S7-300 or S7-400 configuration. The subfotders of the S7-300
and S7-400 hove similar names and include individual folders that contain communications
processors fCPs) , central processing units (CPUs), function modules (FM). interface modules
IIMs). power supplies (PS), module racks (Rock), and signal modules (SMs) .
.:J
;,
I;. l!!J. FAO'IOUSOP
~RO'lllUSf'\
.e,... ''"";,,; .:l
~N <! I{ ))) ~
(ll :,i CT • 1'110~6~S~
1• ,:) CP·:X:C I- Iii SIii,'>11: Xl)
' 1➔ ·:J CPU•:X:C GI CJ C7
,. ,::::J rw-JOO (:) CJ Co· ).1)
,~a c.~,~ F-Q ceu.x-o
,. :::i ,_.:,;o ~ D fl-1.JOO
L~ :J t.17OOOOOf $ tJ (i, 1(,,-....;>
t--i-2] P$·lXI :!! CJ It.I A.0
1 ➔ W n>i:~.JOO
"'a u;o:1[Hg()r,
hf ZI SM•)XI t---0 l'ri·XO
~ l:.J Rl"i:t•XO
·• Bll $1-<A1" .» s; CJ S~·JJJ
c• ·: J CP·<OO e Ii 111,,.11: .oo
l<f O CPU-COO
•Q cP,l(Q
'" ·:J F1<·100 t- 0 Cl'U•ICll
r➔ Cl J)..MCO
14 ·: J 1-11-fXl OOION ;,. CJ Fl-' <OJ
,. ·::J p;.,oo [',(JIMIC!O
,-·.:J R'-C~-IIO ,;.,.CJ M1(X10f$10N
Ct!. 1:...J SM..._"n
;, U PS,<lll
I ID S'NA1ICPI~Eu..w10.,1ui.3n'atl u, U PACT. ,l(J)
± a S1,t,,1icFCSl,o;,, [,; CJ >'< :))
?:-if SIU.A.Tl: rc&1~Co-11:l:Ol/4Xl
~-8 SIIMTl; F C -
Figure 3-2 (oJ Hardware Catalog Le tt-Docking. (bJ Hardware Catalog Un-Docked window.
61
STEP 7 in 7 Steps
As the configura tion is developed and comple ted, the arrangement pane will show the
interconnection between interface modules in the central rack and in each expansion rack;
P drops will be shown connected too DP master. As the configurotlon progresses. each new
station is opened in o separate station window. Multiple sta tions may be opened
simultaneously and components may be copied and posted between stations.
,'
• ::, ~ --00
I[ ~ M)EXl f'.SCltl
rs- :J M ..t'.O 1\
• OOJWC: L
,-
8
. II '~""'°
8
~
1~-·
r~:11: CFtldl&I
01d:11MtOCf
-", tW U..tLU~
-
t.£S7t16. - ~
r-- ~fhdchot
3
I ;i,:i::-~, O..dor.ff c.,,.,... I
•
5
..'8lV
DnQAC l 1'11
6£S 7 <t'O OW1J111,110
«s l <.<"1 ~CflOOOO.O
16:lti:I
Q 1
011&,e,C ,1:,,
'
1
6
001~w.12U\l'rJA.
DO l&i'C lJJ·UI>,'11>\
r.lSl <:!1 U H-
W:Sl 122'51:HOOOISO
as, <.'2&H000'\90
• !
.,
s
"
t-
Figure 3-3. Hardware Con figuration tool with docked catalog window: p rojec t window with
rock arrangement in top pone and configura tion table of selected rack in bolfom pane.
62
Working with Hordware Configurations
Regardless of your actual station hardware or arrangement - you con accomplish the
configuration task using the following checklist. Several configuration examples ore
presented in a step-by-step manner, in the remainder of the chap ter. As you use this chapter
keep in mind that, while there ore examples or practically every type of configuration task.
you only hove to be concerned with your configuration. Once the configuro lion is
comple ted or at least completed to the point needed lo estoblish online communications
with a CPU (e.g., central rock configuration), you'll be oble lo download your configuration
and then proceed lo the next step or Working with the STEP 7 Program.
• Use Symbols editor from the Hardware Conflgurafion too/ for fast assignment
of symbolic addresses lo Input/Output addresses.
63
STEP 7 in 7 Steps
Essential Elements
Like project components, d isplayed in the SIMATIC Manager, components of the hardware
co1olog ore presented in o tree structure comprised of object containers. The major
con ta iners include Prollbus DP, Prollbus PA, SIMATIC 300. SIMATIC 400, SIMATIC PC Based
Control, and SIMATIC PC Statton. When a container is opened, its parts categories are
displayed as fo lders. The SIMATIC 300 container. for example, contains CP-300, CPU-300, FM·
300, IM-300. PS-300, Rack-300, and SM-300 folders. Hoving basically the same categories, the
StMATIC-400 folders will ho ve similar na mes ending in 400 (e.g., CPU-400). As you navigate
toward o specific port, you may actually traverse two or more levels of fo lders that further
categorize the parts. Whenever a cototog folder o r porf is selec ted. a brief description
appears in the bottom pone of the catalog w indow.
liMtit¼SiiidtiiD[,t .!!1
I
E,<4- St.Y'dol d 3 f,o(Je Is,.nd.,d 3
w.-
1E
.±.
-\\l ffiOFlBUS•PA
!iii
IJil
:t IJil
SIMATIC 300
SIMATIC: 400
SIIIIATICFC8asedCon11ot
~=:~~~~i~A
~ PROFIBUS DP
. l±l -CJ C7
13 CJ CP-300
!£ SIIIIATICFC St•lion ooCl CFU-m
l!J CJ FIA -300
lilD G«eWo"J
£:JO IM·:JJO
l!l :::J M7•EXTEHSION
13 0 PS-300
' ~ 1'$307 10/>.
r· PS 307 2A
I'S 3075A
W·CJ AACK-3:0
13-CJ SM-~
8 lifl) SIMATIC ~00
! f:!l-CJ CP-,oo
I w-D CFV-400
I 00 Cl fM-400
tiJ CJ IM•400
Bl-CJ M7-EXT ENSION
SD PS-400
I l!l O AACK--400
i l!l CJ SM-400
!E·lii) SIMATIC PCBa•ed Ccrtrcl
~ -J;il. SIMATIC PC St~ion
~·======--~
.!.I
•I I
f'flOFIBUS•OPll•••• ro,
SIMATIC S7, M7, ,11ld C7
PROflBUS-OP 1low.o l'a
SIMAJlC 57, M7, ond C7
t.S:Uibuled ,dek) lch~Wed r<1c~I
64
Working with Hordware Configurations
ACTION
1 With the Hardware Configuration tool open. selec ting Vie w ► Catalog displays the
catalog if it is not already onscreen.
2 The co to log may be docked or undocked and positioned for your working
convenience: Double-click on the title bar of the catalog window for un-docking.
3 To dock catalog on the left side. drag and drop onto the main window's left edge.
4 To dock cotolog on the right, drag and drop onto the main window' s right edge.
5 From the hardware colalog. click on the plus sign (+) of the SIMATtC 300 or the
SIMATIC 400 object to access its component folders ond porls.
6 Some folders, for example the CP-300 and C P-400, will hove more lhon one level o f
subfolders to further categorize the components. CP folders include subfolders for
Profibus. Industrial Ethernet. ond Point-to-Point communications processors.
7 Selecting any folder or sub folder displays o brief description of its contents in !he
bottom pane o f the catalog window.
8 Select o specific component in order to view its port number and a brief description
of its features in the bottom p one of the catalog window.
9 Open the Rack-300 or Rack-400 folder. to view and select module rocks. The S7-300
has a single rack type. S7-400 rock types include: CR. for central racks. ER. for
expansion rocks: and UR, for universal rocks (usable as central or expansion rock).
10 View and select power supply modules In the PS-300 or PS-400 folder. Th e S7-400 has
subfolders for Standard and Redundan t power supp lies: ils DC power supplies are
prefixed with PS-405 and AC power supplies are preflXed w ith PS-407.
11 Open the CPU-300 or CPU-400 folder and subfolders. to view and selecl CPUs.
Subfolders con tain , tandord and Profibus DP (DP) CPU modules: !he S7-300 also
contains poinl-to-point (PIP ) and integrated function (IFM) CPUs.
12 View and select interface modules for local and remote rack expansion for the S7-
300 in !he IM-300 folder or for the S7-400 in !he IM-400 folder.
13 Open the FM-300 or FM-400 folder. to view and select function modules. Subfolders
contain modules for Cam. PIO. High Speed Counler, and Positioning control.
14 View and select signal modules in the SM-300 or SM-400 folder. Both folders include
subfolders for digital input (DI). digital outpu t (DO). analog inpul (Al). and analog
outpul (AO). The S7-300 also contains folders for dlgilol inpu l/output (DI/ DO) and
analog inpul/output (Al/ AO) modules.
65
STEP 7 in 7 Steps
Essential Elements
The complete o p erations of the Hardware Configura tion too l ore accessed fro m its main
menus includ ing Station, Edit. Insert. PLC, View, Op tions. Window, a nd Help. Toolbor buttons
allow quick access lo more commonly used commands. Edit operations a llow you to copy
and pasle rocks and mod ules, a nd to edit other object p roperties. The PLC menu supports
online func tions with the CPU and other p rogrammable modules. View and Window me nus
allow manipulation o f fhe main and station windows and p rovid e access to each sta llon's
1/0 address usage. Finally, the Options menu supports customrzing of the configuration tool
and access to optional tools (e.g.. Symbols Editor, and Ne twork Configuration).
Application Tips
Display multiple windows horizontally or vertically. lo simplify use of d rag and drop or111e use
of Copy and Paste. For example to copy a rock select the ra c k a nd paste in the same
station window or drag and drop in another sta tion window. Modules (e.g ., CPU, CP, FM. SM,
and PS) may also be copied and pasted to the some rock or to onolher rack (i.e .• loble).
l!IGJ El
~ 1s,.nd.¥d ..:1 ::.lstMATI( JOO(I) ([onfigmolion) -- New_p,j
r-==;-;;:,;;:::c--J p (OJUA
r, PROneusoP 1
~ ~- - -
PS :Jl15A
\\' PfflJflBUS.PA 2 CPU316
BIili SIMATICXO )
,: •.'.::) C7
on6l<6C1 l!N
'-. '.::) CP~O
::. ::J CPIJ-:o:J
'
5 D111oo'C12W
6 D0l6'«\C12W/Q5A
"- ::_, fU-300 7 D'.)16,d\Cl 21);/QSA
,£ '.::] G•tE'Nd)I
~
8 Al2t12Bl
• '.::J IM·Dl •
"- ::,i M7-00ENSION
:,: =:J PS-300
:;. CJ RAU·llO ~~ !OJ UR
'+: CJ SM·lOO
!iii SII IATIC400
aijJ SII IATICF'CB••odC
If; Ji SIMATIC FC Sl<>'i:>n
• .tJ 4 D116cAC120V 6£57121-IEHOMIAA
5 0116,ACI 20\I 6ES7 321-IEHOHIAA 4••5
ls 6 00 16'<ACI2(1,// 0. 6ES7322-IEH01·MA i 8...9
PROABUS-0? da,...,,
la, SIW.TICS7. M7.
-
Md Cl (dl!l1il>tted racl(J
7
8
DOl~CIZW/0
Al2'c12Bl
6ES7 :1l2-1EHOHM
6CS7J31·71':B82-0ABO WO. l2'J
12...13
.,
AOSS Fl lOQl!ltlob,
Figure 3-6. Hardware Con figuration Tool: Ca ta log and Station Configuration windows.
66
Working with Hordware Configurations
The Station menu or toolbar options allow you lo wor1< with exisfing Stolions online or
offllne; to creole new sto1ions and to save and compile completed conligurotions.
I Selecting Station ► Open allows you to open a station configuration rrom the
current project, or browse and open o station configuration from another project.
2 Station ► New, a llows you to create a station in the current or in another project.
3 Press the Online <► Offllne button lo switch the stolion between onllne and offline.
The Edit menu and toolbor op1ions allow copying and pasting of racks and
modules, os well as viewing and editing o f a selected object's properties.
4 To copy one or more modules selecl the modules. then selecl Copy; selecl a slot in
the same rock or in another rack, then select Pa ste from the menu or the right-click.
5 To copy a whole rack. you would click on Its litle bar ond select Copy; click
anywhere inside lhe configuration pane of t11e some sta tion window or inside
another station window, then select Pa ste using !he menu, or the right-click.
6 Select any objecl then right click and Objec t Properties to view its properties.
8 Selecl PLC ► Upload lo upload lhe PLC configuration to lhe programming syslem.
The View and Window menus allow viewing of a stollon's assigned addresses. and
the arranging or station windows and rocks to suit your working convenience.
10 Selecting View. allows you to show or hide the hardware configuration tool's
Ca talog, Taolbor, or the Status Bar.
11 Selecting Option s ► Customize. for example, opens the dialogue for setting various
display and operating parameters o f lhe Hardware Configuration tool.
12 Options ► Configure Network opens the tool for configuring networks; Option s ►
Symbol Table opens the symbolic address editor.
67
STEP 7 in 7 Steps
Figure 3•7. S7 Configura tion: rock-2 selec ted in lop pone, rock-2 modules in bottom pone.
68
Working with Hord ware Configurations
ACTION
1 With the desired p rojec t opBn. double click on the Hardware objec t o f the station
you wish to view.
2 With the station window in view. the central roc k is usually p laced firs t in the top
pone. The rock number. always Rock-0. is enclosed in parentheses ond followed by
the rock type. The address is (OJ UR for o universal rock, (OJ CR for o cen tral roc k
type.
3 If expansion rocks ore configured, they too ore displa yed as tables in the top pone.
Each ro ck is assigned according to the roc k typ e ond the nexl ovoilable number.
The d esignation UR is for the universol ro ck typ e and ER for the expansion rock typ e.
S If Profibus-DP sieves ore config ured, each slave object Is shown as b eing either
attached to o DP Moster system or not a ttached . When a ttached. the assigned
Proflb us Address is shown for each DP stove.
6 When any ra ck, is selected in the lop p ane. its d e tails are shown in the table in the
bottom pane. Module details Include Slot. Module description. Order Number,
Firmware version. MP/ address if applicable, Input (/) address. and Output (OJ
address.
7 Detoils of each selected slave may also be viewed by selec ting the DP-objec t. II
the drop. for instance, is o modular drop, its module details ore displayed in the
bottom pone as with o normal rock.
8 You con view the assigned or defoull properties of any configured object (e.g ..
Rock, Module. or DP master system) by selec ting the object, o right-click, then
selecting Object Properties.
9 View assigned addresses of a CPU by selecting View ► Address Overview, from the
menu o f lhe Hard ware Configuration fool.
10 O ther unopened stations of the some project may be opened ror viewing by
selecting Station ► Open from the menu. then selecting the station from the dialog.
69
STEP 7 in 7 Steps
Essential Elements
Build ing !he configuration for each PLC involves 11) selecting each compone nt from the
Catalog. and (2) dragging and dropping the componen t info the Sta tion window. Typically a
configuration involves a central rock and perhaps some arrangement o f expansion rocks.
each of which is configured with some combination of modules. Modules may inc lude o
power supply (PS). digilot/onolog signal modules (SM), communications processors (CP), and
funclion modules (FM), all o f which must reflec t the actual p hysical arrangement. Each
module is dragged fro m the catalog lo ils matching slot number in the configuration fable.
Figure 3-8. A rock selected in lop pane, shows modules d isplayed in the bottom pone.
70
Working with Hordware Configurations
ACTION
1 From lhe SIMATIC Manager, open the required projecl and either selec t an exisling
station or create a new slation for which a hardware configuration is to be crea ted.
2 Wilh the stalion selec ted in the left pane or lhe project window, double -clic k on the
sta tion's Hardware object in the right pone, to open the configurotion tool.
3 Maximize the Hardware Configuration window, and if the Hardware Catalog is not
already in view selecl View ► Catalog, from the menu to open lhe catalog.
From the catalog. click on the p lus sign (+) lo open the SIMATIC 300 or SIMATIC 400
objec t to access lhe individual component folders for lhe required PLC.
5 Open the Rack-300 or Rack-400 folder and drag a central rack to the upper
configuration pone (the S7-400 has CR and UR rack options; S7-300 uses the Roil).
6 Open the PS-300 or PS-400 folder. selecl lhe desired power supply and drag the
part to slot- 1 of the central rack.
7 Open the CPU-300 or CPU-400 folder. then the appropriate CPU sublolder to select
lhe desired CPU. Drag lhe selecled CPU lo an acceptable slot in lhe cen tral rock.
9 After completing a stolion. from lhe menu, select Station ► Consistency Check lo
check For errors. The configuration will not compile For downloading unless found
Free or errors.
10 From the menu bar, select Station ► Save to save the configuration; or if done. use
Save and Compile to genera te the System Delo for downloading lo the CPU.
71
STEP 7 in 7 Steps
Essential Elements
For a station configuration to compile for download. certa in perquisites must be met.
Authorizations must be installed for any optional packages used: network modules in a
subnet must hove unique addresses: the stolion hardware and lhe network configuration
must match the actual configuration, a nd be found consistent and free of errors. Once
found free of errors. a System Data object (SDB), containing th e configuration, is generated
a nd placed in the Offline Blocks folder of lhe associo led station [i.e .• CPU program fo lder).
Application Tips
Whether downloading o configuration for the first time or otherwise. the comp lete PLC
configuration is always downloaded to the CPU. A partia l configuration download is not
possible. If the actual station configuration is not yet completed o r will be completed in
stages then you should consider c rea ting a temporary p roject. w hose hardware
configuration is developed in stages, re fl ecting only th e portion of the hardware that is
physlcolly installed to dole (e.g .• central controller rock a nd modules o nly).
Desmation Moc!uet:
Aaclu SIDI
CPU 41~-l O 3
CP-t43-1 11 O 7
Select Al
I OK I Help
72
Working with Hordware Configurations
ACTION
1 Fir..l. ensure that o n online connec tion is established from the PG/PC lo the sta tion
to which you wish lo download. A direc l MPI connection is rec ommended.
2 If downloading a configuration for lhe first time, on overall reset of the CPU memory
is recommended before downloading. The CPU should be in the STOP mode.
3 With lhe required project open and the appropriate S7 Program folder expanded.
select the offline Blocks folder; then from the right-pane select the System Doto
ob]ecl. The System Doto is available only If the station configuration was complied.
4 Wilh lhe System Doto objec l selecled, from the menu. select PLC ► Download. or
press the Download icon from the toolbor.
s When prompted to select if the System Doto in lhe C PU should be deleted. confirm
with Yes to overwrile any exis ting configuration.
6 Check the CPU LED indicators; if the downloaded and actual configuration port
numbers match. then no foul! LEDs should be illuminated.
1 First, ensure that an online connection is established from the PG/PC to the station
to which you wish to download. A direc t MPI connection is recomme nded.
2 If downloading a configuration for th e first time, on overall reset of the CPU memory
is recommended before downloading. The CPU should be In lhe STOP mode.
3 Atler completing the configuration for o station. from the menu, selec t Station :.-
Consistency Check lo check for errors.
4 When the consistency check reports bock wi th no errors, from the menu. select
Station ► Save ond Compile lo genera te system data b locks (SDBs).
5 With the appropriate sta tion open, from the menu. select PLC ► Download, or press
lhe Download Module icon from the tootbor. A dialog is presented, listing modules
for which download configura tion doto exists.
6 Press the Select ALL button to ensure tha t configura tion data is downloaded to all
modules for which configuration data exists,
7 Check the CPU LED indicators; if the downloaded and actual configuration port
numbers match. then no fault LEDs should be illuminated.
73
STEP 7 in 7 Steps
Essential Elements
A station may be uploaded to on existing project. however an empty project is
recommended. When performing the upload o new station objecl, based on the uploaded
station, is outomo ticatty generated in the open project- thereby e liminating the possibility of
overwriting or corrupting any offline dola. In the case of the S7-300, the central and all
expansion rock configuration doto is uploaded; in the case of the S7-400, the central rock
and module configuration data is uploaded. but no expansion racks are included. No
configuration data is uploaded for distributed 1/0 drops. Although the uploaded
configuration uses default addressing for both the S7-300 and S7-400, the addressing may be
modified in the S7-400 and in some S7-300 sta tions, depending on th e CPU.
Application Tips
Stations that rely on o dependent relationship lo one or more other stations (e.g.. DP
Moster/Intelligent stove) should always be uploaded together. If dependent stations are not
all uploaded, the station that you ore interested in will remain inconsistent when you attempt
to save and compile. If component port numbers appear incomplete after a station upload,
ii may be lhol the specific parts ore not recognized by STEP 7 and tha t the components do
not appear in the Catalog, You may enter the ·1ncomplete" order numbers when you
configure the hardware using the menu command Options> Specify Module.
Rock:
Slot
Target Sta&R (
♦' Local
r- um be reached by melln~ of oatewll)I
MPI adcrass
5
Aocesta11>Je Nodes
5 CPU841-0
Update
OK
I Cancel j
Figure 3-10. Dialog for accessing o station targeted for upload.
74
Working with Hordware Configurations
1 From lhe SIMATIC Manager, open lhe projecl lo w hich the sta tion configuration will
be uploaded (o newly created or empty project is recommended).
2 Ensure that there is on established online conneclion from the PG/PC lo lhe slo lion
you wish to upload (e.g.. via a direct MPI connection, via Profibus, or via Ethernet).
3 From the SIMATIC Manager menu. select PLC ► Upload Station. A dialog box tha t
lists accessible stations on lhe local subne t and thol con be reached via o gateway
is p resented.
4 In the dlolog box, en ter the rock and slot number of the module via which the
configura tion should be read (generally the C PU). Define wheth er the station is on
the local subne t or con be reached via a gateway; if the station can be reached
by way of several modules, selec t th e connec tion method. Confirm with "OK.''
5 When the upload is complete lhe station configuration data is contained in o new
station which hos been given o defoull name. Click on the new sta tion. righ t-click.
and select Object Properties lo assign a new station name and to add descriptive
comments.
6 Click on the new station in the p roject tree, and from the right-pane double-click on
the Hardware object lo open the slotion In lhe hardware configuration tool.
7 Selecl lhe C PU module then right-click and select Object Properties; from the
General lob, press the Properties bulton to assign o new MPI address.
8 Modify o lher MPI addresses, for modules in the slotion, If required (e.g., CPs and
FMs). and network station addresses as required (e.g., Profibus, Industrial Ethernet).
9 Remember, since certain componen ts of the configuration may not have been
uploaded (e.g. expansion racks and modules.) you may hove lo complete lhe
configurolion of fhe new station. using the hardware configuration fool .
11 When done, from the menu, select Station ► Consistency Check to check for errors.
12 If lhere ore no errors, from the menu. select Save and Compile lo sove the
configuration and to generate the new offline System Dalo objec t.
75
STEP 7 in 7 Steps
ffldi¾,ll@ti•Jlid:i4if1·itfi•t
I
Address I
0.0
5Ymbol
START_pa_oo
Oata Tv""
BOOL
,~ ~
-
I 0.1 START_pB_OI BOOL I
I 0.2 START..,PB_02 BOOL I
T 0,3 START ...PB_03 8001. I
l 0.1 START_PB_O~ BOOL I
- II. o.s
0.6
START...PB_OS
-··
START_p6_06
BOO!.
-
BOOI. I
1 0.7 10. 7 BOOL I
l 1.0 STOP...PB_OO BOOL I
I 1.1 STOP_pa_ot 800l I
I 1.2 11.2 BOOL I
I 1.3 STOP _pa_ro BOO!. I
- 1 1.1 STOP _pe_O'I BOO!. I ~
76
Working with Hord ware Configurations
~
Address 1 CoMment
PIW 352 DI _spfEO_St' Orive # 1 Speed Setpoi'lt
PIW ss~ D2_spfEO_St' \/,'ORO Dtive #2 Speed SetpoW:
PIW 3S6 01.YSi WORD O<i\le # 1 PSI
PIW lS8 02.YSi WORD O<ive #2 PSI
Pq,N :352 Dl...,5PEEO WOOD O.ive # 1 Speed Controller
Pq,N 35'1 02...,sPEEO WORD O.ive # 2 Speed Controller
Pq,N 356 PQW3S6 WORD
Pq,N 358 PQW353 WORD
I
1he symbd lbble it updAted Vlilh 'OK' or 'Appl?'
.Q<incel
Figure 3- 12. Entering Symbolic Ad dresses in 1he Hardware Configuration Tool - A na log 1/0.
ACTION
1 Op en the d esired sta tion in the Hordwore Canfigurolion tool. an d then select the
rock containing the m odules lo whic h symbolic addresses should be assigned.
2 To enter symbol addresses for a mod ule, select the module. righ1-ctick and select
Edit Symbollc Addresses. Th e symbol lable is presen ted like a spreadshee t, having o
column for the absolute Address, Symbol address. Data Type o f lhe address, and a
Comment. The absolute addresses assig ned to the open module o re a lready listed
in the absolute A d dress column.
3 Click in the Symb ol field and enler up lo 24-olp hanumeric characters for the
symbolic address o r on input address; enler o commenl using up to o maximum o r
SO-characters. The data type of each absolute address is automatically inserted.
4 Press the Add Symbols button to use the obsolule address in the Symbol field for any
input or output address that you hove no t yet defined wilh a symbol address.
5 Clic k on the Sort d rop a rrow a nd select a method of sorting the symbol a d dresses
(e.g ., Address Ascending , Address Descending, or Symbol Ascending) .
6 Press the Apply b utton to a ccept entries and lea ve dia log o p en to resume with
en tering symbol addresses; when done, confirm your entries with lhe OK butto n.
77
STEP 7 in 7 Steps
Essential Elements
As you build the S7-300 central rock configura ti on, remember that the CPU ond power supply
modules you use in lhe configuration, must match the ocluol hordwore orrangemenl. The S7-
300 only hos one rack typ e - it is called a rail. The roil is considered o universal rock since ii
supports oll lypes of S7-300 modules [i.e., CPU, signal modules fSM}, runclion modules (FM),
and communications processors fCP)l.
Application Tips
If you need to connect to the CPU to lest portions of your code, the minimum configuration
you will need to get storied is shown in the figure below. You will also need lo install backup
batteries to the CPU ond connect a source lo the power supply. As you build your hardware
configuration to match your ac tu al hardware arrangement, remember lha t you must install
modules for the S7-300 without leaving any empty slots, The exception is with slot-3, which is
used only by interface modules (IMsj. Slo t-3 is left empty even if only one rock is installed.
1 PS ::Kl75A
\~-- CPU 316 _i
3
4
5
.Li------
7
8
9
10
11
Slo1
1
L
l
(0) UR
Module
PS J075A
Cl'U31s
Orde , ~
6ES7 :.(17-lEAOO-OMO
6ES7 316-IAGOO,OABO
Ml'lodd!eu
2
I eddreu Qed«w Co_,,,
-
3
4
5
6
7
8
9 '
10
11 ~
Figure 3-13. S7-300 Cen tral Rack Configura tion, with CPU and Power Supply.
78
Working with Hordware Configurations
ACTION
1 From lhe SIMA TIC Manager open lhe required project. and rrom the project lree
select the S?-300 Station for which a central rock configuration is lo be crea ted.
2 From the righl pone, double click on th e Hardware object to open the station in the
Hardware configuration toot.
3 Open !he Hardware Catalog window, from the View menu, if it is not already
opened.
Open the SIMATIC 300 catalog object to view the S7-300 component folders.
5 Open the Rack -300 folder, select and drog the roil to lhe lop pone of the station
window lo Install the S7-3001/0 roil. The cen tra l rock is labeled O(UR}, since it ls rock-0
and the rail is always a universal rack type.
6 Open the PS-300 folder. select lhe desired power supply and drag the port lo slol- l
of the central rock.
7 Open the CPU-300 folder and then the appropriate CPU subfolder to select the
desired CPU. Drag lhe selected CPU lo slot-2 or the cen tral rock.
8 From the menu. select Station ► Consistency Check, to check for errors. The
configuration cannot be compiled for downloading unless it is found free o f errors.
9 From lhe menu bar. select Station :.- Save lo save the configuration; or if done. use
Save and Complle lo generate the System Doto l hot are downloaded la the CPU.
79
STEP 7 in 7 Steps
Essential Elements
The IM 360 is a sender inlerface module placed in the cenlrol rock of the S7-300. The
c orresponding receiver module of the IM 360 is 1he IM 36 1. which is pla ced in ea ch
additional expansion rock. Interface modules of the S7-300 are olwoys installed in slo t-3.
Application Tips
Up to three odditionol 1/0 racks ore supported by the S7-300 and you may mount them
either horizontally or vertically, A maximum distance of 30 meters is allow ed from th e central
rock to lhe lost expansion rock. The maximum distance between each rac k is 10 meters.
All1lough 1his exp ansion supports thirty-two module slots (stot-4 to slot- 11 in each rack), the
ac tual maximum 1/ 0 coun t remains CPU d ep endent.
r~ I
9 9 9
10 10 10
11 11 11
◄
Figure 3- 14. S7-300 Local 1/0 Exp ansion up to 4-ra cks. using IM 360/IM 36 1 p air.
£
80
Working with Hordware Configurations
ACTION
1 From lhe SIMA TIC Manager open lhe required project. ond rrom the projec t lree
select the S7-300 Station for which tocol 1/0 expansion is required.
2 From the righl pone, double click on th e Hardware object lo open the station in the
Hardware configuration tool.
3 Open the Hardware Catalog wind ow, from the View menu. if it is not alrea dy opened.
4 Open the SIMATIC 300 catalog object lo view the S7-300 component folders.
5 Open the Rack-300 folder. selec t and drag the 1/0 rail lo the lop pane of the station
window. If the central rock is olreody Installed it is labeled O(UR); otherwise it must be
configured be fore adding expansion rocks.
6 Ins-toll up to 3 additional expansion rocks. The rocks will be labeled from 1(UR) to 3(UR) .
7 Open the IM-300 folder, lo show lhe S7-300 expansion in terface modules. IMs
designated for sending (S) are installed only in slol-3 or lhe c entral rack. tMs
designated for receiving (RI ore installed only in slol-3 of lhe exp ansion rocks.
8 From the hardware catalog, setecl lhe correcl tM-360 interface module and drag it to
slot-3 of the CPU ro ck.
9 Select the correct IM-361 Interface module and drag lo slot-3 of each expansion rack.
10 Open the PS-300 folder; select lhe required power supply and drag lhe port to slo t-I o f
each e xpansion rock.
12 From the menu, select Statton ► Consistency Check. lo check for errors. The
configuration cannot be compiled for downloading unless ii is round free of errors.
13 From the menu bar. select Station ► Save to save the configuration; or if done. use
Save and Compile to generate the System Doto tha t ore downloaded to the CPU.
81
STEP 7 in 7 Steps
Essential Elements
The IM 365 is a sender/receiver interface module that is placed in the cen tral rack and in one
expansion rock, lo support the fixed-lier configurolion. Interface modules of the S7-300 ore
always installed in slot-3. No additional power supply is required in the expansion rack or this
configuration since power is supplied from the central rack. through the connecting bus
coble.
Application Tips
The two-tier expansion configura tion is typically used on o small installation in which
expansion beyond this fixed amount of t/0 is not expec ted. Only digital and analog sig nal
modules moy be placed in this expansion rock. Loter expansion would require removal of the
IM-365 pair and use of the IM-360/IM-361 cornbination.
5 5
6 6
7 7
8 8
9 9
10 10
11 11
◄ ~
~~ (01 UR
6ES7 3l 5-1Af02-0ABO
6ES7365-0BAO~OAAO 2000
4
5
6
_1 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _.=.J
Figure 3- 15. S7-300 Two-Tier Fixed 1/0 expansion. using IM 365 pair.
82
Working with Hordware Configurations
ACTION
1 From lhe SIMA TIC Manager open lhe required projec t. ond rrom the project lree
select the S7-300 Station for which single lier 1/0 expansion must be added.
2 From the righl pone, double click on th e Hardware objec t lo open the station in the
Hardware configuration toot.
3 Open the Hardware Catalog window, from the View menu. if it is not already opened.
4 Open the SIMATIC 300 catalog object lo view the S7-300 component folders.
5 Open the Rack-300 fold er, selec t and drag the roil to the configuration window. If the
central rock is already Installed ii Is labeled O(UR); otherwise, it must be configured first.
6 Drag ond drop one additional rock Into the configuration window. Th e single
expansion rock will be labeled l (UR) for the first expansion rack.
7 Open the IM-300 folder. lo show lhe S7-300 expansion interface modules. IMs
designated for sending (SJ ore installed in slol-3 only or the central rock.
8 Select the IM-365 interface module from the catalog and drag to slol-3 o f rack O(UR).
the central rack.
9 Select the IM-365 interface module from the catalog and drag it to slot-3 of the
expansion rock 1(UR)
10 Open the PS-300 folder. select lhe desired power supply. Click and drag the port to
slot- 1 of the expansion rock if required. A power supply In the expansion rack is only
required if the main supply is not adequa te to supporl the complele 1/0 combination.
11 From the menu, select Station ► Consistency Check, lo check for errors. The
configuration cannot be compiled for downloading unless ii is found free of errors.
12 From the menu bar, select Station >- Save lo save lhe configurolion; or if done, use
Save and C ompile lo generate the System Doto lhol are downloaded lo lhe CPU.
83
STEP 7 in 7 Steps
Essential Elements
The DP master con be configured using S7-300 CPU, wi th on fnlegro led Proflbus-DP lnter1oce
(e.g., CPU 31S-2 DP o r CPU 316-2 DP); or using o Profibus communications processor with DP
master capability (e.g., CP342-S or CP342-5 FO. for fiber optic links), in conjunction with a CPU
that supports this feature. In a ny case. the DP master will perform the some function.
In configuring the DP Moster. th e Profibus interface of the DP master must be olloched to the
d esired Profibus Subnet and assigned a unique Profibus Address (e.g.. 3-125). If not previously
set, then the subnet operating parameters (e.g.. transmission ro le. profile) will a lso need to be
set. See configuration task. Chapter 7. Adding and Configuring o Profibus Subnet.
Application Tips
Typically. a DP subnet will involve a single DP master. This is re ferred lo as a Mono-Mosler
configuration. You may also hove several mono-master systems within a project. by simply
creating multiple PROFIBUS DP subnets and attaching a DP master to each. A Multi-Moster
configuration, involving two or more masters on o single subnet, though not typical. is a lso
possible. You would do this by a ttaching the DP masters lo the some DP subnet.
B~EI
"'1 SIMATIC JOO(l)(Conf'igur.>tion) -- DP _Pl'ojJ
,a;. (OiU R
..
1 PS307 10A •
CPU 315-2 DP PROFlBUS 1 . DP ma:s!ei : e<n 1
2
7
8
9
10
•
Figure 3-1 6. 57-300 station with the CPU 31 5-2 DP selec ted as DP master.
1 PS 3071()1>. •
2 CPU316
13
.____
4
---
....... ..... -
CP342-5
!
..:-
PRO Fl8US12t OP 11\A!ler 1y llffll 1180)
5
6
7
8
9
4
~
Figure 3-17. S7-300 slolio n wllh the CP-342-5 selec ted as DP master.
84
Working with Hordware Configurations
Figure 3-18. S7-300 CPU 315-2 DP master with attached ET-200 M modular 1/0 drops.
■ 1
ACTION
From lhe SIMATIC Manager open lhe required project, and S7-300 station lo serve
as DP Mos ter. The S7-300 must be inserted lo the project ii it nol already installed.
2 With lhe S7-300 station opened in lhe hardware configuration window selec t lhe
central ro ck. Insert the required rock and power supply if ii is no t already installed .
3 If a CPU will serve as the DP master lhen the correct Profibus-DP CPU must b e
selected (e.g., CPU 315-2 DP. or CPU 316-2 DP). From the catalog open lhe CPU-300
folder, selec t and drag the required CPU to slot-2 of the central rock.
4 When lhe Profibus interface dialog is presented. select the Profib us subnet to which
the DP master should be a ttached; set or accept the suggested Profib us address
(e.g., 3-125), lhen click on the Properties button lo sel lhe subnel Transmission Rate
and olher properties if they have not yet b een set.
5 After the DP properties dialog is saved, a DP Moster system objec t should appear as
a block and white dashed line exlended from the OP masler. If lhe object is not
shown, right-click on the DP master object in row 2X2, and selecl Add Master
System.
6 You con save your work, but at least one OP slave must be attached lo compile
without errors. See the various ta sks on Configuring and Attaching Modular,
Compoct, and In telligent DP Slaves.
If a communications processor (CP) should serve as the DP masler. then the opproprio le
selection must be mode from fhe CP-300 folder under the Profibus folder. From th e CP342-5
or CP342-5 FO subfolder, find the required communications p rocessor and drag it lo slo t-4 or
higher or the central rock. The Profibus interface dialog will be presenled and lhe
configuration may be continued with Steps 4, 5, and 6.
85
STEP 7 in 7 Steps
Essential Elements
The DP master to which the DP stoves w ill be attached. will be p ro vided by on S7-300 or S7-
400 C PU, with o DP interface (e.g.. CPU 315-2 DP, CPU 4 16-2 DP); or formed by o
communications processor (CP) with DP master capability (e.g.. C P342-5 or CP443-5 Ext.) and
o compatible CPU. Each slave is ollached to a DP master system using o modular DP slave
interface module (IM) that is installed on the S7-300 mounting rail. along with on arrangement
of 1/0 modules. Each IM is o~signe d o uniqve Profibus address (e.g.. 3--125).
Several modular 1/0 styles ore available. Your choice of IM wm determine the number and
type of usable m odules. Modules supported by a g iven IM o re contained in the hardware
ca ta log. under the specific interface module (IM) folder. ET-200M. based on several choices
of th e IM -153, for example. uses S7-300 modules. The ET-200S family of Smort Connect
modules connects using the IM-1 51. Each family of modula r DP sloves is found in a
corresponding folder o t lhe hardware catalog.
Application Tips
As you attach each slave to the DP Master system, STEP 7 automatically assigns the nexl
available address. You should a llow STEP 7 to assign the a d dress. unless otherwise necessary.
Al least one modular DP sla ve d rop must be assigned to the DP master before the master will
save and compile without errors. You must configure each modular slave wi lh a l leosl one
m odule. If multiple DP master systems (i.e., DP subnets) ore in the project, ensure that you
attach the each slave to the correct subnet.
86
Working with Hordware Configurations
CPU 31 5-2 DP
X2 OP,,,_
3 ii(4JIM 153-• (S) IM 153-·
5
6 mDl
' . 7
8
Figure 3-20. S7-300 CPU 315-2 DP mosler with ET-200M modular DP sloves.
ACTION
1 From the SIMATIC Manager open lhe required project. and from the project tree
select lhe Sta tion that will serve as DP mosler for the modular slaves you will al1och.
2 With lhe DP master selected. open the Hardware configurolion tool by double-
clicking on the station Hardware object in the right pone o f the project window.
4 With lhe configuration window open lo the DP master. from the Profibus DP folder o f
the Catalog window. open the ET-200M folder and drag the required IM 153
inlerfoce module lo lhe configuration window. and drop while touching the mouse
tip to the DP master system objec t.
5 When lhe DP slave diolog is presen ted, selecl lhe Profibus subne t ta which th e DP
master will be attached; set or accept the suggested Prolibus address (e.g.. 3-125).
6 Select the IM 153 bus interface module in the lap pane, la display its configuration
table in th e bottom pone ond to install required 1/0 modules (e.g., signol modules).
7 Drag and drop each odditionol lM 153 bus interface, as required, until done.
8 From th e Station menu. perform o C onsistency C heck, then Save and Compile the
configuration.
87
STEP 7 in 7 Steps
Essential Elements
The DP master to w hich the DP stoves w ill be attached, will be p ro vided by on S7-300 or S7-
400 C PU with an integra ted DP interface (e.g., CPU 31 5-2 DP, CPU 4 16-2 DP); or formed by a
communications processor (CP) with DP master capability (e.g.. C P342-5 o r CPMJ-5 Ext.) and
a com patible CPU.
Compa c t DP sla ves incorpora te both the DP-interface a nd integrated 1/0. Therefore, there is
no interface module {IM), or mounting base as with modula r slav es. The DP-interface o f ea c h
com pa ct sla ve m ust be attached to the DP master system, a nd o ssiqned o unique Profibu s
a ddress (e.g.. 3-1 25). The combination o f 1/0 circuits of a device is selecte d b a sed upon
sig na l requirements ot the drop location. Compac t sla ves. and lhe inlegroled 1/0 each
offers m ay be viewed in the Profibus-DP folder of the hardware catalog .
Application Tips
As you attach each slave to the DP Moster Syst e m ob jec t, STEP 7 au tomatically assigns the
ne xl available address. You should allow STEP 7 to assign the address, unless o therwise
necessary. You must configure and attac h a t lea st o ne slave d rop to the DP master, in ord er
for the Mo ster to sa ved and compiled wit11oul errors. If multiple DP m a ster systems (i.e., DP
subnets) are in the p rojec t. ensure that you attach each slave lo the correct subnet.
Figure 3-2 1. S7-300 DP m a ster to which compact DP slaves will be attached. No te the DP
m aster system object (for Profibus subnet), shown os a b lock a nd white dashed line.
88
Working with Hordware Configurations
◄
6
7 ... ,
+iJ■... I PROFIBUS(2~ OP mastei system(180]
PROFIBUS add-... Module ...
Ordei number Fl... D,agr'lOWC ... ~nt
2 B-1601/1600 DP GE S7 133-08 LOO-OXB 0 1022 •
B-1601/1600 OP 6ES7133-0BLOO-OXBO 1021
B-1601/1600 OP 6ES7133-0BLOO-OXBO 1020 ...
Figure 3-22. S7-300 CP-342-5 a s DP master with compact DP slave drops.
■ ACTION
-=-===============================-
Configuring Compact Pronbus DP Slaves with ET-200B
1 From the SIMATIC Manager open the required project a nd from the project tree
select the Slotio n to serve as the DP master ror lhe compact stoves you will at1ach.
2 With lhe DP master selected , open the Hardware configuration tool by double-
clicking on the station Hardware object in the rig ht p one o r the project window.
4 Fro m the Profibus-DP folder of the catalog, open the ET-200B folder and select lhe
correct part number for the compac t slave; drag a nd drop the port onto the DP
master System object.
5 When the DP slave d ialog is presented, select the Profibus subne t lo which th e DP
master will be oltoched; se t o r accept the suggested Profibus address (e.g.. 3-125).
6 Se lec1 each compact 1/0 d rop lo displa y its configuration table in the bot1om pane
and to configure parameters of the drop if required (e.g .. Pro flbus address).
7 Drag and drop each additional compocl 1/0 block. as required. unrn done.
8 From lhe Station menu, pertorm a Consistency Check. then Save and Compile lhe
configuration.
89
STEP 7 in 7 Steps
Essential Elements
If the sla ve is ba sed on the C PU of the S7-300 then a cen tral station must be crea ted just a s it
would be normally, except Iha! o CPU with DP capability must be inslolted {e.g.. CPU 315-2
DP or CPU 316-2 DP). The DP interface of the CPU m ust b e set to op erate in DP Slave mode.
all a ched to lhe DP mos1er System. and assigned g unique Profibv~ o ddre:;s /e.g .. 3-125). The
slave must also be se t to "A c tive", if programming functions (PG/PC) and standard
communications via the DP interlace should be allowed. After the S7-300 PLCs ore
c onfigured a s slaves. they w ill be listed as c onfigured slave controllers, as shown in the dialog
below. You may then logically connec t lhe DP sla ves too configured DP master.
Application Tips
w orking with intelligent slaves ls simplified when lhe Profibus subnel and the DP master ore
already configured . If multiple DP master systems (i.e., DP subnets) are in the projec t. ensure
that you a ltach each slave to the correct sub net. Once you hove assigned lhe slaves too
DP master. the Final step is to define the master-slave d ata exchange areas. This step is
d escribed in the ta sk " Configuring Moster-In telligent Slave Do to Exchange Area."
DP slave properties
I
Gene1al Comection CGrii!J,A.Jion I
- COl'lhgured Slave CootJoteJs- - - - - - - - - - - - - - - - - ~
Ccnfigured •l•v• ccntioler• can be ccffu!cted to the PROFIBU S ma.lei.
Selecla slave ~ d click ''Conr)BCt";
S!Gve PROF!BUS Slot
'""'a=u 315-20P PROABUS[l ) 6 $7300 Intelligent OP 3 Of2/1
CFU 31~-2 [•P PAOFlBUSII 4 $73CD_lntdl enl DP. 1 0/21 1
CPU 315-20P PROABUSII) 5 S7300_1ntelli!lenLOP_2 0/2/1
•
.._ ___________________ .!.I
I I
AcliveComection- - - - - - - - - - - - - - - - - - - - - - . .
<No Connection>
OK Help
90
Working with Hordware Configurations
mm
3
4
6
6
Figure 3-24. S7-300 CPU 316-2 DP OS DP mosler wilh S7-300 PLCs OS inlelligenl DP slaves.
■ 1
ACTION
The S7-300 slotion lhol will serve os o n in1elligen1 slave must be created if no!
already in the project. IFnecessary insert o new S7-300 station. open lhe station in
!he hordwore conf1guro11on 1001. and insert !he required power supply.
2 From the catalog, open !he CPU-300 folder: drag the required CPU 315-2 DP to slot-2
of !he cen tral rock.
3 The Profibus interface dialog will open when the C PU 315-2 DP is inserted. Select the
subnet. to which the DP slave will be a ttached, then sel or accept the sugges ted
Profibus address [e.g .. 3-125]. Confirm entries by pressing the OK bull on.
4 Double -click on the DP object in row 2x2; when the dialog is disployed select the
Operotinq Mode fob and ac1ivate the CPU for DP slave mode; confirm with OK.
s From !he SIMATIC manager select ond open !he DP Moster slolion in the Hardware
Configuration tool. A DP master system object should appear as a black and while
dashed line extended from the DP mos/er object, in row 2X2. If !he DP master system
object is no t shown. righ t-click on row 2X2 and select Add Master System.
6 From !he Prolibus folder of !he hardware colalog, open !he Configured Sia/ions
subfolder; drag and drop !he CPU 31 x object onto lhe DP master system objecl.
7 The DP stave properties dialog is op ened to the Connection tab, w hich lists the
configured intelligent slaves. Selecl each stove you wish to attach lo !he DP master;
press the Connect bu tton. then press !he OK bu tton lo confirm connections.
8 You may sove and compile the lnlelligenl station, but lhe DP moster will not
compile until each slave has al least one area defined for Master-Slave 1/0 data
exchange. See the lask Configuring Moster-Intelligent Slave 1/0 Exchange Areas.
91
STEP 7 in 7 Steps
Essential Elements
If the slave is based on the CP-342-5, then !he S7-300 central station in w hich the
communications processor will be installed must be created just as it would be normally.
except that the CP-342-5 must be installed. The DP interface o f lhe CP-342-5 must be set to
operate in the DP Slave mode. attached lo the DP master System. and assigned a unique
Profibus address (e.g., 3- 125). The CP-342-5 must also be set lo "Active." if programming
functions (PG/PC) and standard communica tions via lhe DP interface should be allowed.
Arter lhe CP-342-5 is configured os on intelligent slave. ii will be listed as o configured slave
controller as shown in the dialog below. You may then logically connect the DP slaves to on
already configured DP master station.
Application Tips
Working with intelligent slaves is simplified when the Profibus subne t and the DP master are
already configured. If multiple DP master systems (i.e., DP subnets) are in the project. ensure
that you attach each slave to the correct subnet. Once you hove assigned the slaves lo a
DP master, the final step is to define the master-slave data exchange areas. This step is
descri bed in the task "Configuring Dalo Exchange Areas for CP-345-2 lnlelligenl Slaves."
Properlie• - DP sl,111c
General Cor,-,eciron I
CoofiguredSlave Contder~- - - - - - - - - - - - - - - - - ~
(#,figured slave c:oot/of4'rs c:an be c:cmecled lo the PAOFlBUS master
Seleci o dove <!llld click ''Connect".
PROFIBUS i-i SlabQn
CP 342·5 PROFIBUS(1) 7 S7300_CP342..5_1nt_OP7 0/4/0
CP 342·5 PROFIBUS(1/ 6 S7300_CP342..5_lnt_OPS 0/4/0
CP 342·5 PROFIBUS(1 I 5 S7300_CP342_5_1r'l!_OP5 0/4/0
L - 2 2-5 OFl8IJSl1 I 4 STllll LP"342 5 'r,' · Pt 0/oltll
ActiveCo1T1eC1ron- - - - - - - - - - - - - - - - - - - - -
<No Comecli!>n>
OK Cancel Help
92
Working with Hordware Configurations
5
• El]
~
6
◄
=
PAOFlBUS adclre..• fl MO!Ue ... Order number Fir... Oiago._ Con-me~
• 57-300 CP342·5 OP 66K7 342-SDAOx•OXEO 2046 ...
~ 57-300 CP342-5 OP 661(7 342-SOAOx-OXEO 2045
Ii
T
57-300 CP342·5 DP
57-300 CP342-5 OP
66K7 342·50AChc·OXEO
661(7 342-SOAOx-OXEO
2044
2043
!....
... ,
Figure 3-26. Sl-300 CPU 316-2 DP as DP master with S7-300s/CP 342-5 as intelligent slaves.
II I
ACTION
The S7-300 station that will serve as on intelligent slave must be c reated if not
a lready in the project. If necessary, inser1o new S7-300 s1otion, open 1he s1o tion in
the hardware configura tion tool, and insert the required power supply.
2 From the hardware cata log, open lhe CP-300 folder and the Proflbus subfo lder;
then drag lhe required CP342-5 to slol-4 or higher of the central rack.
3 The Profibus in1erface dialog is opened When the CP342-5 is inserted . Select the
subnet to w hich the DP slave will be o ltoched; then set or accept the suggested
Profibus address (e.g ., 3-125), and confirm the selec tio n by pressing the OK button.
4 Double-click on the DP mosler object in row 2x2; w he n the dialog is o p ens select
the Operoting Mode tab and activate the CP342-5 for DP slave; confirm with OK .
5 From the SIMATIC mana ger selec t and open the DP Mosler sta tion in tne Hardware
Configuration tool. A DP master system object should appear a s a black o nd white
dashed line extended from the DP mos/er object, in row 2X2. If the DP master system
object Is no t shown. righ t-c lick on row 2X2 and select Add Moster System.
6 From lhe Prolibus folder of the hardwa re ca talog. open the Configured Sia/Ions
subfolder, drag and d rop th e C P 342-5 object o nto the DP master system object.
8 You may save and compile the intelligent station, b ut the DP master will not
compile until each slave hos at least o ne a rea defined for Mosler-Stove 1/0 data
exc hange. See lhe task Configuring Exchange Area for CP 342-5 lnlelligen/ Slaves,
93
STEP 7 in 7 Steps
Essential Elements
The configura tion of the BM 147/CPU Basic Module. as on intelligent slave. is storied by
creating a new S7-300 station. Instea d o f plac ing a rock in the empty window. you will drag
the BM 147/CPU Basic Module lo the window. The SM 147/CPU Ba sic Module is in the Profibus
fold er of hard ware catalog. contained in th e ET 200X subfolder. like other Pro fibus nodes. the
BM 147/CPU slave must be a ttached to lhe DP master system. and assign§ld a unique
Profibus address (e.g .. 3- 125). Once configured. the BM 147/CPU will be listed as o configured
sla ve controller in the connection dialog o f the DP slave properties. You may then logically
connec t the DP slave to on already configured DP master sta tion.
Application Tips
Working with intelligen t slaves is simplified when the Profibus subnel and the DP master ore
alread y configured. If multiple DP master systems ~.e.. DP subnets) ore in the project. ensure
that you a ttach ea ch slave to the correct sub net. Once you assign the slave s too DP master.
lhe final step is to define the master-stave d ata exchange areas. This s1ep Is descri bed in the
ta sk "Configuring Moster-Intelligent Slave Da to Exchange Area ."
,
Slot- MocUe 01de1numbe, ... M .. l addle$$ Q addiess C(ffll)enl
,? BN l./7
.
, I(;," OP 12ti
3
4 DI 8xOC24V 6ES7141-1BF30·000 0
5 DO 8.xDC24V/ 1.2A 6ES7 142·1 BF30-000 4
0
Figure 3-27. The BM 147/CPU configured a s on intelligent DP slave. When o modular slave
sta tion is selected. its modules ore listed in the bottom p ane.
94
Working with Hordware Configurations
Figure 3-28. When the DP master system object is selecled, lhe intelligent slaves ore listed in
the bottom pone.
Quick Steps: Configuring the ET-200X {BM 147/ CPU) as an Intelligent Slave
ACTION
I Open the required project and create o new S7-300 station to serve as the
intelligent slave. and then open the station in the Hardware Configurolion tool.
2 From the catalog. open the Profibus DP folder. the ET 200X subfolder, then drag and
drop the BM I 47/CPU object to the emp ty top pane o f the station window.
3 The Profibus interface dialog is opened when the BM 147/CPU object is inserted:
select th e subnel to which the DP slave will be o floched; set or accept the
sugges ted Profibus address (e.g .. 3· I 25), and confirm entry with the OK bu tton.
4 From the ca talog. expand the BM I 47/CPU folder and from the signal module
subfotders, drog the required expansion sub-modules to the appropriate rock slot.
S Once the required expansion sub-modules ore entered. save the configuration.
From the SIMATIC manager. selec t and open tt1e DP Moster station in the Hardware
Configuration tool. A DP Mosler system object should appear as o block and white
dashed tine extended from the DP master object, in row 2X2. If the DP master system
object is no t shown, righ t-click on row 2X2 and select Add Master System.
6 From the Profibus folder of lhe ca talog. open the Configured Slotions subfolder;
drag and drop the X-BM 147/ CPU objecl onto the DP master system object.
7 The DP slave properties dialog is op ened to the Connection lob with configured DP
stoves listed. Select each slave (e.g., X-BM 147/ CPU ) you wish to attach to the DP
master and press the Connect bullon: confirm connections w ith the OK button.
a You may sove and compile lhe intelligenl station, but the DP mosterwill nol
compile until each slave hos al least one area defined for Moster-Slave 1/0 data
exchange. See the losk Configuring Moster-lnte/Jigent Stove 1/0 Exchange Area.
95
STEP 7 in 7 Steps
Essential Elements
When defining o data exchange a rea. on address defined a s output in the slave, will be
read from on address defined os inp ut in th e DP master. An address d efined as Input in the
slave. is wril1en lo from on address defined as output in the DP mos/er. Depending on lhe
applico lion, a single con tiguous input area a nd a single contiguous output area may be
required. or several 1/0 a reas of one or more bytes or words may be required. In either case,
you must specjfy the data unit (i. e .. bytes or words), length. and consistency. The length is the
number of doto units, and consistency delines how the data should be kept together when
transferred. If the slave CPU, or the DP master supports process image partitions (e.g .. S7-400),
then you may specify the partition number lo which the a rea should be assigned.
Application Tips
Whe n specifying o dola area for an $7-300 slave, you must not use input/output addresses
assigned to installed modules. If the data a rea is for the BM 147/CPU. then the useoble
address ra nge for the slave is from by te 128 through 159 for bolh the Inp ut and ou tp ut a reas.
DP ~cJ.i...,.;
3 DPaddresr 14
Name: jDP-Mattet ~lame: lop
Addles s.l)ipe: lou1put 3 Addre,~ type; jtnput 3
Adcieu; !40 Address: J2
''SJot''! !4 "Siot'~ 14
Procen image: ]001 'P' 3 Proc=,nage: jt"JB Pl 3
lntem4)1 OB:
3 Dr1rJr~..,,:l(i = I
Length 12 ~ :
Uoc jB}4a 3
Comistency: lurt :::I ;!,]
11'
I />ppl,o
I C-aocel I H~ I
Figure 3-29. Dialog for configuring master-intelligent slave dola exchange area.
96
Working with Hordware Configurations
ACTION
1 With the DP Moster station open in the Hardware Configuration tool. in the top
pane, double click on the intelligen t DP slave objec t for which you wish lo define
data exchange areas.
2 When the DP slave Properties diolog is presented, selec t the Configuration lob to
open the dialog for defining mos1er-slave exchange areas. Exchange areas that
hove already been defined will appear as rows in a table. Each row represen ts - In
the end. the number of rows will depend on the number of separa te areas you
need to define.
3o To define o slave input orea, selec t Output as the Address Type in th e DP master
column. and in the Address field enter o start byte number for the logical area from
which data will be sent to the DP slave. Select Input as the Address Type in the DP
stave column. and in the Address field enter o start byte number in which data will
be received from the DP master partner.
In the lower part of the dialog, define the length ol th e data area: select the unit of
the data as bytes or words: and define the consistency o f the data according to
the unit or total lenglh. The consistency defines how the data should be kept
together and maintained during transfer (e.g.. byte. word. total length).
So Click in the Comment field to enter information associated wi th the data area.
6o Conflrm the entry by pressing the OK button lo enter the defined logical area. The
defined area w ill be entered as a Configuration Row on the Conligurolion tab.
3b To define a stave output area, select Input as the Address Type in the DP master
column. and in the Address field enter a start byte number for the logical area in
which data wrn be received from the DP sla ve. Select Ovtpvt as the Address Type in
the DP slave column, and in the Address field enter a start byte number from which
dola will be sent lo the DP master partner.
4b In the lower port of the dialog. define the length o f th e d ole area: select the unit of
the data as bytes or words: and define the consistency of the data according to
the uni/ or total length. The consistency defines how the doto should be kept
together and maintained duri ng transfer (e.g.. byte. word. total length).
5b Click in the Comment field to enter information associated w ith the doto oreo.
6b ConFirm the entry by pressing the OK buflon to enter the defined logical area. The
defined area w ill be entered as o Configvrotion Row. The p rocess may then be
repeated to define a no th er logical data exchange area.
97
STEP 7 in 7 Steps
Essential Elements
When defining the data exchange area, on address defined as output from the slave will be
read to on a ddress defined as inpu t to the DP master. An address d efined as Input lo the
slave is written to from on address defined as output from /he DP master. Dep ending on the
1/0 application, a single contiguous input area and a single contiguous outp ut area may be
required. or several area s of one or more byte or word units may be required. In either case.
the d oto unit (i.e., bytes or words). and consistency must be specified. Consistency defines
how the d a ta should be kepi together when tronsrerred; by the unit (e.g .. byte. or word). or
by the total length. If the slave CPU or DP master suppom using process image partitions
(e.g .. in S7-400). then o partition number to which area should belong may be specilled.
Application Tips
When defining the Input/output address areas. you must no t use address bytes that hove
been assigned lo installed modules.
ma m
DP.,.b<°..Jl)f'
ill] ~
-:,-1------1----------+---------------·· I
Figure 3-30. S7-300 lnlelligent slave with Universal modules for configuring doto exc hange.
98
Working with Hordware Configurations
Properties - DP slave :
Addi&: / ID I
1/0 Type; In ct. 3 OiectEnby... j
lr'C)IA
Addres,:; Lel'.l!lth: Unit Con~tent ovei:
Start: j4D 12 3 !Byte .:] lunl 3
End: 41
PJoc= image par\ijon fop Pl 3
Data forSpecilic Maoolacturer.
(Mai<im1111 14 bites heicadecimal, sepa,ated by comma 01 blank space)
OK
I C.,ncel I__H_e_lP_ _.
Figure 3-31. Configuration dialog for 1/0 d o to exchange w ith CP-342-5 slo ve.
ACTION
1 Wilh lhe DP Moster sta tion open in the Hardware Configuration tool. In the top
pone. and select lhe in lelligent DP stove objec l for which you w ish to define doto
exc hange oreas.
2 From lhe hordwore cotolog and under the Configured Slolions folder. open the 57-
300 CP-342-5 DP folder; then find the Universal Module and drag one or more
modules to the configuration toble in the bo ltom p one. The number of modules
installed will depend on the number of separa te areas you need to define.
3 Double -click on o module to open the configuration dialog for defining the data
exc hange area.
4 Select the 1/ 0 Type as Input, if the module receives input data from the master; as
Ou/put. lo allow lhe module lo send d alo to the master. Selec t Output-Input. to
allow the module to accept inpul from the master and to send output data to the
master. Select Empty Slot lo leave on unused area within lhe defined area.
5 Nexl, define lhe length of the d ata area; select the unit of the data as bytes or
words; and define the consistenc y o f the data according lo the unit or totaJ length .
The consistency defines how lhe da la should be kepi toge ther and maintained
during transfer (e.g .. byte. word. total length).
99
STEP 7 in 7 Steps
Essential Elements
The Short DescripHon . the some os given in lhe hardware cotolog. gives important CPU
features such as work memory size, cycle time/1000 instructions. digital 1/0 capacity,
supported connec tions. DP/MPt ports. multi-computing ond routing copobitlty. The Order
Number reflec ls the module assigned In the configuration tool ond con be compared lo the
installed module. The Name fie ld shows the delaul1 name of the module. which you can
modify as required. Changes to the CPU name are reflected in the SIMATIC Manager.
The Interface parameter group. generally on modules with communications interfaces. shows
basic information such as node address and whether or not the node is o ltached. The
Properties bu tton provides quick access lo parameters ol lhe in lertoce; but interlace
properties [e.g .. MPI. Profibus, a nd Ethernet) are generally set in the hardware configuratio n
tool. The Comment field a llows more details about the C PU application to be documented.
Application Tips
The user-defined Plant Designation identifier. available with some CPUs, is a user-defined
identifier that con be evaluated in sta rt-up OBs the user program, Examples of evaluating the
"plant designation" ore provided in the STEP 7 Sample programs.
•
ikl·l·t911t4AdA1flt·Al;J•tfti.-::
Tim~·ol·I>~ lntenl.C)tt
General ] St~
I CJ>Ci~ lntent1pt
Cyds/Cb;k Memory
D~1tic,/Clock
J A8'eotive M-y
I
Sholl Oewipliorr CPU316
p28 KB work momoty; 0.3 m~/1000 iMtruclioAs; MPl caw,clion,
[ti-lief cor11i,.&181ion up to 32 mcdiles
.:J
6ES7 316-1AGO!l.(W!O
lntorf,ice
Tl\'.llr. MPI
Addre~ 7
.:J
I OK I Hel\, !
Figure 3-32. CPU Properties: General porometers d ialog (e.g., CPU 316).
100
Working with Hordware Configurations
Con-rnert
I OK I Help
Figure 3-33. CPU Properties: General parameters dialog (e.g .. CPU 318-2).
ACTION
I With o sla tion open in the Hardware Conrlgura tion tool select the CPU, right-click
and selecl Object Properties, lhen select the Generol 1ab.
2 The Short description of the module provides a brief summary o f th e unique features
or lhe installed CPU module: it connol be modined.
3 The Order Number of the module is the specific number used to identity lhe exact
CPU that should be installed in the rock. The order number determines the unique
feolures of lhe CPU, which ore summarized under lhe Short Description.
Click in the Name field to modify the default name assigned lo the module. The
default name is based on lhe short name of the selected CPU lype (e.g .. C PU 318).
5 The Interface static group, shows lhe module's set MPI address (default - 2). and
whether or nol lhe module is attached lo lhe network: the Properties button allows
the module's lnlertace parameters lo be accessed for viewing or editing.
101
STEP 7 in 7 Steps
Essential Elements
The parameter Startup If Setpolnt and Actual Configuration Differ. determines if the CPU
should be allowed to start-up if the setpoin t and actual confi gurations differ - the default
beha vior in the S7-300, is lo start even if the setpoint and aclual configurations d iffer. The
parameters Reset Outputs at Hot Restart and Disable Hot Restart by Operator are bo th
grayed since the "hot restart" does not apply to the S7-300. The Startup After Power-On
parameter is generally g rayed out and fixed to "Worm Restart.'' since it is generally the only
start-up mode possible in S7-300 CPUs - in newer S7-300 CPUs like the CPU 31 8, ii is possible lo
selec t whether o start-up o fter Power- On will initiate a "Cold Restart, " or a "Worm Reslorl, "
The Monitoring nme parameter, Finished Message, specifies the maximum C PU wait-time. a t
power-up. lo receive ready-signals fo r a ll configured modules. The parameter Transfer of
Parameters to Modules specifies lhe maximum lime tor modules, including DP-In terface
modules, lo acknowledge receip t of their configuration parameters (the wait-time sta rts ofter
receipt of the "Finished Message") . If either of th ese two monitoring parameters ore not
acknowledged before the se t time e xpires, the prese t and actual configurations will be
considered different. The CPU reaction is then determined by the parameter "Startup ii Prese t
and Actual Configuration Differ." Finally, th e Hot Restart parameter applies only in the S7-400.
TfmMl·D~.dntem,c,ti
General Si.,t~
I Cydc lrnell\lpt
I C}'Cle/C10ck MeJllOo/ J
I Di<lOlQttlc.vOock
Rele<itive Memoty I
I
MEfl'JOI.Y
Piohii:lioo
I ,,..em.¢
I
J; Star~ v-hen e~pee!td/~tu!I conl'IQlieii«I dlfei
P Flr :l!l 011lp\Jl •l,rl 1r 1111
J;1 D1-.rl'I,;, t/pln,,;lar; l·y <!P1l•at.or llor e1<amp e 1;0'11 PG)
Qr c~111~:,-q017 cb /Qr eiiarnpe fTom llf'I $\itlrrvl
StatupaftaPowerOn- - - - - - - - - - - - - - - ~
Hoc~.·a111oom, In
I OK I Help j
Figure 3-34. S7-300 CPU Properties: Start-up parameters d ia log.
102
Working with Hordware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired project and station:
select the CPU module. right-click and selec t Object Properties. then select the
Startup lab. Parameters that ore grayed ore either not possible in the S7-300 or in
the open CPU.
2 Activate the check box Startup if Preset and Actua l Configuration Differ, to allow the
CPU lo start even ir the preset and se tpoint configurations differ. With this selling,
central rock or distributed 1/0 modules are not checked; PROFIBUS-DP interface
modules ore checked and must be inserted ror the CPU to start. This parameter is
activated by default in older S7-300 CPUs and cannot be changed.
3 De-activate the check box to disable Startup If Preset and Actua l Conflguratlon
Differ. If at least one configured slot differs, then the CPU switches to STOP. If
module-slots other than those originally configured hove inserted modules. they ore
not compared. This setting is generally not possible wilh older S7-300 CPUs.
4 The parame ters "Reset Outputs at Hot Restart" and "Disable Hot Restart by
Operator" are grayed since they ore only possible in the S7-400.
5 Where allowed. select "Cold Restart" or "Warm Restart" as the mode of Startup After
Power On. The option is flXed to "Worm Reslor1 " In older S7-300 CPUs.
6 Set the parameter Anlshed Message, in milliseconds, lo specify the maximum CPU
wall-lime ror configured modules lo signal ready for opera tion ofter power-up.
8 The Hot Restart parameter is grayed, since Hot Restart is not supported in the S7-300.
10 Use the toolbor Save and Compile b utton lo generate the sys-fem data blocks.
103
STEP 7 in 7 Steps
Essential Elements
The Update Process Image Cyclically porometer determines it the p rocess imoge of inpu ts
and o utputs should be updated cyclically. This poromeler is fixed lo always update the Pit
ond PIQ in the S7-300. but moy be a ltere d in the CPU 318. The Scan Cycle Monitoring Time is
the limer volue thot if exceeded by the CPU cycle, the CPU is slopped. The Minimum Scan
Cycle. not applying to the S7-300. is grayed. The Scan Cycle Load from Communications
allows o percentage of the total processing time to be allocated to communications.
Adjusting the Size of the Process Image Inputs and Process Image Outputs, perha ps to reflec t
actual usage, is o nly re levant in the CPU 318. The parame ter OB 85 Call Up at 1/ 0 Access
Error, is generally grayed and by default is fixed such thot 1/0 access errors do not result in o
coll of OBS5. no r is on entry mode In the diagnostic buffer. In loler CPU revisions. o ther op lions
for colling 08 85 include "Only for Incoming and Outgoing Errors". or "On Each Individua l
Access." Finally. the Clock Memory parameter allows a byte from Bil memory {M) lo be
sp ecified as the location w here the CPU will output eight individual clock-pulses.
Application Tips
Clock p ulses, ore accessed in the user program, via the eighl bits of the specified byte. From
the most-significant lo the least-significant b it. the output frequency is 0.5. 0.625. 1.0. 1.25, 2.0.
2.5. 5.0. and 10 Hz. These pulses ore used instead of timers, where periodic signals ore
needed. Typica l uses include fla sher-circ uits, a larm synchronizatio n. or where even ts must be
con tinuously triggered a l periodic intervals. Clock p ulses ho ve o n on/off ratio o f I : 1.
iQJijH§di¥1341fil·Miti•M1--=
Time-d-Da_yl~errulll~ I Cycle lntenvcil } 01,~not~t/Oock ] Protectm }
Gerieral I Staitw, Cycle/Clock Memory ) Reteivive Memoo, I Memo,y lntem.¢ I J
- Cjd&
w Update 091 proceu i~ ac~
0885 · Cal Up-at l/0 Ace= Enor INo 0885 ca.1 IJI> .:]
At each indi-.idial ;,cceu
' ' .
~ Merna;,-----------------------~
P Clock merroy
M ~ 8;,te< 120
I, OK I Cancel j __H_e_~_...
Figure 3-35. CPU Properties: Cycle Time and Clo c k Memory parameters.
104
Working with Hord ware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired projec t and station:
select the CPU module. right-click a nd selec t Object Properties. then select the
Cycle/Clock Memory fob. Parometers tha t are grayed are either no t possible in the
S7-300 or in the op en CPU.
2 Ac tivate the checkbox Update OB 1 Process Image Cyclically for cyclic updates o f
the process image tables /Ptl/PIQ). This default setting is genera lly fixed in most S7-
300 CPUs and c annot be changed. De-oc tivote the checkbox to disable normal
cyclic updates o f the p roc ess image; 1/0 upd a te musl b e handled by calling
blocks.
3 In the Scan Cycle Monitoring Time field, sp ecify in millise conds. the cycle time tha t
the CPU is not to exceed. If the actual cycle time exceeds this watc hdog time, the
CPU enters the STOP mode. unless OB 80 is loaded in CPU memory.
4 In the Minimum Scan Cycle Time field specify. in millisecond s, the minimum time
that should be used to process the program. If the octuol cycle lime is less than the
specified minimum, the CPU waits until the minimum cycle time expires. or if O B 90 is
fn memory. this remaining time is used by the C PU for b ac kground p rocessing.
5 In the Scan Cycle Load from Communications field. en ler o value from 10 to 50. a s
a percent of the set cycle lime ta alloc a te for c ommunicalions p rocessing.
6 Click in the Size of the Process Image Inputs field and enter on end byte -address for
the Ptl Iha! reflects the actual number of input-by tes (Pit) installed. The PII up date
lime is thereby minimized. The parame ter is only relevant in some S7-300 CPUs.
7 Click in th e Size of the Process Image Outputs field and enter on end by te-address
for the PIO that reflec ts lhe actual number of outpu t-bytes /PIQ) installed. The PIO
update time is thereby minimized. The parameter is only relevant in some S7•300
CPUs.
8 Where the OB 85 Call at 1/ 0 Access Error parameter is allowed, select the option
" No Colt of OB 85" it 0885 should not b e c alled w hen a n 1/0 a ccess error occurs
during up d a te of the process images /PII/PIQ) : select the option "Only for Incoming
ond Ou tgoing Errors." lo minimize lhe impac t on the CPU cycle. The option " On
each individual access" c on resull in on increase in CPU cycle lime.
9 To use clock memory, aclivale !he Clock Memory check box and lhen enler a byle
/e.g., MB 97) from Bit Memory, ta use for CPU output o f eight individual clock p ulses.
11 Use the loalbar Save and Compile b ulton lo generate the syslem data blocks.
105
STEP 7 in 7 Steps
Essential Elements
In the S7-300 ports of bi t memory (MJ. timer [T). ond counter (C) oreos moy be defined os
re tentive. The first three parameters require an entry of the number of bytes, timers. or
counters lo reserve starting rrom byte-0, limer-0, or counter-0 respectively. An entry of 4 in
the bit memory field reserves byte-0. 1, 2, and 3 as retentive. In addition lo these re tentive
memory areas, the S7-300 also ollows Da to Block a reas to be reserved a s retentive. The
defined areas will reta in its data given power loss and even the loss of bol1ery backup.
Finally, the ma.ximum size tha t can be reserved as retentive is dependent on the CPU.
Application Tips
Recall that under normal cond itions involving loss of power, the contents of data blocks are
a lways retained by battery backup. The maintenance free S7-300 feature, described here, is
to protect against loss of the areas defined as retentive not only g iven a lass o f p ower, but
particularly a loss of battery backup.
i4i,i,ldlit4434fEll·li;lrttt➔ ----- ~
Time-ot-0">' Irterrupl;
Gene•¥ I Storlup
I Cydc lrterrupl I
Cycle/Q;,d< Mem()l)I
Di<!'..}!l(l;tiCJICkii;k
RetmeMemoiy
P,otoolion
lnten~
I
I
RetMMy- -
Nurrber Q/ Mem01y Bvtei Startiig with MBO: Im
Nlf!i>er Qf S7 Tmeu Starmg with TO; lo
Nurrh!r of S7 Counters S~rti-Q wilh CO; la
Alea,
-
OB No. BvteAdd1en NLfli>er ol Byl~
Retem-,,e Aiea 1. 1, 0 lo
Relerlrve A1ea? 1, 0 lo
Re1~ A1eal. 1, 0 lo
Reterwe Area 4: 11 0 lo
ReterweA1ea5: 11 0 lo
Reterwe A,ea & 1, 0 lo
Relenr,,e Area r 1, 0 lo
Reterlive Area a It 0 lo
I OK
I Cancel Help
106
Working with Hord wore Configurations
ACTION
1 With the Hardware Configuration tool open to the desired projec t and station:
select the CPU module. right-click a nd selec t Object Properties. then select the
Retentive Memory tab to d efine required re te ntive memory a reas.
2 Click in the Memory Bytes field , a nd enter the total number of bytes to define as
retentive. The defined oreo starts o t MB Oo nd will inc lude oll by1es up to MB n- 1.
3 Click in the S7 Timers field and enter the numb er of timers to d efine a s retentive. The
defined re tentive oreo starts at TO. and will include all timers up lo Tn- I.
4 Click in the S7 Counters lleld and enter the number o f counters 10 define as
retentive. The defined re tentive area starts a t CO, and will includ e a ll counters up to
Cn-1.
5 To d efine retentive doto b loc k oreos as required, start with Retentive Area I and
enter the data block number in the DB No. fie ld; enter the starling By1e Address in
the second field: o nd en ter the total Number of Bytes in the los t field. Using on even
number for both the start a d dress a nd the total number of bytes will help to o void
o verwriting d ata areas.
7 Use the toolbar Save and Comprte b ullon to genera te the system data blocks.
10 7
STEP 7 in 7 Steps
Essential Elements
Each CPU ha s a fl.Xed amount of local memory that is equally divided among the priorities
classes (1-29). As will be discussed in more detail later, all code blocks (e.g., FB, FC. SFB. and
SFC) are called direc tly or indirectly from on orgonl1.ation b lock (OB) for processing.
Furthermore. all organiza tion blocks ore called by the operating system based on a pre-
assigned priori ty class. Since local memory is allocated to the priori ty of OBs. the local
memory available to each code b lock is based on lhe OB from which the block is called.
In C PUs where local memory may be re-allocated. the memory assigned too priority con be
re-distributed to where it is needed. In some cases for instance, a priority class is not in use or
all of its local memory is no l needed. Re-allocation of the local memory is useful since p riority
classes do not all need the same local stack size. High priori ty classes. for example. do not
normally involve large dala requirements or more lhan two levels of block calls.
CPU 315
48 KB Mlfk mernocy; 0.:3 mtn 000 ~!l,uctioos; MPI comecllon: mulli·tlei ..._
c:onhgu,atlon I.Ill t() 32 m ~
c-~
OK I Help
Figure 3-37. CPU 315 - No Memory tab. All priorities allocated 256-bytes.
108
Working with Hordware Configurations
~ ommuooat,on Aesouoes
,11<n rn,, r,= !rt';l,lf :111 <tr j'l"'J :I
I
I OK I J-1elp I
Figure 3-38. CPU 318 local memory parameters. Memory re-ollocotion allowed.
ACTION
1 With the Hardware Configuration tool open to the desired project and station;
select the CPU module. right-click and selec t Object Properties, then select the
Memory fob to make required changes to the local memory areas.
2 Click in a Priority field and enter the total number of bytes to define for each priority
class. A minimum of 20 bytes must be en tered to satisfy the minimum requirement of
every organization block For storing 20 bytes of start information used by lhe CPU.
The value must be divisible by 2.
3 Modify as many priori ty classes as required and confirm settings with OK.
4 Use the toolbar Save and Compile b utlon to generate the system data blocks.
109
STEP 7 in 7 Steps
Essential Elements
Three parameters influence the diagnostic buffer. Ac tivating the Extended Functtonat Scope
causes the CPU to enter events other thon stand ard errors into the d iagnostic buffer. For
example. each stort of on organization block is considered o d iagnostic event. The increase
in d iagnostic events will cause the b uffer to overflow sooner. and make it more likely tha t
important messages will be overwritten. In some CPUs the parameter Number of Messages In
Buffer, allows the d iagnostic buffer size to be adjusted. The buffer normally holds 100
messages. The parameter Report Cause of STOP, if activated. causes each CPU STOP to be
entered in the buffer and reported to a designated PG/PC or operator panel.
Application Tips
The extended scope cannot be octivoled in STEP 7 ofter V3. I. If the parameter was
previously active in a project now being converted from V2.x to V3. I or higher. then the
setting con now be downloaded to the C PU or de-octivoted.
"
- Clook
Sj.'nchroniz11tian Sj.'ncm>nizatian Mode T~ lr,_erv.il
ln t'1eP.LC: IA,mc11te1 311 minute 21
On MPI: IA, master 311hOUI .:J
On /✓Ff• J1(1(1 3 Ir II .:J
[ Dl11ect,on Fector (ms]: 1,000
J
110
Working with Hord w are Configurations
ACTION
1 With the Hardware Configuration tool open to the desired projec t and station:
select the CPU module. right-click a nd selec t Object Properties. then select the
Diagnos tics/Clock tab to make the required changes.
2 Activate the Report Cause of STOP chec k box, to hove oil causes of stops to be
entered to the diagnostic buffer and to be sent to a designa ted PG/PC or operato r
panel. Otherwise deactivate the c hec kb ox to minimize the number of events
entering the b uffer.
3 In the PLC lield und er Synchronization Mode, selec t As M aster, If the clock will
synchronize o ther clocks; select As Slave, if the c lock will be set by another local
clock; or select None if the local clock is not to be synchronized .
4 In the PLC field under Time Interval, selec t the synchronization in terval. if th e clock
was set lo synchronize other clocks. In most 57-300 CPUs, the synchro nization mod e
can only be set fo r Master.
5 In the MPI field under Synchronization Mode. select As Mos ter, if fhe clock w ill
sync hronize other c locks; select As S/ove. ii the c lock will be set by a nother local
cloc k; or set None if the loc a l clock is not to be synchronized . In most S7-300 CPUs.
lhe ex ternal synchronization mode con only be se t for Slave.
6 In the MPI field und er Tlme Interva l. selec t the synchronization interva l, if the clock
was set to synchronize other clocks.
111
STEP 7 in 7 Steps
Essential Elements
Using CPU access pro tection invo lves setting the proteclion level and ii reQuired, defining a
password. Once configured. the protection level and password is downloaded to the
module with the configuration data. Complete read and write access is possible for all
password holders. regardless of the key-switch position. Otherwise. three levels of p rotectio n
may apply to non-password holders. level 1 is the default setting in which standard key-
switch access is in operation. level 2 provides write-pro tection; read access is possible. but
write access is denied without the password. level 3 provides read/write protection, which
means that both read and write access ore denied. independent of the key-switc h position.
Application Tips
On C PUs of series S7-31xC. the opera ting mode switch is not a key-switch. In this case, the
switch has only two positions, RUN and STOP. Both of these positions have no restrictio ns. For
this reason, setting a password for protection tevet t is not possible .
iPl·lH3iii@341111•0i;i14fl _ _ _ __
...
Genetal I St.lit~ Cvcle/ClockMemory I Rete~e Memoiy I lnterrl4)ls
Time-1ll-Day lnlerruptt 1 Cyclic lntenupt I Diagr,ostiC$/Clook Proteclion
(" 3. W1ite-lFleadPtotewon
P1r. <Y1ord r. Te~ Mode
OK
, I Help I
Figure 3-40. CPU Properties: CPU Access Protection tab.
112
Working with Hord ware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired projec t and station:
select the CPU module. right-click a nd selec t Object Properties. then select the
Protection lab.
3 Activa te the Removable with Password op tion to allow reod and write access lo
password holders. independent of the key-switch p osition. A password must be
entered in the Password field and in the Enter Again field as confirmation.
4 Select Level 2 Protec tion by first octivo ling the Write Protection radio button: then
enter and confirm the desired password in the appropriate fields. In this mode, data
and programs may be monitored, but write operations such os dow nload or modify
variables is only permitted to p a ssword holders.
5 Select Level 3 Protection by first activating the Write-Read Protection radio b utton;
then enter and confirm the desired password In the opprop rio le field s. In this mode,
read and wri te operations ore permitted to p a ssword holders only.
6 Activate the Process Mode o f opera tion in order to restrict PG/ PC test functions
such as program status or monitor/modify variables; lhe in ten t is that the sel
permitted scan cycle time increase is not exceeded. In this mode. testing with
b reakpoints and single-step program execution ore no l possible.
7 Activate the Test Mode o f opera tion if there should be no time restrictions p laced
on test functions via the PG/PC. Realize that these operations may result in
consid erable increa se in the CPU c ycle time.
9 Use the tootbor Save and Compile b ut Ion to genera te the system dola blocks.
11 3
STEP 7 in 7 Steps
Essential Elements
Each S7 interrup t hos an associated organization block tha t is called by the operating system
for processing whenever the interrup l occurs. Which of the listed 08s are actually available is
CPU-dependenl. OBs that are not supported in a CPU o re g rayed out. In most 57-300 CPUs,
for example, OB 40 Is the only hardware interrupt; OB 20, the o nly lime-delay interrup t. The
CPU 318. and some newer CPUs. support additio nal in terrupts. The p riority is generally fixed in
lhe S7-300, but where changes o re allowed only the allowed a lternates should be used.
Hardware a nd lime-delay interrupts alternates include 2-ta-24; asynchronous interrupts a llow
24-to-26; and DPV l in lerrupls allow 2. 3. 4. 9. 12. 16. and 17. A priority or zero essenliolly
deactivates on inlerrupl OB. To avoid loss or interrupts. you should not assign o priorily twice.
Proeett
- Time-De1QY lnl~l4llt
Pio=
r lntem~s
A,,inc. Eir01 lntem,pt$
111',i,ge Pria,ity;
'
~II P1i::11ly: partJioo:
p~ p&rt~ion: 0981: (25"
liif fns1!-'A 3 0820· (3 3
Ir ~ .p.,
~
0840: 0082:
0821· µ- los f>J,3
0841 : fiT loa1 PA 3 0883: ~
DB?; fo lra1-PA 3
oe12 Fi'"" [oa1 PA ~
0843' (o joa1PA 3 P823 fu""" joa1~A 3
0&84', r
0985: f25
fJB<I-I (o IOB Pt,- i] lnloul.4)ls for OPVI 088!>: (25"
VS.45' fo lnr,1PA 3 0887:f25
Poorty;
PBAG (o I!:Bl -1:P 3
0855·'2 ne~ w=i
{JH4• [o [t l:n "'A 3 0856.j2 0672 lii7
0857· '2 0137.3 [i7
I OK I Cancel
I Help
I
Figure 3-4 1. S7-300 CPU Properties: Interrupts Parame ters dialog.
114
Working with Hordware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired project and station:
select the CPU module. right-click and selec t Object Properties. then selec t the
Interrupts tab lo make your desired priority-class changes (optio na l).
2 OB40 is the only Hardware Interrupt OB in most S7-300 CPUs and it hos o fixed priority
(priority- 16), If the open CPU supports modifying the defau lt priority then you may
enter o new value of 0. or 2-24. A value of zero may disables on OB.
3 OB20 is the o nly Time-Deloy Interrupt OB In mos1 S7-300 CPUs and it has o fixed
priority (priorlty-3) . If lhe open CPU suppor1s modifying (e.g.. CPU 318) the default
priority then you may enter a value of O. or 2-24. A value of zero disables on OB.
4 OB81 is lhe only Asynchronous In terrupt OB in most S7-300 CPUs and it hos o fixed
priority (priori ty-25). lf the open CPU supports modifying the defa ult priori1y then you
may en ter a value of 0. 2-4, 9. 12, I 6. I 7. or 24-26. Using the default value or a value
in the range o f 24-26 ensures th at asynchronous error OBs ore not be interrupted by
other interrupt events.
S Where the priority of DPVl Interrupt 08s is allerable (e.g.. CPU 318). you may enter a
new value of 0, 2-4, 9, 12, 16, 17, or 24. A value of O is in effect d isabling the OB.
115
STEP 7 in 7 Steps
Essential Elements
The properties tab for time-of-day Interrupts lists Organizalion Blocks OB 10 through OB 17.
These ore the eight time-of-day interrupts supported by S7. however OB 10 is the only time-of-
day interrupt supported by most S7-300 CPUs. The CPU 318, and perhaps some newer CPUs.
will support addi tional in terrupts. The CPU does not support OBs tho t ore grayed out.
Configuring a time-of-d ay interrupt requires activa ting the OB. selecting the execution
interval, and setting the sta rt dole and time. The priority is generally fixed in the S7-300. but in
CPUs that support changes alternate priorities 3-24 must be used.
Application Tips
Programming o time-of-day interrupt involves setting the start parameters, activating the OB,
writing the code for the OB, ond downloading the OB lo the CPU. The OB is then ready lo act
a s the service routine - called when the interrup t is generated. The parameters of time-of-
doy interrupts may be set here in the hardware configuration tool. or from w ithin the STEP 7
program, using standard system functions. TOD interru p t applicatio n might include
generating operator messages o r p roductio n reports, or scheduled process readings.
•
l'ropcrltcs - 1
!k 11i·Ai4 #-tf- - 1 ~
Geoeial I Star\logl 1 Cycle/Clock Memory Retentive Memory I lnteif\4lU I
Time-ol-Day l~em~ts I l
Cyoi,c Inletrupl - Diagiosbcs/Clock I Prolection I
P1oces$image
Pr~ Active Execution Stat dale Time of day priiQn
0810. J2 ~ jonce 3 ]0201.os 1,000 JI 1 P 3
Jlil 1 r r IIle lC 3 (11 01 lo~ou OB Ft 3
0B12- r r jtkne 3 10, 01,Sl lu&uu 081-F,; 3
OB1~ r,,- r
r
I Nl'!'"l<' 3 11:ii 01 ~ jor 111 181 p,., 3
OB1,t IN 1 3 Ei, 01 "' 1111: no OPl.P 3
0815- r r 111 ,, 3 fo1 01 ~ lac oo Dfll ,f,'I ::l
OB1S: r r IN110 3 j1J1 01 " l □r 'ln 08 FA 3
0917 r [" ltj ltl 3 1111 01 S4 Im1111 081 f-A 3
116
Working with Hordware Configurations
IQJ,f,I41'1¥Ud41ili;fhi4•4t1- ~
µ ~nil! 41 I Sle!hJp I C-__ycle/Cloel'I Memory I AetMliv6 Mernory I ldemoiy Interrupts ]
Time·ol·D~l' lnten~ls I C,IIClic lnterrupl 0 iagnolbos/Clook J Prolectioo J
Process image
Prmy ActrYa Execution Staat dala Time ~ day pa,tiion
OK
I Ceocel ]
ACTION
1 With the Hardware Configuration tool open lo the desired project and station;
select the CPU module, right-click and selec t Object Properties. then selec t the
Time-of-Day Interrupts fob .
2 Select the time-of-day interrupt OB w hose porometers you wish to alter: to modify
the Priority c lass c lick in the field and enter a valid a lternate p riori ty of 3-to-24.
3 Click inside the Active check box to activa te th e 08. Time-of-day interrupts may
a lso be activated from lhe STEP 7 program using system function SFC 30 (ACT_TINTJ.
4 Click the drop orrow in the Executlon field. a nd select whether the OB should be
called o nce. every minute. every ho ur. every doy, every week. every mon th. every
month-end. or every year. Time-of-day interrupts may a lso be set from the STEP 7
p rogram. using system function SFC 28 (SET_TlNTJ.
5 Next. click in lhe Start Dale tietd and enter the slar1 dal e for the time-of-day
intemJpt. If the stor1 dote is not entered on the properties dialog. it c an b e set from
the STEP 7 program using the system functio n SFC 28 (SET_TINT) .
6 Click in the Time of Day field and enter the start time for the lime-of-day interrupt.
The start time can be entered here on the p roperties dialog. or from the STEP 7
p rogram. using the system function SFC 28 /SET_TINT).
7 Confirm the configuration parameters with the OK bullon and use the toolbar Save
and Compile button to generate the system da la blocks.
117
STEP 7 in 7 Steps
Configuring changes to default parameters is not necessary unless required. The priority is
generally fixed in the S7-300, b ut in CPUs that a llow changes only the allowed a lternates (i.e ..
3-24) should be used. It is a lso important that a priority is not assigned twice, so as to ovoid
loss o f on interrupl. It is also possib le to modify the period of execution and to enter a Phase
o ffset va lue. If several cyclic interrupts ore ac tive. o phase o ffset will ensure thol interrupts ore
distributed throug ho ut tne CPU cycle and do not trigger simultaneously.
Properties - iii1Ell·Aiti•t+t1~
Gener-,1 lStail~ J Qocl$/Clo,;k Mel!IQIY J Retenti~ Mem01~ ] lnlen\Jpis I
Trno«•D~ lnlerrlllt~ Ci,clic tnte1n.1pl J Dlbslrmtics/Clocl-. I Protecl1on I
Process irMQe par!Jion
Prlonty E:kectiion (msl Phase olbe.4 (ms)
OBJ/J. r, I.1.JL lu IDB1 r'A 3
OB.21 r I.JI,,. lo 1001.oA 3
0832: r I 01"' lri j'181 f',<\ ..:.I
081'3 rio- lsoo lo IOB1·P/> :.=:J
08~4 r,- 1·00 II:) lDB1 -'1\ '.'.:]
0B35: Im (100 lo IJB1 Of:, 3
llB;n r lslJ lo loe1 :::it,. 3
0837- fit I,1 I 111 1001 PA 3
0833'; ~ 110 lo IOBl.PA 3
OK I Cancel
I Help
Figure 3-44. S7-300 CPU Properties: Cyclic Interrupt dialog CPU 316 or earlier CPUs.
118
Working with Hord ware Configurations
i4i,i,t§lii¥1841Ml:&i;f•Ut f - . ~
General J Slattup I Cycle/Clock Mef11()1y I Aelenlive Memory I Memo«y lnteuUl)b I
Trn~·DO)' lr(er1141ts Cyclic lr'lletrupl J Dlag00$llct/Clocl( I Piot~ion l
OK I Cancel I__H_e_lP_ _.
Figure 3-45. S7-300 CPU Properties: Cyclic Interrup t d ialog of CPU 318.
■
ACTION
1 With !he Hordwore Configuration toot open lo the desired project ond station;
select the CPU module. right-click and selec t Object Properties, then selec t the
Cyclic Interrupts . Grayed parameters o re not ovoiloble in the opened CPU.
2 Select the cyclic O B whose parameters you wish to a lter. and enter a new Priority
class if you w ish to modify the default priority: click in the Held ond e nter o valid
a ltern ate (3-24). Assigning o p riority twice should be a void ed to prevent loss of
Interrupts due to multiple (> 12) interrupts of the some priority occurring
simultaneously.
3 Enter o new Execution va lue if you wish to modify the default processing interva l for
the OB; click in the field, and enter o va lid value in the range of 1O milliseconds to 6
seconds !i.e., 10-to-60,000).
4 If multiple cyclic interrupt OBs will be used, enter o Phase Offset value in
milliseconds. for each. The phase offset will ensure tha t proce>sing of th e OBs is
distributed somewha t evenly throughout the to ta l CPU c ycle. A valid range for this
field is (0 -to- 60000). The default value of O represents no pha se o ffset.
S Confirm the configuration para m eters with the OK b ut1on and use the toolbor Save
and Compile button lo generate the System Dato o bjecl.
119
STEP 7 in 7 Steps
Essential Elements
The Short DescrlpHon , the some as given in the hardware catalog, gives important tea lures of
the digital input module such os number of input circuits. supply voltage, ond number o f
circuits per group (i.e .. per common). For example o 120/230 VAC input module may hove
16-inputs with four groups of four circuits (grouping of 4). The Order Number reflec ts the
currenHy open module. which is assigned to a specific slot in the configuration - it should
match the port number of the physically installed module. The Name field shows the default
name o f lhe module. Although the name can be changed. ii is not recomme nded. The
Comment field allows more details abou t the module or its application to be documented.
Application Tips
The writing area on a module connec1or limits what descriptive informat ion that con be
written for eoch digital inpul. Use lhe commen t rleld lo provide de toiled information on the
use of the digital inputs of a module.
i4i·i,I41iibi•llliif4it41killthf;i1JJ.il...-:____~----
General IAdctes:es I
Or~r Na.:
I
6ES7 321 ·1 tHOO-M.6.0
Name:
Coir,nent
nte comment on ute ol the o,put module, for e>W1mple ""111 91oup of rnach11e cc proce$$ inl)lJ& ~
a1e handled by lhe mowle.
.:::J
OK I c.-ince1 I Help j
Figure 3-46. Digital Input Module Properties: General tab.
120
Working with Hord ware Configurations
i4t,J,I41itW•llld#4if41J#t•Cbf4,t#i_,______~-~
Geneial Adtlesses I
11"4)Uts==========================
S1a1t: 10 P,ocest image:
Eod: 1 loe1 P iJ
P" Systemieleclion
OK
I t.incel , _ _H_el_P_..,
■ I
'
ACTION
Wilh o slo tlon open in the hardware configuro lion. select o rock. to view its installed
modules; double click on a digital input module w hose p roperties you wish to view
or edit. No t oil properties may be edited (e.g ., Order Number, Shor/ Description).
2 On the General tab. the Short descrlptfon of the module provides o brief summery
of the module fe a tures (e.g., number o f inputs, supply voltage. circuit grouping). Th e
Order Number is lhe port number or lhe open module in lhe configura Hon and
should reflec t lhe digital input module installed in the same slot in th e p hysical rack.
3 Click in the Name fiel d lo enter a new name for the module; the default name is
based on the number of inputs and the supply voltage, pre fixed with DI for digital
inp ut.
4 Use lhe Comment field lo enler o descrip tion o f the module inputs or application.
5 Select the Address tab to view or modify the start byte a ddress for the mo dule (e.g..
CPU 318). Most S7-300 C PUs do no t allow the start byte address to be changed so
the System Selection check box will b e oclivaled and grayed. See Configuring S7-
300 Digital 1/0 Module Addresses.
6 Confirm the configurolion parameters with the OK b utton and use the loolbor Save
and Compile button lo generate the System Doto objecl.
12 1
STEP 7 in 7 Steps
Essential Elements
Activating the hardware Interrupt parameter enables a ll of the interrupt inputs for use. An
input delay con be specified ro r the en tire module, based on lhe lype of signals connected.
The input delay should closely match the delay characteristics of lhe input device in order lo
protect against false input signals. Finally. in groups of two, !he interrupts may be sel to trigger
on the rising edge or falling edge of the signal, or on both the rising and falling edge. If
neither parameter is oclivaled. then the associated c hannels will not trigger an interrupt.
Aclivo ling the diagnostic Interrupt enables the module lo generate a diagnostic interrupl.
The diagnostic func tion varies depending on the module, but on lhe inlerrup t input module
monitors the supply voltage or !he connecled sensors. The input channels ore divided into
groups of eighl inputs each (Le.. inpuls 0-7, and inpu ls B· 15). By ac tivating the group check
box, each group can be monitored for no sensor supply, If monitoring is activated and the
supply voltage Jails. the group d iognoslic even t is entered into th e d iagnostic data sloroge
area of the module. Th e d ata can be read from the module, In the STEP 7 p rogram, using the
system func tion to ''read system status list" i.e., SFC S 1 RDSYSST). or evaluated in OB 82.
Application Tips
Response to hardware interrupts in the user program is handled using o rganization b lock 40 in
most S7-300 CPUs. In the CPU 318, OB 40 and OB 41 are available. The interrupt OB is assigned
to the module on the Addresses lab. The interrupt OB must be programmed and
downloaded to the CPU. Wh en o hardware interrupt is triggered. the operating system
interrupts the main program block (OB l ) and calls the designated interrupt OB program.
i4i·i4ijUt+WOli@fltDfili4H1l·!hi4 4i;-----~----
1 IBJ
I
Gene,a1 Acld,es,e, 1,._,<Js J
Jrcjw- - - - - - - - - - - - - - - - - - - - - - - - - - - - ,
I OK I Cancel Help I
Figure 3-48. S7-300 Interrupt Input Module Properties: Ad dresses lob.
122
Working with Hordware Configurations
lnpti
Dioll(IOStics
I 1 I 2·3 I I s-7 I I !12-13l 1• -1sl
0- 4 ,5 8,9 10 - 11
ACTION
I
1 With the required station open in the hardware configuration. select the rock where
the module is inslolled; double click on lhe interrupt input module to open the
properties dialog. then selec l the Inputs lob.
2 Activate the Diagnostic Interrupt box to enoble the module to monitor for loss of the
supply voltage for the connected sensor inputs (No Sensor Supply).
3 Activate the Hardware Interrupt check box to enable use of the sixteen interrupt
input s. Wh en any one of the inputs ore triggered. the main program b lock {OB I) is
interrupted and lhe assigned inlerru p l OB (OB 40 • O B 41J is colled for processing.
The Interrupt OB is assigned to the module on the module Addresses tab.
4 Click in the Input Delay field and select lhe typical signal delay lime (in milliseconds)
of the connected input signals. This parameter affects all inputs.
5 If the diagnostics are enabled. then aclivaling the related No Sensor Supply check
box c auses the module to monitor for loss of the supply voltage in channel group 1
(inputs 0-7), or channel group 2 (inputs 8-15}. A suitable program in 0882. can be
used lo evaluate which error has occurred and on which inp ut the error occurred.
6 Activate Rising Edge check box. if the associated inputs, above the box, should
trigger on a 0-lo-l lronsilion; or Activo le Falling Edge check box. if the inputs should
trigger on a l-to-0 transition. Each check box affects two inputs (e.g., input 0, I ).
7 Confirm the configuration parameters with the OK b utton and use the toolbor Save
and Compile button lo generate the Sys/em Data object.
123
STEP 7 in 7 Steps
Essential Elements
The Short DescrlpHon gives imporfanl features of the d ig ita l output module such os number of
ou tput circuits. supply voltage, and number o f circuits per group (i.e .. per common). For
example o 24 VOCI.SA outpul module may hove 8-outputs wi th one group of eight circuits
(grouping of 8). The Order Number renecls the module assigned loo specific slot in the
configuralion - ii should ma lc h the port number o f fhe p hysically installed module, The
Nome fi eld shows the default name of the module. Although lhe name con be c hanged, ii is
no t recommended. The Comment field allows details about the module or its application to
be documented.
A digita l output module may include on Ou tput lob if the module has diagnostic Interrupt
features that monitors and reports certain d iagnosfic events tho! hove been enabled on the
module. Diagnostic functions may 1nclude monitoring for wire break, no load voltage. short
circuit to ground, and short circuit to supply. This digital output also hos the ability to set o
substitute value lhot determ ines the stole that each output should be set to when the CPU
goes to STOP.
i4t,J,I4HI¥1~lltifflJii4'1WOi;J1tti;f _ ___·---~-~
.::I
Order No.: 6ES7 322·88F80-MBO
N- : jD08><0C24V/0.5A
Commer-.:
rte oamrnenl on the ute of tho output moo.de; lor exilffC)lo. whbl 9 10~ or 11100e$s oull)IAs
a,e handled by Ille mock.lie.
.:.I
OK
I Ca~ , __H_el_P_ _,
124
Working with Hordware Configurations
i4i,i,t§lii¥itJ•i;C\Ui4®•Ffi0i;(,tti>--- - - -~~~-
Ge~a1 [ Addu,_ Outl)uti I
- Enable- -
'
r,; 01agno1be iltetrupt
1
'"
iI
- Reaouon to CPU STOP
Substtute a value .:I I
OutplA
0~0$IIC$
I I I2 I I I I I I
0 1 3 4 5 6 7
SiJMtihAe Value 0 l
' 2 3 4 5 6 7
Subsliute "1 '~ r,; 11 !1:ll r t[EJ[EJ[EJ[EJ[EJ
OK I Cancel I Help
Figure 3-5 1. S7-300 Digitol Outpu t Properties dialog: Output parameter se ttings.
ACTION
I Wilh a sta tion open in the hardware configuration, select a rock lo view ils installed
modules; double click on o digital output module whose properties you wish to view
or edi t. Not all properties may be edited (e.g.. Order Number, Short Description).
2 On the General tab. the Short description provides o brief summary of the module
features (e.g .. number o f outputs. supply voltage, circuit grouping). The O rder
Number is the port number of the open module in the configura tion and should
reflect the digital output module installed in the some slot of the physical rock.
3 The default Name, which is modifiable. is based on the number of outputs. the
supply voltage, and the output current. all p re fixed with DO for digital output.
4 Use lhe Comment field lo en ter a description or !he module outputs or application.
5 Select the Output tab to se t operating parameters for the outputs of the module.
In lhe Reaction to CPU STOP lield. select Keep Lost Valid Slate (logic-0 or logic -I); or
select Substitute a Value. If you select "substitute o value," then for eoch output you
wish to be sel to logic 1. ac tivate the corresponding check box ror Substitute" l ".
Boxes not activated will be set to logic 0.
7 Activate the Diagnostic Interrupt box 10 enable the module's obifity lo generate a
diagnostic inte1TUpl when any one of its diagnostic monrtori ng events occurs.
a To activate diagnostic monitoring (e.g.. Wire Break. No Load Voltoge, Short Circuit to
Ground (M l, Short Circuit to Suoply (L +Lor Blown Fuse) for on ou tput. activate the
corresponding check box beneolh each ou tp ut circuit you wlSh to monitor.
125
STEP 7 in 7 Steps
Essential Elements
The figure below shows o n S7- 300 with maximum expansion. Each slot, as shown in the figure.
reserves four-bytes slorting wilh byte-0 in slol 0. Slo t-4 reserves by tes 0-3: slol-5 reserves bytes
4-7; and so on. If on input module is installed in o slo t. the reserved bytes o re in the process
image of inputs (PII); if on output module is installed. the reserved bytes ore in the process
image o f outputs (PIQ). In the S7-300 the default slorting byte-address assigned to each
module (See fhe configura tion table in Figure 3-53) is generally fixed and cannot be
changed. CPUs that support free assignment or addresses (e.g.. CPU 315 v 1. 1 and higher),
also allow input and output modules to use the some starting byte addresses.
Application Tips
Digital inputs a re accessed from the PII using the input memory identifier ' I' as a prefix to the
address; d igita l outputs o re accessed in the PIQ, using lhe output memory identifier 'Q ' as a
prefix to th e address. Both inpuls and oulputs ore refere nced as "byte.bit." A 32-point output
module in slol-4 would use addresses Q 0.0 through Q 3.7. where QO.O corresponds to the first
outp ul circuit: on input module would use I 0 .0 through I 3.7, where I 0.0 corresponds to the
first input circuit. Inputs and oulputs may also be accessed as bytes, words, or double words.
IM36I lo to to to to lo to to
99.7 103.7 107.7 11 1.7 115.7 119.7 123.7 127.7
1/ Q 1/ Q 1/ Q 1/ Q 1/ Q 1/ Q 1/ Q 1/ Q
IM 361
lo to lo to to to lo lo
67.7 71.7 7S.7 79.7 83.7 87.7 91.7 95.7
1/ Q 1/ Q 1/ Q 1/ Q 1/ Q 1/ Q 1/ Q 1/ Q
IM361
lo to to to lo fo lo lo
35.7 39.7 43.7 47.7 51.7 55.7 59.7 63.7
1/ Q 1/ Q 1/ Q 1/Q 1/ Q 1/Q 1/ Q 1/ Q
IM360
10 lo to to to to to to
3.7 7.7 11.7 15.7 19.7 23.0 27.7 31.7
Figure 3-52. Default Digital Addressing of the S7-300. starting a l byte-0. Each slot a lways
reserves 4-byles, allowing for up to 32-inpuls or outpu ts per module.
126
Working with Hordware Configurations
ACTION
1 From lhe SIMATIC Manager, open the required projecl and select lhe S?-300 Station
for which addressing is required.
2 With lhe station selecled, in lhe righl pone of the slotion window double click on the
Hardware object to open the station in the Hardware configuration tool.
3 Select o rock whose modules you w ish lo view the installed digitol 1/0 modules or
inserl new digilal t/0 modules.
View the starting byte address of each input module in the I-Address column or
each autpul module In the Q-Address column.
5 To modify the slarling byle address of a module. select lhe module. right-click and
select Object Properties, then select the Address lob.
6 If lhe module addresses of this CPU con be modified. the System Selection
checkbox w ill hove a default check mark which con be removed; o therwise, the
box will be activated and grayed cul or nol available a t all. To modify o start byte
address, first de-activate the System Selection check box lo disable system address
delerminotion.
7 Enler o new storl byle-oddress and confirm by pressing OK. In the S7-300. digilol t/0
start byte addresses, after byte-0. must be o multiple of 4 (e.g., 4, 8, t 2, 16, 24, etc.).
tn CPUs where you may assign addresses freely {e.g .. CPU 315 VI.I and higher),
inpul and outpul modules may use th e some starting by1e address.
8 The Process lmoge field shows lhe process image responsible for updating lhe
module ou tputs. By default digital outpuls are cyclically updated by the CPU.
9 Confirm the configuration parameters wilh the OK butlon and use the toolbar Sove
ond Compile button to generate the System Dato object.
~~ (OJ UR
IM 360 6ES7
4 Dn 6llDC24V 6ES7 0... 1 16- re,•M!d h Pl\.
5 D116,cl)C24V 6ES7 , ...5 16, lettlved;, Pl\.
6 Dl32icOC2'4V 6ES7 8. 11 32. ,...,,ve.i;, Pl
7 D132l<DC24V 6ES7 12. .15 32· lt!:tffied h Pl\.
8 D016xDC2.tV/O SA Qc57 16...17 16· 01 1e,eNed in PIQ.
9 DOl6xDC24V/0.5A Et:S7 20... 21 16 Sutfd. es ,e..,ved in PIO.
10 D032l<OC24VI0.5A Ef.S7 24,•. 27 32· • USO<!. es 1e1e1ved in PIO,
11 D032l<DC24V/O SA 6ES7 29.. 31 32·1Xlirt Oulllllt ~rd: 4-bl4e, used. 4-l:!.(es retel\led it1 PIQ,
Figure 3-53. Default digital addresses in S7-300 configuration. Note that although 4-byles (32-
bilsl ore always reserved, the oclual byte usage of lhe module is displayed in the I-address
and Q-oddress columns.
127
STEP 7 in 7 Steps
Essential Elements
The Short DescripHon . lhe some as given in the hardware catalog. gives important feolures of
the analog input module such as acceptable input signals. bit resolution. and number of
input channels. For example on eight channel analog input module may hove 14-bit
resolution and accept 0-20 mA/4-20 mA current signals and several voltage ra nges. The
Order Number renects the currently open module, inserted in a specific slot in the
configuration - it should matc h the port number of the ocl\Jol installed module. The Name
field shows the default name of the module. Although lhe name con be changed, it is not
recommended. The Comment field allows details or the module's applicolion to be entered.
Application Tips
The writing area on lhe module connector limits whal descriptive information con be written
for each input channel. Use the comment field to provide detailed information on the use of
lhe analog inputs of o module.
IYIIJJ19iit44Ji:ftitJ,U iQAii_.________ _
Genetal IAdlte$ses I 1nr;us I
Comment
.:::.1
OK
I Cancel , _ _H_el_P_...,
128
Working with Hordware Configurations
OK
I C.,ncel j __H_e_lP_~
Figure 3-55. S7-300 Analog Input Module Properties: Addresses lob.
1 Wilh o station open in the hardware configura tion, select o rock lo view its installed
modules: double click on on analog input module whose properties you wish lo
view or edil. Nol oll properties may be edited (e.g .. Order Number. Short
Descriplion I.
2 On the Generol tab. the Short description provides o brief summary of the module
features (e.g.. module type. number of inputs. b it resolution). lhe Order Number is
the port number of the open module in the configurotion ond should reflect the
analog input module installed in lhe corresponding slot of the actual rock.
3 To oller the module name. click in lhe Nome field to enter o new name; ltie default
name is the number of analog input channels and the bit resolution prefixed with Al
for analog input.
4 Use the Comment field lo en ter a descrip lion of the module inputs or applica tion.
5 Select lhe Addresses tab lo view or modify the slor1 b yte address for the module.
Mosl S7-300 CPUs do not allow the start byte address to be changed so lhe System
Selection check box will be activated and grayed out. See Configuring S7-300
Analog 1/0 Module Addresses.
6 Confirm the configuration parameters with the OK button ond use the toolbor Save
and Compile button to generate the System Doto object.
129
STEP 7 in 7 Steps
Depending on the module, d iagnostic events moy be activated for ind ividual channels or
channel groups and include wire break, configuration parameter assignment error. or
common mode error. When a diagnostic interrupt occurs, o n a c ha nnel or w ithin a channel
group, the module reports the event to the CPU (diagnostic buffer e ntry). Module-related
d iagnostic information as well os channel-specific d iagnostic events con be read from the
module using system functions (SFCs),
1Altlli91it¥PJl•t5f1H0fIiJtfil♦---------- 29
Gene,a1 J Addresse; lnp~s J
Enable- -
p- Dia~ lrtenupl P' Ha1ilware lntern.ipt \J.lhen l i~ E><eeeded
130
Working with Hordware Configurations
ACTION
1 With the required station open in the hardware configuration. select the rack w here
the module is installed; d ouble click on the analog input module to open tne
properties dialog; the n selec t the Inputs tab to view or edit input signal parameters.
2 Activate the check box Diagnostic Interrupt in order to use the module' s ability to
generate an interrupt o n certain module -specific d iagnostic events.
3 Activate the check box Hardware Interrupt when Limit Exceeded, to allow inputs to
generate on interrupt when the Input signal exceeds (goes obove or falls below) the
defined limits.
4 Activate the check box Hardware Interrupt at End of Scan Cycle ~f feature
availa ble) to allow the module to signal the CPU w ith a hardware interrupt when o il
of the input channels on the module have acquired new measured values.
5 If th e ''Diagnostic tnterrupl" is enabled then for each channel or channel group, you
may activa te the check box for Group Diagnostics a nd fo r other channel
diagnostics you wish to enable (e.g., Wire Break). If a d iagnostic event occurs, a
diognoslic interrupt is triggered and module-dependent d iagnostic Information is
stored in the module's data area.
6 Clic k in the Measurement Type field d irectly below each channel or channel group,
and from lhe list of available measurement lypes (e.g .. voltage (E). current. T/C.
RTD) selec t one for the a ssociated channel (s). If o channel or channel group is not
connected, select "Deac tivated."
7 Clic k in the Measurement Range field directly below each channel or channel
group, and from the list of available measurement ranges (e.g . ±IOV. ±5V, a nd ±1 V)
select a range for the associated c hannel (s),
8 If th e hardware interrupt is enabled for input signal limits exceeded. then for each
channel tha t supports this feature (only certain channels can monitor the input
value limits), click in the corresponding fields, and enter the Upper limit va lue and
Lower Limit value. The module will trigger an interrup t when the input value exceeds
the set "Upper limit." or wtien the input signal falls below the set 'lower Limit."
9 Confirm the configurol'ion parameters wilh the OK b uHon and use the toolbar Save
and Complle button lo generate the System Dato object.
131
STEP 7 in 7 Steps
You w ill be able lo configure. the Outputs parameters tab. for viewing or setting the signal
lype and range used by each output channel. Th e choices for the Type of Output ore
voltage a nd current:
I OK I Cencd , __H
_el_P_~
Figure 3-57. S7-300 Ana log Output Module Properties: Outpu l parameters lob.
132
Working with Hordware Configurations
ACTION
1 With the required station open in the hordwore configuration toot. select the cen tral
or expansion rack. or DP slave to display its instolled 1/0 modules; select the analog
output module and double c lick to open the p roperties dialog.
2 On the Generol tab. the Short description provides a brief summary of the module
features (e.g.. number of outputs. digl1ol resolution). The Order Number is the port
number of the open module in the configuration and should reflect the onotog
output module installed in the corresponding slot of the physical rock.
3 The default Name, Which is modiflabte. is based on the number of analog outpul
channels and the bit resolution prefixed w ith AO for a nalog output.
4 Use lhe Comment field lo enter o description of the module outputs or application.
5 Select the Addresses tab to view or modify the stor1 byte address for the module.
Since most S7-300 CPUs do no t ollow the sta rt byte addresses to be c hanged. the
System Selection check box will be ac tivated and g rayed ou t. Otherwise. you may
de-activate the check box. See Configuring S7-300 Analog 1/0 Module Addresses.
6 Select the Outpuls lob to view or modify the operating parameters for the module
and for each analog output channel.
7 Activate the check box Diagnostic Interrupt In order to use the module's ability lo
generate on interrupt on module-specific diagnostic events.
8 If th e "Diagnostic Interrupt" is enabled lhen you may activate lhe check box for
Group Diagnostics for each channel you w ish to hove monitored (e.g .. Wire break
for current ou tp uts. and Short c ircuit for volfoge outpu~). If a diagnostic event
occurs. o diagnostic interrup t is triggered and module-dependent diagnostic
information is stored in the module 's data oreo.
9 Click in the Measurement Type field d irectly below each channel. and from the list
of available measurement types [e .g ., voltage (E). curren t II)] selec t one for the
associated output c hannel. If a channel Is not connected. select "Dea c tivated."
10 Click in the Me-asurement Range field directly below each channel. and from the list
of available measurement ranges (e.g. ±1 OV, 1-SV, and 0- 1OV) select o range for the
associated ou tp ut channel.
11 In the Reaction to CPU STOP field . select Keep Lost Valve IKLVJ; or selec t Zero
Current/Voltage IOCVl . If you selec t "OCV." then for each current or voltage output
channel will output a value of zero .
12 Confirm the configurolion parameters with the OK b utton and use the toolbar Save
and Comptte button to generate the System Dalo object.
133
STEP 7 in 7 Steps
Essential Elements
The ngure below shows an S7- 300 with maximum expansion. Each slo l reserves sixteen byles
of analog peripheral memory, starting with byte-256 in slot 0. Slol-4 reserves bytes 256 -to-
271; slo l-5 reserves bytes 272 -to- 287; and so on. If an input module is inserted, each input
address is prefixed wilh PIW for peripheral input word: if on output module Is inserled, each
output channel address is prefixed with PQW for peripheral output word. The first analog input
is PIW 256 (byles 256-257); !he second input is PIW 258. The firs! analog ou lput Is PQW 256
(bytes 256-257); the second analog ou1put is PQW 258. Default starling byte-addresses
assigned in the S7-300 cannot be changed, except with the CPU 315 version 1.1 and higher.
Application Tips
Unlike digitol 1/0, that is updo led cyclically and placed in the image lables (PII/PIQ), analog
1/0 must be handled in the program. This is true since wilh peripheral memory, modules ore
directty accessed over the 1/0 bus. In LAD/FBD an analog input is read by specifying !he
input address as lhe source in a move instruction; on analog output is wrilten by specifying
!he oulpul address as the destinolion of the move operolian. In STL. a load operation reads
on analog input by specifying lhe input address (e.g., l PW 258). A value is sent to on analog
ou lput wilh o transfer operation thol specifies the output (e.g.. T PW 260).
PtW/ PQW PIW/ PQW PIW/PQW PIW/ PQW PIW/PQW PIW/PQW PtW/ PQW PIW/ PQW
IM 361 lo to 10 to to 10 to lo
655 671 687 703 719 735 751 767
IM361
10 to to to to lo lo lo
527 543 559 575 591 607 623 639
IM361
lo to to to to to lo lo
399 415 431 447 463 479 495 51 1
IM360
lo lo lo lo lo lo to lo
271 287 303 319 335 351 367 383
Figure 3-58. Default S7-300 a nalog addressing. starting at byte-256 of peripheral memory.
134
Working with Hordware Configurations
ACTION
1 From lhe SIMATIC Monoger, open the required projecl and select lhe S?-300 Station
for which addressing is required.
2 With lhe station selecled, in lhe righl pone of the slation window double click on the
Hardware object to open the station in the Hardware configuration tool.
3 Select o rock whose modules you w ish lo view the installed analog 1/0 modules or
insert new analog 1/0 modules.
View the starting byte address of each input mo dule in the I-Address column or
each autpul module In the Q-Address column.
5 To modify !he slarling byle address of a module. select lhe module. right-click and
select Object Properties, then select the Address lab.
6 If lhe module addresses of fhis CPU con be modified. the System Selection
checkbox w ill have a default check mark which con be removed; o fherwise, the
box will be grayed oul or not ovailoble ot all. To modify o start byte address. rirsl de-
activafe the System Selection check box to disable system address determination.
7 Enter a new start byfe-address and confirm by pressing OK. In the S7-300. analog
starl byle addresses alter byte-256 musl be a mulliple of 16. In CPUs thal support
free assignment of addresses (e.g., CPU 315 a nd higher}, input and output modules
may use the same starling byle addresses (e.g.. PIW 256. PQW 256).
a The Process Image field has no meaning with analog modules and ls grayed.
9 Confirm the configuration parameters with the OK butlon and use the toolbar Save
and Compile button to generate the System Doto object.
2000
4 Al2i<128l 256.. 259
5 Al~.OI• to 20IM. Ex 6ES7 272 . 279
6 Al8•129l 6ES7 298 . 303
7 A02x12Bi 6ES7 304...307
8 A02"128t 6ES7 320...323
9 A04•129i 6ES7 336...3"3
Figure 3-59. Default analog addresses in S7-300 selpoint configuration. Note, Iha! allhough
16-bytes ore olwoys reserved. the aclual byte usage of the module is displayed under the I-
a ddress and Q-address columns.
135
STEP 7 in 7 Steps
Essential Elements
If o CPU hos not been selec ted, you will need to select one tho! meets the known
requirements of the opplicolion. Op tions for the main rock type will include lhe choice of a
central rack (CR) or a universal rack !UR). both of which support signal /SM), communicatio ns
(CP). and function modules (FM). Rock opti ons will include number of slots, and depending
on the particular part, support for redundant power supply. The power supply choice is
based upon the power requirements of lhe combination of modules installed in the rack.
Application Tips
If you need to connecl to the CPU lo tesl portions of your code. the minimum configurollon
you will need to get started is shown in the figure below. In the initial setup of this station you
will also need to install op tional backup batteries. required memory cards and provide o
power source to the installed power supply. It is lmpor1ant to remember that your hardware
configuration must match your actual ha rdware arrangement.
5
s
7
8
9
10
,_1..;..1_ _ _ _ _ .:J
101 URl
,
Slot fl Modi.le
1J PS 407 lat-
... Drdet numbet
61:S7 407-~-0,t,AO
MPI addren I addrett Q addtes:s Comment
...
-
3
4
1!11 CPU 41 6-1 6ES7 416·1XJOO-OAB O 2 -
5
6
7 .:J
Figure 3· 60. S7•400 Cen tra l Rack Conngura lion. with CPU and Power Supply.
136
Working with Hord ware Configurations
ACTION
1 From lhe SIMATIC Manager, open 1he req uired project and rrom lhe projec t tree
select the S?-400 Station for which a central rack configuration is lo be crea ted.
2 From the right pane, double click on 1he Hardware object to open th e stolion in
the Hardware configuration tool.
3 Open !he Hardware Catalog wind ow, from the View menu, if it is not alrea d y
opened.
Open the SIMATIC 400 c a talog object lo view the S7-400 c omponent folders.
6 Select and drag the appropriate cenlral rack (CR) or universal roc k (URJ from the
folder to the lop pane of the station window. The rack will b e labeled O(CR) or
O(UR) .
7 Open the PS-400 folder, select the desired power supply and drag the part lo stot-
1 o f the central rack.
8 Open the CPU-400 folder and then lhe appropriale CPU sublolder lo select the
required CPU. Drag the selected CPU lo slol-3 o f the central rock.
9 From lhe menu. selecl Station , Consistency Check. lo check for errors.
10 From lhe menu bar. selecl Station ► Save to save lhe configuration; or if done.
use Save and Compile lo g enera te the System Da ta that are download ed to the
C PU.
137
STEP 7 in 7 Steps
Dividing th e tasks of very large machines or processes into smaller independent control tasks
con result in bellerresponse limes. increased reliability. and uncomplicated programs.
Smaller programs ore also easier to manage and to troubleshoot. An example case might be
to separate all control from dota p rocessing and communications functions. All process
con trol loops. for example. may be assigned to a CPU.
Essential Elements
The multi-computing configuration requires the use of CPUs and racks tha t support this
capabilily. This arrangement is imp lied when two or more mulli-computing CPUs ore p lace d
in a rack svpporting this operation. A maximum or four CPUs may be installed in the central
rack (e.g.. URI J. Your specific choice or cen tra l rack will depend on the number of slots
require d a nd whether or not redund ant power supplies ore used.
Application Tips
All modules associated with this station. Including expansion 1/0. must b e assigned to a
specific CPU in the multi-computing configuration. A module is assigned loo CPU (e.g..
CPU I. CPU2. CPU3. or CPU41 under the module's objecl p roperties.
Figure 3-6 1. Project folder containing multi-computing station with four CPUs.
138
Working with Hordware Configurations
ACTION
1 From lhe SIMATIC Manager, open to the required projecl and from the projecl lree
select the S7-400 Slolion to which mulli-computing will be added. or first odd a new
S7-400 station if if does not already exist.
2 With the station selected, from the right pane of the project window double click on
the Hardware objec t to open the station in the Hardware configuration tool.
3 Open the Hardware Catalog window, from the View menu, if it is not already
opened.
4 Open lhe SIMATIC 400 catalog object lo view the S7-400 component folders.
6 Select the opprop rio le universal rock (UR) from the folder. lhot supports mulli-
compuling and lits !he Joto! slots and power supply requiremenls then drag it to the
top pone of the sta tion. The rock will be labeled O(UR).
7 Open the PS-400 folder. select your power supp ly and drag the parl to slo t-I o f the
central rock.
8 Open the CPU-400 folder and then the appropriate CPU subfolder lo select your
multi-computing CPU. Drag the selecled CPU lo slol-3 of the central rock. Add up lo
four CPU modules as req uired.
10 From lhe menu, select Statton ► Consistenc y C heck lo check for errors.
11 From lhe menu bar. selecl Station ► Save to save lhe configuration; or if done. use
Save and Compile to generate lhe System Doto that ore downloaded lo lhe CPU.
139
STEP 7 in 7 Steps
Essential Elements
The DP master con be configured using on S7-400 CPU, with on integra ted Profibus-DP
interface (e.g .• CPU 4 14-2 OP, CPU 4 16-2 DP); or using a Profibus communications processor
with DP master capability (e.g .• CP443-5 Ext.). in conjunction w ith a CPU that supporls this
feature. In any case, the OP master will con trol one or more assigned OP slaves.
Application Tips
Typically, a DP subnet will involve a single DP master. This is referred to as a Mono-Master
configuration. You may also have several mono-master sys tems within a project, by simply
crea ting multiple PROFIBUS DP subnets and attaching a DP master to each. A Multl-Master
configuration. Involving two or more masters on o single subnet. though not typical, is a lso
possible. You would do this by a ttaching the OP masters to the same DP subnet.
3 CPU 414-2 OP
)13 OPAwtor
~
6
7
8
s
• ~
Figure 3-62. S7-400 CPU 414-2 DP selec ted and inserted as DP master. The block and white
dashed line is lhe Profibus DP Master system object lo which DP slaves will be allached.
3 CPU 41 2•1
X'1 A.A'DP
4 CP4, )5£id
s
6
7
,
8
• ~
Figure 3-63. S7-400 CP 443-5 Ext. selec ted and inserted as DP master. The b lock and white
dashed line is the Profibus DP Master system object lo which DP slaves will be attached.
140
Working with Hordware Configurations
ACTION
I From the SIMATIC Manager open the required project. and S7-400 slolion to serve
os DP Moster. The S7-400 must be inserted to lhe project if it not a lready ins talled.
2 With the S7-400 station opened in the hardware configuration window select the
central rack. Insert the required rack a nd power supply if ii is no t already insta lled .
3 If a CPU will serve as the DP master then the correct Profibus-DP CPU must be
selected (e.g., CPU 412-2 DP or CPU 416-2 DP). From lhe catalog open the CPU-400
folder. selec t and d rag the required CPU lo slol-2 or the cen tral rack.
4 When the Profibus interface dialog Is presented. select the Profibus subnet to which
the DP master should be a l Iached: set or accepl the suggested Profib us address
(e.g.• 3-1 25), then click on the Properties button lo set lhe subne t Transmission Rate
and other properties if they hove not yet been set.
5 After the DP properties dialog is saved, a DP Moster system object sho uld appear
extended from the DP master os o b lack and while dashed line. If the object is not
shown. right-click on the DP object in row 2X2. and select Add Master System.
6 You can save your work, but at least one DP slave must be attached lo compile
without errors. See th e earlier tasks on Configuring and Attaching Modular,
Compact, and In telligent DP Slaves.
If a communications processor (CP) should serve as the DP master. then the appropria te
selection must be made from l he CP-400 folder under the Profibus folder. Find the required
CP443-5 Extended communications processor a nd drag it lo slot-3 or higher of the cen tra l
roc k. The Profibus in1erface dialog w ill be presen ted and ~he configuration may be
continued w ith Steps 4, 5, and 6.
141
STEP 7 in 7 Steps
Essential Elements
The IM460-0 and IM 460- 1ore both publisher interface modules p laced in the central rock lo
for local expansion. Whichever o r lhese publisher interlace modules is used, its matching
receiver module is ploced in each expansion rock. The IM 461 -0 is the receiver ror the IM 460-
0; lhe IM 461 -1 is the receiver for the IM 460-1. These modules ore selected according to
d ista nce requireme nts and whether or not the expa nsion rocks will suppor1 communications.
Application Tips
Each IM 460-0 module hos two channels, each of which suppor1s up to 4-rocks. The IM 460-1
module hos two channels. each o r which ore limited to connectio n o r only one expansio n
rock; only two IM 46~ I interface modules moy be placed in the central rock. Altogether. o
maximum of six interface mod ules of any combination may be p laced in the central rock.
Cf'U 416-1 3 3 3 3
IM 460-0 4 4 4 4
5 s 5 5
6 6 6 6
7 7 7 7
9
8
9 IM 461-0
8
9 IM 461-0
8
9 I~ IM461 -0
8
9 lM•61 -0
3 3 3 3
4 ◄ 4
'5 5 5 s
6 6 s 6
7 7 7 7
8 8 8 8
9 IM 461-0 9 lM 461-0 9 IIA 461•0 9 IM 461-0
•
Figure 3-65. S7-400 Locol 1/0 Expansion. using the IM 460-0/IM 46 1-0 pair.
s
142
Working with Hordware Configurations
6
7
8
Connei:: C1: I 1 2 3 4 Di~onnect I
Connect C2 I
I OK I Help
Figure 3-66. 57-400 Local 1/0 Expansion, using lhe IM 460-0/IM 46 1-0 pair.
ACTION
1 From the SIMATIC Manager open the required project. and from lhe project tree
select the S7-400 Station for which locol 1/0 expansion must be configured.
2 With lhe slalion selected, from lhe right pane or the projec t window double click on
the Hardware object to open the station In the Hardware configuralton tool.
3 Open the SIMATIC 400 catolog object lo view lhe S7-400 component fo lders.
4 Open the Roc k-400 folder. selec t and drag the appropriate expansion rocks [ER) or
universal rocks (UR) to the top pone o f the station window. If the cen tral rock is
a lready installed it is labeled O(UR) or O[CR); otherwise if must be configured first.
5 Open the PS-400 folder. select the desired power supply. Click and drag the port lo
stot- 1 o f each expansion rock as required.
6 Open the IM-400 folder by clicking the plus sign. The S7-400 expansion interface
modules a re shown. Publisher IMs ore installed only in the CPU rock (stol-3 and
higher). Receiver IMs are Installed in 1/0 expansion racks (slot 9- only, or slol- 18 only).
7 Select on IM-460-0 interface module from the cata log and drag to slot-3 or slot-4 of
the CPU rock O(UR). Select on IM-461-0 interface from lhe catalog and drag to sro t-9
or slo l-18 of each installed expansion rock.
8 Select the IM-460-0 in the central rock and right click and select Object Properties to
connect the expansion rocks to the desired channel. From the Connec tion tab.
assign each Non-Connected roc k lo either channel 1 or c hannel 2, by pressing the
corresponding Connec t button. Use OK button to save.
9 From the menu, sefect Station ► Co nsistenc y Check to check fo r errors, a nd then
use Save and Compile lo save the configuration before downloading lo the CPU.
143
STEP 7 in 7 Steps
Essential Elements
The 460-3 is o publisher interface module, placed in the central rock. Its matching receiver
module. the IM 461 -3. is placed in each expansion rock. Each IM 460-3 hos two channels.
each o r which supports up lo 4-racks. Each installed rock must be connected lo either
channel 1 or c hannel 2. The IM 460-3 may be installed in the central rock with up lo o total of
six other interface modules to form any combination o r loca l and remote t/0 expansion.
Application Tips
S7-400 remote 1/0 expansion up lo 600 meters moy be configured using existing or newly
installed S5 1/0 rocks that ore connected using the IM 463-2.
'6
3
I
L
6
7
s
6
7 I
I s
6
7
5
7
L
6
7
8
,
8 I
HI IM461·3 ,8 IM 461·3
8
s n,t 461 ·3
8
.., .cE1·3
' ,i <!61Cl'Z
3
3 J 3
•5 •
5
I
5
6 6 6
7 7 7
8 8 8
•
9 114 461-3 IN 461-3 9
- ~ 461-3 9 .., 461-3
~
Figure 3-67. S7-400 Remote 1/0 Expansion. using tM 460--3/IM 46 1-3 pair.
iRl·i·tilitAll§lld•lii;UJf»- - ---~----
I
G.,..,,a1 Comec1ipn Adaeoce, Tr!ntfc, I I
Non-Connected
Fl acts-.
4
5
6
Comecl C1: 1 2 Olscomeot I
7
8
Con(lecl
I OK I Caicel Help
144
Working with Hordware Configurations
1 From lhe SIMA TIC Manager open lhe required project. and rrom the projec t lree
select the S7-400 Station for which remote 1/0 expansion mus! be configured.
2 Wilh the station selec ted, from the right pane of the projec t window double click on
the Hardware object lo open the station in the Hordwore configuration tool.
3 Open the SIMATIC 400 c a talog object to view the S7-400 component folders.
4 Open the Rack-400 folder, selec t and drag the oppropriote expansion rocks (ER) or
universal rocks (UR) to the lop p one of th e sta tion w indow. If the centra l rock is
already installed it is labeled O(UR) or O(CRJ; o therwise it must be configured lirsl.
5 Open the PS -400 folder. select the desired power supply. Click and drag lhe parl lo
stol- 1 of each expansion rock as required.
6 Open the IM-400 folder by clic king lhe p lus sign. The S7-400 expansion interface
modules ore shown. Publisher IMs ore installed only in the CPU rock (slot-3 and
higher) . Receiver IMs are ins lolled in 1/0 expansion rocks (slot 9- only, or slot- 18 only).
7 Select on tM-460-3 interface module from the catalog a nd dra g to slol-3 or slol-4 of
the CPU rock O(UR); selec t on IM-461 -3 interface module from th e ca talog and drag
ii lo slol-9 or slol-18 of each or your installed expansion racks.
8 Select the IM-460-3 in the central rock and right click and select Object Properties to
connect the expansion roc ks to the desired channel. From the Connec tion 1ob.
assign each Non-Connected rack lo either channel 1 or channel 2, by p ressing lhe
corresponding Connect button. Use the OK button to save.
9 From lhe menu, selec t Station :.- Consistency Check lo check For errors, and then
use Save and Compile to save the configuration before downloading to the CPU.
145
STEP 7 in 7 Steps
Essential Elements
The Short DescripHon . the some os given in lhe hardware cotolog. gives important CPU
features such as work memory size. cycle time/1000 instructions. digital 1/0 capacity,
supported connec tions. DP/MPt ports. multi-computing ond routing copobitlty. The Order
Number reflec ls the module assigned In the configuration tool ond con be compared lo the
installed module. The Name fie ld shows the delaul1 name of the module. which you can
modify as required. C hanges to the CPU name are reflected in th e SIMATIC Manager.
The Interface parameter group. generally on modules with communications interfaces. shows
basic information such as node address and if the node is oltoched to a subne t. The
Properties bu tton provides quick access lo view interface parame ters, but the interface
p arameters (e.g .. MPI. Profibus, and Ethernet) ore set in the hardware configuration tool. The
Comment field allows information about the module (e.g.. op plication) to be documented.
Application Tips
The user-defined Plant Designation identifier. available with some CPUs, is o user-defined
identifier that con be evaluated in start-up 08s the user program, Examples of evaluating the
"plant designation" o re provided in the STEP 7 Sample programs.
•
i?l·l·i91i14idA 111ilf ti,!·Ui)-=:.
Comment.
...
I OK I c-1 I Help I
Figure 3-69. CPU Properties: General parame ters d ialog.
146
Working with Hordware Configurations
ACTION
1 With o sta tion open in the Hardware Configura tion tool select the CPU. right-click
and select Object Properties. ttien selecl the General lob.
2 The Short description of the module provides o b rie f summary o f th e unique features
of the installed CPU module: it cannot be modified.
3 The Order Number of the module is the specific number used to identify the exoct
CPU tha t should be installed in the physical roc k. The order number determines the
unique fea tures of the CPU, which ore summarized under the Short Description.
4 Click in the Nome field to modlfy the default name assigned to the module. The
default name is based on the short name of the p articular CPU type [e.g.. CPU 416-
1( i )] and o concatenated numeric value in parentheses. that represents the
number of the inslolled C PU. A number is assigned to the CPU since the S7-400
supports up to four CPUs in o rock.
5 The Interface static grouping. shows the module's set MPI address (default = 2), a nd
whether or not the module is atta ched to the network; the Properties button allows
the module' s Interface parameters to be accessed for viewing or editing.
147
STEP 7 in 7 Steps
Essential Elements
The parameter Startup If Setpolnt and Actual Configuration Differ, determines if the CPU
should be allowed to start-up if the selpoint and actual configurations differ. The defa ult
beha vior is to start even if the setpoint and actual configurations differ. The parameter Rese t
Outputs al Hot Restart allows the CPU to reset the outputs. and the process image of the
outputs (PtQ) a t each ho t restart. This parameter is essential since ou tputs are not normally
reset on o Hal Restart The parameter Disable Hot Restart by Operator prevents o ho t restart
from the PG/PC or otherwise. The parame ter Startup After Power-On determines whether a
start-up after o power-up will initiate o "Worm Restart.'' a Hot Restart." or a "Cold Restart."
The Monitoring nme parameter. Finished Message, specifies the maximum C PU wait-time. a t
power-up. lo receive ready-signals fo r a ll configured modules. The parameter Transfer of
Parameters to Modules specifies lhe maximum lime tor modules, including DP-In terface
modules, lo acknowledge receip t of their configuration parameters (the wait-time sta rts ofter
receipt of the "Finished Message") . If either of these two parameters ore not acknowledged
before the set time expires. the preset and actual configurations will be considered differen1.
The CPU reaction is then determined by the parame ter ''Startup if Preset and Actual
Configuration Differ." Finally, the Hot Restart parameter prevents the CPU from starting if the
transition time from power off lo power on, or from STOP to RUN is lo nger than the lime
specified for this parame ter. A "O" value shu ts monitoring off.
I
WWW
I OK I Cancel l Heb I
Figure 3-70. S7-400 CPU Properties: Start-up parameters dialog.
148
Working with Hordware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired project and station. from
the central rock select the CPU module. righ t-click a nd selec t Object Properties.
then select the Startup lab. Parameters that are grayed ore not possible in th e
opened CPU,
2 Activate the check b ox Startup if Preset and Actua l Configuration Differ, to allow the
CPU lo start even ir the preset and se tpoint configurations d iffer. With this selling,
central rock or distributed 1/0 modules are not checked; PROFIBUS•DP interface
modules ore checked and must be inserted ror the CPU to sta rt. This parameter is
activa ted by defoull .
De-ac tivate the check box to d isable Startup If Prese t and Actua l Conflguratlo n
Differ. If al teasI one configured slot differs, then the CPU switches to STOP. If
module-slo ts other lhan those originally configured hove modules inserted. they ore
not compared.
3 Activate the "Reset Outputs at Hot Restart" lo hove all outputs and the PIQ to be
c leared on each occurrence o f a Hot Restart. De-activa te the check box In order
to hove all outputs and the PIO to maintain their lost state on each Hof Restart.
4 Select "Worm Restart." "Hol Restart, " or "Cold Restart." as the mode o f Startup After
Power On. The Cold Restart optio n is not a vailable on older CPUs.
S Set the parame ter Finished Message. in milliseconds. to specify the maximum CPU
wait-time ror configured modules to signal ready for opera tion otter power-up.
7 Set o value for the Hot Restart parameter in milliseconds. If th e time that 8 )(pires
between a transition from power-off to power-on, o r from STOP to RUN is longer than
the time specified for this parameter, then CPU sta rt-up \Nill be disabled. The value
"O" means no monitoring occurs.
9 From th e menu, select Save and Complle to generate the System Doto object
before downloading to the CPU.
149
STEP 7 in 7 Steps
Essential Elements
The Update Process Image Cyclically parameter determines ii the p rocess image of inpu ts
and o utputs should be updated cyclically. By default thls parameter is set to update the Ptl
and PIQ cyclically. The Scan Cycle Monitoring Time is the timer value that if exceeded by the
CPU cycle. the CPU is stopped. The Minimum Scan Cycle defines a minimum cycle lime th a t
CPU should always use - even if ii must wait. Th e Scan Cycle Load from Communications se ts
a percentage of the total cycle time for servic ing communicatio ns.
Adjusting the Size of the Process Image (PII/ PIQ) , perhaps lo reftecl aclual usage of inp ut/
outp ut bytes, is only relevant in certain S7•400 CPUs. The parameter 08 85 Coll Up at l/ 0
Access Error determines how OB 85 should be handled in the event o f 1/0 access errors. The
parameter is generally grayed and is fixed so lhal 1/0 access errors do not result in a call of
0B85, nor ore entries made in the d iagnostic b uffer. In la ter CPU revisio ns. o ther options for
colling OB 85 include "Only for Incoming and Outgoing Errors"', or "On Each Individ ual
Access." Th e Clock Memory parameler allows o by te from Bil memory (M) 1o be specified os
the location w here the CPU will o utput eight ind ividual clock-pulses.
Application Tips
Clock pulses. o re accessed in the user program, via lhe eight bits of the specified byle . From
the most-significant to !he leost-significanl bit !he output frequency i_s 0.5. 0.625, 1.0, 1.25, 2.0,
2.5, 5.0, and 10 Hz. Yo u may use lhese p ulses instead of timers, where periodic signals are
needed. Typical uses include flasher-circuits. a la rm synchronizatio n. or where even ts must be
continuously trigg ered at periodic interva ls. Clock p ulses hove on on-lo-o fF ratio o f I: I.
.:::]
I OK I C<n:el I__H_eJ_p__,
Figure 3-7 1. S7-400 CPU Properties: Cycle/Clock Memory parameters dialog.
150
Working with Hord ware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired project and station. from
the centra l rock select the C PU module. right-click a nd selec t Object Properties.
then select the Cycle/Clock Memory lob. Parameters that are grayed o re not
possib le in the opened CPU.
2 Ac tivate the checkbox Update OB 1 Process Image Cyclically for cyclic updates of
the process ima ge tables /PII/PIQ). This Is the d efault setting but con b e chang ed.
De-a c tivate the checkb ox Update OB 1 Process Image Cyclically to disable normal
cyclic updates o f the p rocess image (PII/PIQ). If this parameter is set 1/0 up doles
must be ha ndled by c a lling blocks.
3 In the Scan Cycle Monitoring Time field, sp ecify in milliseconds, the cycle lime tha t
the CPU is not to exceed. If the actual cycle time exceeds this wa tchdog time. the
CPU enters the STOP mode. unless OB 80 is loaded in CPU memory.
In the Minimum Scan Cycle Time field specify, in millisec onds. the minimum time
that should be used to process the program. If the actua l cycle lime is less than the
specified minimum, lhe CPU waits until the minimum cycle lime expires, o r If O B 90 is
in memory, this re maining tim e is used by the C PU for b ac kgro und p rocessing.
S In 1he Scan Cycle Load from Communications field, enter o value from 10 lo SO, as
o percent of the set cycle lime lo allocate for c ommunica tions p rocessing.
6 In the Size of the Process Image (PII/ PIQ) field , only releva nt in some 57-400 CPUs
ond lhe C PU 31 8. Enter on end byte-address for the PII/PIQ lo re nec t lhe actua l
usage of d igital input-bytes (PII) and d ig ita l ou tp ut-by1es /PIQ). The PII/PIQ update
time is thereby minimized.
7 Where the OB 85 Call at 1/ 0 Access Error parameter is allowed, select the option
"No Co lt of OB 85" if 0885 should no t be called whe n an 1/0 access erro r occurs
during update of the process images {PII/PIQ); select the optio n "Only for Incoming
a nd Outgoing Errors," to minimize the impa ct on the CPU cycle. The op tion "On
each ind ivid ual access" c a n result in an increa se in CPU cycle time.
8 To use clock memory, activa te the Clock Memory check box and then enter a byte
(e.g .. MB 97) from Bit Memory, to use for CPU output o f eig hf individual clock p ulses.
10 From the menu, select Save and Compile to generate lhe System Da to o bject
before downloading to the CPU.
151
STEP 7 in 7 Steps
,
Propcrlic~ -
,,..enupl$
Genttol I
I lime-ot-Oay lrterru~s
Sll!lf4:) l
l Cyclio Interrupt ]
Cyde/Clock MemolJI
01agnosiic$JClock
Retentive Memory j Merr,o,y
I
AeteriMy----------------------.·
tl~r of Memoty Bytes Sta<1r19 with MBO: [ffl
H~r of S7 Tmet* Sta,tr,g with TO: lo
tl~r of S7 Counteri Stert.-,g w~ CO: le
A1ca1
DB Ila. 8)11.e Addlets N~er of 8~ltl$
Af':lf-rlive Aiea 1 1, II) lo
Rt;lcrlWll Aleo 2. '1 Jo lo
A1!1"-1fflYeA1~osJ jI lo lo
fl c,t~,mPJe~ ~ 11 lo lo
ReienliveAre,;5: II JO [o
Actr.n!f.c ~.~11 &
Ri:ltnrvu Ale,> ;
Ae•"""r1e I\Ut& 9
1,
II
II
,~
ICP
lo
lo
la
lo
I Help
152
Working with Hordware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired project and station. from
the central rock select the CPU module. righ t-click a nd selec t Object Properties.
then select the Retentive Memory tob to define retentive memory areas.
2 Click in the Memory Bytes field, and enter the total number of bytes lo define os
retentive. The defined oreo starts ot MB Oo nd will include oll by1es up to MB n- 1.
3 Click in the S7 Timers field and enter the number of timers lo d efine os retentive. The
defined retentive oreo starts a l TO. and will include all timers up lo Tn- 1.
4 Clic k in the S7 Counters lleld ond enter the number of counters to define os
retentive. The defined re tentive area starts at CO, and will include all counters up to
Cn-1.
6 Use the tootbar Save and Compile b utton to genera te the System Doto object
before downloading to the CPU.
153
STEP 7 in 7 Steps
Essential Elements
Each CPU has a f1Xed amount of local memory tha t. by default, is equally divided among the
priorities classes. In lhis way. every priority class is guoro nleed its own local slack. A5 Vvill be
discussed in more detail later. all blocks [e.g.. FB. FC. SFB. and SFC) ore called directly or
indirectly trom on organiza tion block for processing. Furthermore, all organization blocks ore
called by the operating system based on o pre-assigned priority class. Since local memory is
allocated lo the priority class of organization b locks. the local memory ovoiloble to each
code block is based on lhe organiza tion block from which the b lock is called.
In S7-400 the total local memory, of the open CPU. may be re-alloca ted. Thal is to soy tha t
port of the local memory assigned too priority con be re-distributed to where ii is needed.
This may be lhe c a se where a priorily class is no! in use or where all of ils local memory is not
needed. Re-ollocolion of the local memory is useful since p riority classes do not oil need the
some local memory size. High priority classes (e.g .. 25-28). for example, do not normally
involve large data requirements or more than lwo levels of block calls.
Application Tips
When allocating local memory. all temporary variab les of the OB and of the blocks called
from tha t OB musl be considered. If too many nesting levels (blocks called in a horizonlal
direction) are used, the L-slock may overflow. The local sta c k requirements of your program
should be lested. The local data require ments or synchronous error OBs must always be
token into consideration. All organization blocks require a minimum of 20-bytes of local
memory to store the 20-byles of start informolion entered by !he CPU.
OK
I Cancel , __H_e_lP_ _.
Figure 3-73. CPU 413-1 Locol memory dialog: memory re -alloca tion allowed.
154
Working with Hordware Configurations
OK
I ~ncel I, Help
Figure 3-74. CPU 416-1 Local memory dialog: memory re -ollocotio n allowed.
ACTION
1 With the Hardware Configura tion loot open to the desired project a nd station. from
the central rack select the CPU module, right-click o nd select Object Properties.
then selec t the Re lentive Memory tab to define re ten tive memory oreos.
2 Clic k in o Priority field a nd enter the tolal number of bytes lo define for the priority
c lass. No te: the number ol bytes must be d ivisible by 2 and values 2-to-18 ore no l
valid. A minimum of 20-byles sa tisfies the minimum requirement th at every
organization b lock a lso requires 20 bytes of local data for its start information.
3 Modify a s many priority classes as required and confirm settings with OK.
Use the loolbar Save and Compile b utton to generate the System Doto o bject
before downlo a ding to the CPU.
155
STEP 7 in 7 Steps
Essential Elements
Three parameters influence the diagnostic buffer. Ac tivating the Extended Functtonat Scope
c a uses the CPU to enter events other thon stand ard errors into the diagnostic buffer. For
example. each stort of on organization block is considered o d iagnostic event. The increase
in d iagnostic events will cause the b uffer to overflow sooner. and make it more likely tha t
important messages will be overwritten. In some CPUs the parameter Number of Messages In
Buffer, allows the d iagnostic buffer size to be adjusted. The buffer normally holds 100
messages. The parameter Report Cause of STOP, if activated. causes each CPU STOP to be
entered in the buffer and reported to a designated PG/PC or operator panel.
Application Tips
The extended scope cannot be octivoled in STEP 7 ofter V3. I. If the parameter was
previously active in a project now being converted from V2.x to V3. I or higher. then the
setting con now be downlo a ded to the C PU or de-octivoted.
i4ill·MHt4--=- f4•4 i f - - ~
G_ .,, Staitup I ~le/Clock Memory 1 Aelentive Memo,y r MetnO!Y I
lntetrupls I Tir11e·ol-O II.I' lnlemJpt, I C)ICrio Interrupt Oiagoo,tic;IClock
r Spstem Dias,l~
I r ElQerid'!d IUr,r;Jlon.
P' Report cal.lie of STOP
Clock
S!-<!Olvoniutian S~chloniu!tion Mode iine Interval
In the PLC: INone ::::) lr,on!i 3
On MPI: INone ::] lt,,on 3
Orr Ml'I 11,,,nt iJ lho11 i]
COiiection Factor (rm): I□
OK
I Cancel , _ _H_e_
lP_ _.
156
Working with Hord ware Configurations
■ 1
ACTION
With the Hardware Configuration tool open to the desired project and station. rrom
the central rock select the C PU mod ule, rig ht-click and selec t Object Properties,
then select th e Diagnostics/Clock lob to make the required changes.
2 Activate the Report Cause of STOP check box, to hove a ll causes ol stop s to b e
e ntered lo the diag nostic buffer and lo be sent lo a designated PG/PC or operator
pa nel. Otherwise. deactivate th e checkbox to minimize the number o f events
e ntering the b uffer.
3 In the PLC field under Synchronization Mode, select As Mosler, ii the clock will
synchronize o th er c locks; selec t As Slave, if the c lock will be set by ano ther local
c lock: or selec t None if the local c lock is not to be synchronized.
4 In the PLC field under Time Interval. select the synchronization inteNol, if the clock
was set to sync hronize o ther clocks.
5 In the MPI field under Synchronization Mode. selec t As Moster. ir the c lock w ill
synchronize o th er c locks; select As Slave, it the c lock will be set by a no ther locol
c lock: or set None if the local clock is not to be synchronized.
6 In the MPI field under Time Interval, select the synchronization interval. if the cloc k
was set to sync hronize o th er clocks.
8 From the menu. select Save and Complle to genera te the Sys te m Dalo object
befo re downloading to the CPU.
157
STEP 7 in 7 Steps
Essential Elements
Using CPU access pro tection invo lves setting the proteclion level and ii reQuired, defining a
password. Once configured. the protection level and password is downloaded to the
module with the configuration data. Complete read and write access is possible for all
password holders. regardless of the key-switch position. Otherwise. three levels of p rotectio n
may apply to non-password holders. level 1 is th e defa ult setting in which standard key-
switch access is in operation. level 2 provides write-protection; read access is possible. but
write access is denied without the password. l evel 3 provides read/write protection, which
means that both read and write access ore denied. independent of the key-switc h position.
i41+I#lit¥934111111 f-4•4ii _ __ ~
General I
Stai:h.ip IC_yde/Clock Memo!,' l I
Retentive Memory Memoiv lntem:cib I
Time-of,Dey t~e111,1;it, I Csiclii; Inte,rupl j Diag0!)$tics/C~ Plotection
Level al Protecbon
r. 1: Keysw1tch S elting
r R~movi!ble ~h Pestwo,d
r 2. 'w'rit&-ProtWion
r 3; w'rite-/Read-Piot!!Clion
Pmwr.rr.f;
OK
I Cancel !__H_e_lP_ _,
158
Working with Hordware Configurations
i4t,J1I40i&i411111 i;i•Jti)- - ~
General I Slatlup I Cycle)Clock Memcxy I Rel,entive.Memory ) Memoi_y Inteir~i I
Trne-al•D11}' lnlern.ipts I Ciicbc lnteuupl I Dlagrmtics/Clock Protecl1on
C- 3: WriWr/ReM-Plot11etioo
Pimw«d:
Entei ~in:
OK
I ~ncel I '
Help
ACTION
I With the Hardware Configura tion tool open lo lhe desired project and sta tion, from
the c entral rack, selec t the CPU module, rig ht-click and selec t Object Properties,
then select the Pro lec tlon tab.
3 Select Level I or Key-switch p rotection with the optio n Removable with Pa ssword
enabled lo allow the key-switch restric tions to be re moved with possword entry. In
this mode, Read and write a ccess is possible for password holders. independent of
the key-switc h p osition.
4 Select Level 2 Pro lec tion by ltrst activa ting the Write Protection radio button: then
enter a nd confirm the desired password in the appropriate fields. In this mode, data
and programs may be monitored, but write opera tions such os download or modify
voriables is only permitted to password holders.
5 Select Level 3 Protec/ion by first activo ting the Write- Read Protec tion radio b utton;
then enter o nd confirm the desired password in the appropria te fields. In this mode,
read a nd wri te operatio ns ore permitted lo passw ord holders only.
6 From the menu. select Save and Complle to generate the System Doto object
before downlo ading to the CPU.
159
STEP 7 in 7 Steps
- Harr:rw.,re lnlerr~
I Cyei:: lntenupe J Dl11gnoltic$/Clock
C,IICIC/Clock M!ll'Mry
rlime-Del'I'/
I R!ilentive Memo,y
lntanuptt
PralcctJon
I MllmDIJ
MlillCOIJlPtlll"ll)
Ptoc~
Proce~, Prwy
II image
im~e Pri01it)I: J>Mllon
Prioil.Y. partition: 0881 ~
0B40. lffi'" lea rt a 0820. [3 3IIJP I p,. 08112- ~
0841: P7 Irc1 p,, 3 0821 f,I loe, ~ 3 0883. 126
0022:[s l'JB I.PA 3
0842; fie lue, ~- E] 0884: ~
0843: [ig j9eP-~ 3 oan; rs lnr 1 PA '..:] 0B85. ~
0844: j2o"° jne r•;. 3
'-
·lm rruptt 11:1 DPV1 I 0B66· ~
0845: FJ IrA PA 3 PrlorilY:
088"{. ~
0846:fF Iris· P,·. E] 085~ 12~ l:8/0 Fi
0947: j23 lc:B'·PA 3 086S '747 GB72- fs
0857 ' ""
0.873. r
I OK I Ceneef
I Help
160
Working with Hordware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired project and station:
select the CPU module. right-click and selec t Object Properties. then selec t the
Interrupts tab lo make your desired priority-class changes (optio na l).
4 0B81 is lhe only Asynchronous Interrupt OB in most S7-300 CPUs and it has a fixed
priority (priori ty-25). lf the open CPU supports modifying the defa ult priori1y then you
may en ter a va lue of 0. 2-4, 9. 12, 16. 17. or 24-26. Using the default value or a value
in ttie range o f 24-26 ensures th at asynchronous error OBs are not be interrupted by
other intemJpt events.
S Where the p riority of DPVl lntemJp t OBs is alterable, you may enter a new value o l
0, and 2-24. A va lue of Ois in effect disabling the OB.
6 From lhe menu, select Save and Compile to generate the System Doto object
before downloading lo lhe C PU.
161
STEP 7 in 7 Steps
Essential Elements
The properties tab for lime-of-day interrupts lists the Orgonizotion Blocks. OB 1Q..to-OB 17. All or
the time-of-day interrupts are assig ned a defaul t priority 2 class. Up lo eight lime-of-day
inlerrupls are supp orted by S7. but the exac t number a vailable is CPU-dependenl. If one of
lhese lime-of-day interrupts is not supported by the opened CPU. then the OB and its
p arameters ore grayed. Configuring a time-of-day in terrupt requires activating the OB.
selec ting the executio n interval. and setting the start date and lime. Alternate priorities that
may be assigned include priorities of 3-24.
Application Tips
Programming a time-of-day interrupt involves setting the start parameters. activating the OB,
writing the code for the OB, and downloading the OB to the CPU. The OB is then ready to act
a s the service routine - calle d when the interrup t is generated. The parameters of time-of-
day interrupts moy be set here in lhe hardware configuro1ion tool. or from w ithin the STEP 7
program. using standard system functions. TOD interru p t applicatio n mighl include
genera ling operator messages o r p roduclio n reports. or scheduled process readings.
Process- rmaga
PriolitJ, Active E~ion St<11t dete Tilie cl day p.111tijon
01< I
Figure 3. 79. CPU Properties: Time-of-Day Interrupt parameters dialog.
162
Working with Hordware Configurations
ACTION
1 With the Hardware Configuration tool open to the desired project and station. from
the central rock select the CPU module. righ t-click and selec t Object Properties.
then select the Time-of-Doy In terrupts lob.
2 Select the lime-of-day interrupt OB whose parameters you wish to oiler: lo modify
the Priority class click in the field and enter a valid alternate p riority of 3-to-24.
3 Click inside the Active c heck box to activa te th e OB. Tim e-of-day Interrupts may
also be oclivoted from the STEP 7 program using system function SFC 30 (ACT_TINT).
4 Click the drop arrow In the Execution field, ond select whether the OB should be
called once, every minute. every hour. every day, every week. every monlh, every
month-end. or every year. Time-of-day interrupts may also be se t from lne STEP 7
program. using system func tion SFC 28 (SET_TINT).
5 Next. click in the Start Dale field and enter the start dote for the time-of-day
interrupt. If the start dote is not entered on the properties dialog. ii can be set from
the STEP 7 program using the system function SFC 28 (SET_TINT).
6 Click in the Time of Day field and enter lhe start lime for lhe time-of-day interrupt.
The start time con be entered here on the properties dialog, or from the STEP 7
program. using the system function SFC 28 (SET_TINT).
7 Click inside the Active check box to mark the OB as oclivoled. If the Hme-of-doy
interrupt OB is not activa ted on the p roperties dialog, it con be activa ted on
demand from the STEP 7 program. Use system function SFC 30 (ACT_TINT) lo ac tivate
time-of-day interrupts.
9 Use the toolbar Save and Compile button to generate the System Doto object
before downloading to the CPU.
163
STEP 7 in 7 Steps
i?i·lfl#lii¥Wi411111 14•&+;- - ~
General I Slath.1p
Time-of-Oa,11 tnlenupta
I Cycle/ClockMemo1}'
Cycic l~r~ I
I Ae\entive Memoiy I Memoiy
Diagnostics/Clock ] Plotedion
I
lnterr~i
I
MiAicompwig
I
Proc= i ~ partfun
Pricictty Exeallion (mcJ Phate ollff!I (ms)
08::lll: r lsooo lo ID81 D,4 .:]
0831: r 12000 lo joe1.PA 3
j·J81 PA
0832: Is 11000 lo ::J
0833: fio Jsoo lo {JB1 °A 3
0834: r,;- 1200 lo joe1 PA 3
0835: fi2 1100 lo 1001 f'/> 3
0836: f,3 Isa lo los1.PA 3
0837: f,4' 120 lo l.ie, ?A 3
0838: r,s- 110 lo {081 PA °3
OK I l:4ncel j __H_e_lP_.....,
Figure 3-80. CPU Properties: Cyclic Interrupt parameters dialog.
164
Working with Hordware Configurations
■ 1
ACTION
With the Hardware Connguro lion 1001 open lo the desired project ond station. rrom
the central rack, select the CPU module, right-click and select Objec t Properties,
then selec t the Cyclic Interrupts tab to modify lhe configuration parameters.
2 Select the cyclic OB whose parome.ters you wish to alter. and enter a new Priority
c loss if you wish lo modify the defaul t priority; c lick in the field and enter o volid
alternate /3-24). Assigning o priority twice should be avoided to prevent loss of
interrupts due lo multiple (> 12) interrupts of the some priority occurring
simultaneously.
3 Enter o new Execution value if you w ish to modify lhe default processing interval for
the OB; click In the field. and en ter a valid value in lhe range of 10 milliseconds to 6
seconds (i.e., 10-to-60,000).
4 If multiple cyclic interrupt OBs will be running. lhen enter a Phase O ffset value for
each. in milliseconds, if you wish 1o ensure lhat p rocessing of the OBs is d istributed
somewhat evenly throughout lhe total CPU cycle. A valid range for this field is (0 -to-
60000) . The default value of O represents no p hase offset.
5 If the S7-400 CPU supports system update of Pl Partition /process image partitions),
you moy enter the number of the process image segment for the interrupt OB in
question, ii required. The CPU wit! update the a ssigned p rocess image segment.
whenever the associated interrupt OB is coiled. A valid range tor this field is (1 -to- 8).
The default value of " O" represents no p rocess Image partitioning.
7 Use the toolbar Save and Compfle button to genera te th e System Data objec t
before downloading to the CPU .
•
165
STEP 7 in 7 Steps
Essential Elements
The Short DescripHon . the some os given in the hardware catalog, gives important features of
the digital input module such as number of input circuits, supply voltage. and number o f
circuits per group (i.e.. per common], For example o 120 VAC input module moy hove 32·
inputs with fo ur groups of eight circuits (grouping o f 8], The Order Number reflects lhe
currently open module, which is assig ned to a specific slot in the configuration - it should
match the port number o f the physically installed module. The Name field shows the defoull
name of the module. Although the name con be changed, ii is not recomme nded. The
Comment field allows more details abou t the module or its application to be documented.
Application Tips
The writing area on a module connector limils what descriptive information that con b e
written fo r each d igital input. Use the comment field to provide detailed information on the
use o r the digilol inputs of o module.
iPIO,IOHtiODEfffiititJ,1"6fd1Uil _ _ _ _______
General IAdtte$ses I
Dl32lciJC 12CN
Oigial input module D1~2. 120 VUC, gro!C)ing 8
Comnle~
32-l)Oint Input Caid uses 4-bytes. 4-bytes reserved bJ c~rd
OK
I Cancel !__H_e_lP_ _,
166
Working with Hordware Configurations
IQl,l·I9iit¥UtlEti1Iif1•116f4,ff.tl--------~-~-
Gel'l!la1 Add-esDe& J
lrc>Ylt
OK
I C.,ncel , _ _H_e_lp_~
1 Wilh a station open in the hardware configura tion, select a rack to view its installed
modules: double click on a digital input module w hose properlies you wish to view
or edil. Nol all properties may be edited (e.g.. Order Number. Shor/ Description ).
2 On lhe General lob. the Shor! description of the module p rovides o briel summary
of the module features (e.g.. number of inputs, supply voltage. circuit grouping).
3 The Order Number is the porl number of the open module in the configuration and
should reflec t the digital input module installed in the some slot in th e p hysical rock.
Click in the Name field to enter a new name; the d efault name is based on the
number of inputs and the supply voltage prefixed with DI for dlgitol inpu l.
5 Use lhe Comment field lo enter o description of lhe module inputs or opplicotlon.
6 Select the Address tob to view or modify the starling byte address of the module. To
modify the slort byie address. de-oclivo te the System Selection check box. and
enter a new start by1e-oddress; confirm by p ressing OK. See Configuring Sl-400
Digital 1/0 Module Addresses.
167
STEP 7 in 7 Steps
Essential Elements
Activoling the hardware Interrupt parameter enables o il of the inlerrupl inputs for use. An
input delay con be specified ro r the en tire module, based on lhe type of signals connected.
The input delay should closely match the delay characteristics of the input device in order to
protect against false input signals. Finally, each input channel may be set lo trigger on
interrupt on the rising edge. fa lling edge, or on both the rising and failing edge o f the signal.
If neither parameter is activated. then the associated channels will not trigger an inlerrupt.
Activo ling the diagnostic Interrupt enables the module to generate a diagnostic inlerrupt.
The diagnostic func tions may vary depending on the module, but on the interrupt input
module includes monitoring the supply vollage o l !he connecled sensors and for a wire
b rea k in the connection between the input circuits and sensors. If mo nitoring Is
octivoled a nd the supply voltage foils. !he group d iagnoslic event is enlered inlo the
diagnostic dolo storage area of !he module. The data con be read from the module, in the
STEP 7 program, using the syslem funclion to "read syslem slatus lisf' (i.e.. SFC 51 RDSYSSTI or
evoluoled in 0882.
Application Tips
Response to hardware interrvpls in the user program is handled using organization b locks
(OBs) . In lhe S7-400 OB 40 through OB 47 ore available a nd ore assigned to the interrupl
module on the Addresses tab. The interrupt OB must be p rogrammed and downloaded to
!he CPU lo be ready to handle on interrupt. When o hardware inlerrupl is lrlggered. the
operating system interrupts th e main p rogram block (OB I) and calls the lnlerrup I OB.
OK I Cancel , __H_el_P_..,
168
Working with Hordware Configurations
1Alflti§iit¥U•lll@•lf4i1inl§il11•lf IIB•4ii----------~-
I
aenera1 Ac:kle- lnPl,ts I
!Enable Oestioatioo CPU
- -=
P- D"iagrio$tic Interrupt P' Hardware lnlelllJ!lt (01 lnter!1:§!l: I C~J 41;2DP
- '.3
-
I~ h◄ l ◄ l ► l ~I 0
I 1 [ 1
I 3
I
Di.,grmticf
Wire Br~:
... p- P"
• . P'
•
r
No Loed Voltage L+: p rv P' rv
''
Trigger for Her~& lnteliupl
R~ng (Positive) Edge: P" p- P' P"
Falling (Negelive) Edge• r r P' a.,. l
.
Inpot Dele;, (mst- 13(OCJ j3t(•CJ j31t:•l; )3 (C,CJ
'
R&acltlll"I lo Error. lsv :!
Sub,titute "I'~
I r
- II r II r II r1 I
=
OK
I ~nce1 I Help j
Figure 3--84. S7-400 Interrupt Input Module Properties: Input parameters lab.
ACTION
I With the required station open in lhe hordwore configuration, select the rock where
the module is inslolled; double c lick o n lhe in terrupl input module lo open the
p roperties dialog, then selec t the Inputs tab.
2 To use the module's d iagnostic feature. o cliva te the Diagnostic Interrupt c hec k box
and then aclivate the corresponding Wire Breok check box ror specific channels or
the Na load Voltage check box for lhe module. causes the module lo monitor a nd
reporl on these conditions. A suitable program In 0882. con be used lo evaluale
which error has occurred and on which inp ut t11e error occurred.
3 To use the module's hardware interrupt features. acliYa te the Hardware Interrupt
check box, then to enable use of the sixteen interrupt inputs. Ac tivate the Rising
Edge check box below the c hannel number if the input should trigger an lnterrupl
on a O-lo-1 transition; or Activate the Folling Edge check box, if the input sho uld
trigger on interrupt o n a l-lo-0 transition.
4 Click in the Input Deloy field and selecl lhe lypicol signal delay lime Vn milliseconds)
of the connected input sig nals. This parameter affects all inputs.
5 In the Reaction to Error field, select Keep las! Valid Value (Kl VI (logic-0 o r logic- I );
or selec t Substitute Value (SV). If you select substilule value, fo r each o ulput you
wish lo be se t to logic I , activate the check box for Substitule Value "I". Boxes not
activated will be set to logic 0.
6 Confirm the configuration parameters with the OK b utton and use lhe loolbor Save
and Compile button to generate the system data b locks.
169
STEP 7 in 7 Steps
Essential Elements
The Short DescrlpHon gives importanl features of the d ig ita l oulpul module such as number of
ou tput circuits. supply voltage. and number o f circuits per group (i.e.. per common). For
example o 120/230 VAC/2A outpu t module may hove 32-outpuls with eighl g roups of four
circuits (grouping of 4/. The Order Number refl ects the module assig ned to a specific slo t in
lhe configuration - ii should molch lhe port number of the physically installed module. The
Nome field shows the default name of the module. Allho ugh the name con be c hanged, ii is
no l recommended. The Comment field allows details about the module or its application to
be documented.
A digital output module may include on Ou tput tab if the module hos diagnostic Interrupt
features that monitors and reports d iagnostic events that hove been enabled on the
module. Diagnostic functions may include detection of wire break. no lood vol/age. shorl
circuit to ground. and short circuit lo supply. or blown fuse. This d igital outp ut may also hove
the ability lo se t o substitute va lue lhot determines the slate tha t each output should be set
to when the CPU goes to STOP.
141·Jll§Ht4i•I•Ji%i4ifl•tf#I•®4:Ai4•4idf■ ______~~-~
I
Gehei.al Ad~e- I
Shalt D~c11)11on. D016AAC120/230V/2A
Oigial oulpul modtJe D016. 120/230VAC.) 2A. giouping 4
l
Order NQ.: 6ES7 422·1FHOO-MAO
Name: loo1SAAci 2on3w12A
CO!ffllent
OK I Cancel I__H_el_P_ _.
Figure 3-85. S7· 400 Digital Output Module Proper1ies: General p roperti es tab.
170
Working with Hord ware Configurations
i4t,J,I41itW•Illliffldi4•1Hffii\ii;i•J4ii>la _____~ - -
I
s en!!fa1 Adlteu iea Outj)Ult I
r Enabl&- - - - - - - - - - - - - - - - - - - - - - - - - - ,
P Oiagnottic lntenupl D~ inalii:ln CPU for II .:]
lnte11J,llll:
Reaction tc CPU-STOP; ISubslik~e a v.we (SV) .:]
OutpiA
II◄ I◄ I► I►I I 0 I, 1
I 2
I 3
I
Diagn~
p
No ~ Volt~e L+;
I II p II ~ II p I
Shi:,il Circuit lo M·
I p
II r II r II r I
Sooslitute Value
5uootiute "1" [ El II r II r II r I
,.
OK I eance1 I Help I
Figure 3-86. S7-400 Digitol Outp ut Properties: Output porameters settings.
ACTION
I With a sta tion o pen in the hardware configuro lion, select a rack to view its installed
modules: double click on a digital output module whose properties you w ish lo view
or edit. Nol all properties may be edited (e.g .. Order Number, Short Description).
2 On the General lob. the Short description provides o brief summary of the module
features (e.g.. number o f outputs, supply voltage. circuit grouping) . The Order
Number is the p ort number o f the op en module In the configura tion a nd should
reflec t lhe digital output module installed in the some slot in the p hysical rock.
3 The default Name, w hich is modifiobte. is based on the number of outputs. the
supply voltage. and the oulp ut current. on p re fixed with DO for digital output.
4 Use the Comment field lo enter o d escrip tion o f the module outputs or appticalion.
5 Select the O utput lab lo se t operating parameters for the outputs of the module.
6 In lhe Reaction to CPU STOP field. select Keep Last Valid State (logic-0 or logic-I): or
select Substitute a Value. If you selecl "subslitute o value," lhen for each outpul you
wish lo be set to logic 1. aclivale the corresponding check box for Sybstilute "1 ".
Boxes not activated will be set to logic 0.
7 Ac tivate the Diagnostic Interrupt box to enable the module' s ability lo generate a
diognoslic inlerrupt when any one of ils diagnostic monitori ng events occurs.
a To activate diagnostic monitoring (e.g .. Wire Breol;. No Lood Voltoge. Short Circuit
to Ground (Ml. Short Circuit to Supply IL+I. or Blown Fuse) for on outp ut. ocflvale the
corresponding check box benea th each oulp ut circuit you wish lo monitor.
171
STEP 7 in 7 Steps
Essential Elements
As eoch module is inserted. four bytes ore reserved in either lhe process imoge of inpuls
(input moduleJ or process image of o utp uts (output module). The starting byte address for
each successive module is bosed on the next ovoilable byte address following the previous
input module (for inpulsJ or previous o utput module (for outputs). even if a slot is left empty,
If inpu t modules are installed in the first four slots. os seen in the figure below. slot-4 would
reserve bytes 0-3; slot-5 would reserve bytes 4-7; slot-6 would reserve bytes 8-11: and so on. II
ou tp ut modules ore installed in the following four slots. slot-8 would reserve bytes 0-3; slol-9
would reserve bytes 4-7: stot-10 would reserve bytes 8-1 I; and so o n. In the S7-400, assigned
starting byte-addresses may be modified under lhe address properties ot the module.
Application Tips
Digital inp uts ore accessed rrom the Pit using the input memory identifier ' I' prefixed lo the
a ddress; d igita l ou tp uts o re accessed in the PIQ, using the output memory identifier 'Q '
prefixed to the address. Both inputs ond ou tputs ore referenced os "byte.bit". A 32-point
ou tp ut module in slo t-4 would use addresses Q 0.0 through Q 3.7: on inpul module would use
I 0 .0 through I 3.7. Inputs/Outputs may also be accessed as by1es, words. or double words.
I Q Q Q Q
to lo lo 10 lo 10 lo to
3.7 7.7 11.7 15.7 3.7 7.7 1 1.7 15.7
Figure 3-87. Default digiloJ1/0 addressing in the S7-400 slo rts al byle-0, regardless of fhe slol.
and reserves 4-by tes per slot. Input a nd o utput modules moy use the same by1e addresses.
172
Working with Hordware Configurations
ACTION
1 From lhe SIMATIC Monoger, open the required projecl and select lhe S?-400 Station
for which a ddressing is required.
2 With lhe station selecled, in lhe righl pone o f the slation window double click on the
Hardware object to open the sta tion in the Hardware configuration tool.
3 Select o rock whose modules you w ish lo view the installed digitol 1/0 modules or
inserl new digilol t/0 modules.
View the starting byte address of each input mo dule in the I-Address column or
each outpul module In the Q-Address column.
5 To modify the slarling byle address of o module. select lhe module. right-click and
select Object Properties, then select the Address lob.
6 To modify a starting byle address. de-octivote the System Selecllon check box to
disable automatic address determination by the system.
7 Enter a new start byte-address and confirm by pressing OK. Since in the S?-400 the
complete PII and PIQ con be used. input ond ou lp ut modules may hove the some
addresses. Digitol 1/0 start byte addresses. ofter byte-0, must be o multiple of 4 (e.g.,
4, 8, 12. 16. 24. etc.).
8 The Process Image field shows the process image responsib le for updating the
module outputs. By default digital outputs ore cyclically updated by lhe CPU.
Figure 3-88. Default digital a ddressing in S7-400. Note that although 4-bytes (32-bils) ore
olwoys reserved. the ocluol byle usage of the module is displayed under the I-address and
Q-address columns.
173
STEP 7 in 7 Steps
Essential Elements
The Short DescrlpHon, the same as given in the hardware catalog. gives important features of
the analog input module such as acceploble input signals. bit resolutio n. and number of
input channels. For example an e ig ht channel a nalog input module may have 14-bi1
resolution and accep t 0-20 mA/ 4-20 mA current signals and several voltage ra nges. The
Order Number reflects the currently open module, inserted in o specific slo t in the
configuration - it should matc h the part number o f the actu a l installed module. The Name
field shows the default name of the module. Although the name con be changed. ii is not
recommended. The Comment field allows details o f the module's applica tion lo be entered.
Application Tips
The writing a rea on the module connector limits what descriptive information con be writ1en
for each input channel. Use the comment field to provide detailed information on the use of
the analog inp uts of a module.
I
Ge~al Addresie, lniiut,I I
Shtwl Detcripbon: Al 16il1:Ilk
r- ginputl)lod\eAl167°3 bit;
..!J
Orclei No.. 6ES7 431-0HHOO-OABO
Name;
I Cencel !__H_e'3_ _
Figure 3-89. S7-400 Analog Input General Properties d ia log.
174
Working with Hordware Configurations
Properties · AI16K13Bit -
OK
I Cancel I__H_~-~
Figure 3-90. S7-400 Analog Input Address Properties dialog.
1 Wilh a sta tion open in the hardware configura tion, select a rock to view its installed
modules: double click on on analog input module whose properties you wish lo
view or edit. Not all properties may be edited (e.g .. Order Number. Short
Descriplion I.
2 On the General lob. the Short description provides a brief summary of the module
features (e.g.. module type. number of inputs. bit resolu tion).
3 The Order Number is the port number of the open module in the configuration and
should reflec t the analog input module installed in the same slol in the actual rock.
4 Click in the Name field lo enter o new name; the default name is the number of
analog input c hannels a nd the bit resolution prefixed with Al for analog inp ut
S Use lhe Comment field lo enter a description of the module Inputs or opplicotlon.
6 Select the Address tob lo view or modify the starting by te address o f the module. To
modify the start by1e address, de-activate the System Selection check box and
enter a new slorl byte-address; confirm by p ressing OK. See Configuring Sl-400
Analog 1/0 Module Addresses.
175
STEP 7 in 7 Steps
Essential Elements
The config ura tion of analog inpu t signal parameters involves two concerns. In the Enable
Section you con activa te the module's hard ware or d iagnostic interrupt features; and in the
Input Section. you will determine the input signal charac teristics for each channel. On most
a nalog input modules o hardware interrupt con be triggered when user-defined signal limits
ore exceed ed and when all of the input channels have been read and converted (i.e.,
whenever new measured va lues are o f all inpu t channels).
Depending on the module, d iagnostic events may be activated for ind ividual channels or
channel groups and include d iagnostics such as wire break, Underflow. Overflow, or Short
Circuit lo Ground. When a d iagnostic interrupt occurs, on a channel or within a channel
group, th e module reports th e event lo the CPU (diagnostic buffer e ntry). Module-related
d iagnostic information as well os channel-specific d iagnostic events con be read from the
module using system functions (SFCs).
Application Tips
On modules that use a plug-in ronge card lo allow the various inpul signal ranges. ensure
lhal !he range cord Is inserted for the req uired channels. Also ensure Ihol the encoding
position on the module matches the letter (e.g.. A, B. C , D) d isplayed on 1he input d ialog
(below each channel) in the fields labeled Position of Measuring Range Selection Module.
I
General Aditesses lnp,Js · Part 1 t~uts- PanI 21
r:- Enable- - - - - - - - - - - - - - - - - - - - - - - - - - = - i
P D~tic Interrupt P" Hardware Datin~nCPU for j1 'YU 414-1 ..:)
lr-.ern.c,t lnteirupl
O~O!lic,
I H l ◄ l ► I HI 0
I 1
I 2
I 3
I
Wire Break r ' n r r• II r '
I
Refe1ence Channel Error. r II r r II r
Underflow- r II r r II r
Oveiflow r II r r II r
She1t Ciicuit l,Q M: r II r r II r
OK
I Cancel Help
Figure 3-9 1. S7-400 Ana log Input Module Properties; Input Poromelers-Port I.
176
Working with Hordware Configurations
iAltltI§iit¥4Jlltlid:(f 114•4i)~
I I
General Adltesse; 1n~s • Part 1 l~ut; · Pail 2 I
lrl)Ul
lH l ◄ l ► l ►1 I 0
I 1 I, 2
I 3
I
M~sll~g
Me<ffllrin!I Type, j2DMU j2DMU l4DM U j4DMU
MeoJtijing Ailnge, 14 20 rrA j4.,20 ml\ j4 .20m<\ J4..20 rrA I
ReferenoeJl.llCti<n I· .. I· .. I· .. I· .. ''
l
Tngger lor Herctware Interrupt
End o/ SCM Cycle
Reached al Ir,put I Ir:,! II r II r II r I
High limit I m<\ I m<\ I m<\ I m<\
low lri I mt. I m<\ I mt. I m<\
ACTION
'
1 Open to the required sta tion canfiguralian. double c lick o n the analog inpul
module lo open the p roperties d ia log. then selec t the Inputs lob.
2 Aclivote the check box Diagnostic Interrupt in order to use the module' s ability to
generate interrup t on certain module-specific diagnostic events.
3 Activate the check box Hardware Interrupt when Limit Exc eeded. to allow Inputs lo
generate on interrupt when the input signal exceeds (goes above or falls below).
Activate lhe check box Hardware Interrupt at End of Scan Cycle (if feature
available) to allow the module to signal the CPU with a hardware interrup t when a ll
o f the Input channels on the module hove acquired new measured values.
5 It the "Diagnostic lnlerrupr' is enabled then for each c hannel, you may activate the
check box for Group Diagnostics and for other c hannel diagnostics you wish to
enable (e.g.. Wire Break). If a diagnostic event occurs, a diognostic interrupt is
triggered and the module-dependent d iagnostics a re stored on the module.
6 Clic k in the Measurement Type field d irectly below each channel. and from the list
or available measurement types (e.g .. voltage (E). curren t. T/C. RTD) select one for
the associated c hannel. If a channel is not connected, select ''Deactivated."
7 Clic k in the Measurement Range field directl y below ea c h chonnel, and from the list
of available measurement ranges selec t a range for the associated channel.
8 If the hardware interrupt is enabled for input signal limits exceeded, then for each
channel, click in the corresponding fields and en ter the Upper limit va lue and l ower
limit value. The module will trigger an interrupt when the input value exceeds the set
"Upper limit," or when the input sig na l falls below the set "Lower Limit."
177
STEP 7 in 7 Steps
Essential Elements
The Short DescrlpHon, some as g iven in th e hardware ca ta log, is a gives a shortlist of features
o f the analog outpu t module such as ou tp ut signal ranges. bit resolution. and number of
ou tp ut channels. The Order Number reflects the module assigned in the configuration tool
and con be verified with port number of the physically insta lled module. The Nome field
shows the defo u!t name of the module. Changes to the module name ore reflected in the
configuration table. The Comment field o ltows more detail information about the module
[e.g., how it is used) to be documented.
You will be able to configure. the Outputs parameters tab. for viewing or selling the signal
type a nd ra nge used by each o utput channel. The c hoices for the Type of Output o re
voltage a nd c urren1;
Application Tips
The writing area on o n analog ou tput module connector limits what descriptive Information
tha t con be written for each output. Use the comment field to p rovide detailed Information
on the use or the analog output channels of o module.
I
Jieneral Adctesse$ Outputs I
0utpl.Cs
1 St~rt:
End: 527 I 3
OK I C.,ncet l __H_e_lP_ _,
Figure 3-93. S7-400 Ana log Output Module Properties: Addresses tab.
178
Working with Hordware Configurations
0 1
l 2
l 3
I
Output
Typaol Olllpul: II 11 IE IE
Output Range: ,4-
... 2-
□ -IM--,4 . 20 rAA ,., ., DV
==
I(+/· lOV
OK I C.,ncel H_el_P_
, ___ _,
Figure 3-94. 57-400 Analog Output Module Properties: Outpu t parameters lab.
ACTION
1 With the required sta tion open in the hardwore configuralian tool, select the cenlral
or expansion rock. or DP slave to display ifs ins tolled 1/0 modules; select the analog
output module and double click to open the p roperties dialog.
2 On lhe General lob. the Short description provides o brief summary of lhe module
features (e.g .. number of outputs. digital resolution). The Order Number is the port
number of the open module in the configuration and should reflecl the analog
output module installed in the corresponding slot or the p hysical rock.
3 The default Name, which is modifiable. is based on the number of analog output
channels ond the bil resolution prelixed wilh AO for analog output.
4 Use the Comment field lo enter o d escrip tion of the module outputs or app licotion.
5 Select the Address lob to view or modify the modules starting byte address.
6 Select the Oulpuls lob lo view or modify the operating parameters for the module
and for each analog output channel. Use the Output novigotionol buttons to see
the output channels tt1o t ore no t In view.
7 Click in the Measure ment Type field below each channel, ond from the list of
available measuremen t types [e.g., voltage (E). current (I) ] selec t one for the
associated outp ut channel. If a channel is not connected . select "Deactiva ted."
8 Click in the Measurement Ra nge field below each c hannel, and from the list of
available ranges (e.g.+ 1OV. 1-5V. and 0 -1DV) selecl a range ror lhe outpul channel.
9 Con firm the configuration parameters with the OK b utton and use the toolbar Save
and Compile button to generate the Sys/em Doto object.
179
STEP 7 in 7 Steps
Essential Elements
Default addressing for S7-400 analog 1/0 starts with byle-512 of peripheral memory, for both
inputs and oulp uls. As each successive module is Inserted. its starting byte address is based
on the next available byte address following the previous analog input module (for inputs) or
previous analog output module (for outputs). even if a slot is left empty. Like with digital
modules analog input and output modules con hove the some start bye addresses.
In the figure below, lhe S7- 400 hos 16-channel analog input modules in slo ts 4-6 and 8-
channel analog output modules in slots 7-8. Starting with byle-512, slot-4 reserves bytes 512 -
l o- 543; slol -5 reserves bytes 544 -to- 575; and slol-6 reserves bytes 576 -lo- 607. Again tram
byle-512 for outputs, slol-7 reserves byles S12 -to- 527; slol-8 reserves bytes 528 -lo- 543. Each
input address is prefixed w ith PIW (peripheral input word); each output address is prefixed
with PQW (peripheral ou tput word). The first analog input is PIW 512: the second input is PIW
514. The firs t analog ou tput is PQW 512; the second analog output is PQW 514.
Application Tips
Since peripheral memory involves d irect access to input or output modules, analog 1/0 must
be handled via lhe program. In LAD and FBD on analog input is read by specifying the input
address as the source in o move instruction; an analog output is wri11en by specifying lhe
output address os the destination of the move opera tion. In STL, a load operation reads on
analog input by specifying lhe Input address (e.g .. L PW 5 12). A value is sent to on analog
output with o transfer operation that specifies the output address (e.g.• T PW 5 12).
PIW/ PQW PIW/ PQW PIW/ PQW PIW/ PQW PIW/ PQW
180
Working with Hordware Configurations
ACTION
1 From lhe SIMATIC Monoger, open the required projecl and select the S?-400 Station
for which a ddressing is required.
2 With lhe station selecled, in lhe righl pone o f the slation window double click on the
Hardware object to open the sta tion in the Hardware configuration tool.
3 Select o rock whose modules you w ish lo view the installed analog 1/0 modules or
insert new analog 1/0 modules.
View the starting byte address of each input mo dule in the I-Address column or
each outpul module In the Q-Address column.
5 To modify !he slarling byle address of o module. select lhe module. right-click and
select Object Properties , then select the Address lab.
6 To modify o starting byle address, first de-oclivote lhe System Selection check box
to disable automatic address determination b y the system.
7 Enler a new start byte-address and confirm by pressing OK. In the S7-400 analog
inpul ond onolog outpu t modules may hove the some starting byle addresses (e.g ..
PIW S12, PQW S12). Analog 1/0 start by1e addresses. a fter byte-5 12, mus1 be at 16-
byle boundaries.
8 The Process Image field hos no meaning with analog modules and is grayed.
~~ (OI UA2
PS 40710!\ 6E S7 407-0KAO
Figure 3-96. Default analog addressing in S7-400. Nole, lhol 16-channel module res erves 32-
bytes and 8-channel modules reserves 16-byles. Also note, under the I-address and Q-
address columns. that analog inpuls and oulputs in the S7-400 may use lhe some addresses.
181
STEP 7 in 7 Steps
Application Tips
A module is assigned to a particula r CPU by selecling the module and opening its objec t
properties. Modules ha ving interrup t capability will a utomatically indicale. under its o bjecl
properties, the CPU to which it is assig ned.
IAl·l•I§Utl§,Jlld:t4it4•t-rihi•tfi -......________
Ger,eral Addrll'$$e; I
1 No.. I d3
2 CPU 416-1(21 3
3 CPU 416·1(3) 4
4 CPtJ 416-1(4) 5
01<
I CNocel I Help I
Figure 3-97. S7-400 1/0 Module Ad d resses dialog in multiple CPU configura tion.
Each module must be assig ned lo o specific CPU.
182
Working with Hordware Configurations
14irfrt§lit4§'11UffiDfJ@ijjJHh1i431411ttifblll 29
Genet.al I Add1~e$ lnpo.As I
f Enable
C Oiag-iostic lnteirupt r Hardware lntetrupt Oe&tinaticnCPIJ
I~. ere 416-1121 3
forlntem..,t
-
•
Ir-wt
Diaglom
II◄ I◄ I► I►II 0
I 1
I 2
I 3
I
\r{1e Break r I r r II 17
I-loLo.,d Vol~e L+: r I r r 11 r
Trigger for Hllldw111e lntesrupl
Rising (Posijve) Edge; r r r r
~ aliig (Negative) Edge: r r r r
-
I 1npulD8.W (m:~ j3 (DC) j3 tOCl I• nci j3IOC}
::.
-
I Reaction to En01: jsv
Subsblu!e "1 '~
I C1 II r II G II C1 I
I, OK I Caicel I
Figure 3-98. S7-400 Interrupt Input Module Properties: Input poromelers lob.
showing the Des lino lion CPU for interrupt genera led by lhis cord.
ACTION
1 Slort the SIMATIC Manager and open lhe projecl with the mulli-compuling station.
2 Open lhe Hardware Configuration tool to display the multi-computing station and 1/0
rocks and modules.
3 Select and double- click on a module and select its Address lob.
4 From the CPU Assignment window, displaying the multi-computing CPUs. selec t the
CPU No. the module will be associated with.
5 Repeat the assignment process ror all digital/analog signal modules (SMs), !unction
modules (FMsl, and communications processors (CPs) in both th e CPU rock a nd all
local a nd remote expansion rocks.
183
Working with STEP 7
Programs and Data
STEP 7 in 7 Steps
There o re many a dva ntages to creating your code in modular blocks. Each block Is a
worldng unit tha t m ay b e called repe titively as need ed. and may be stored in o libra ry for
la ter use. Since each block performs a specific function, the program is simplified, ond e a c h
b lock may be tested individually. Code blocks may be copied a nd duplicated or slightly
m odified for reuse for the same or a similar function. Finally, each b lock may be called in ll1e
program for processing on a condilional or on unconditional b asis.
I
fV'lain Carrovsel Sorter Sh rink Wrcp Operator
Conveyor Control Con trol Control Pcnel
Figure 4-1. Typical d ivision of machine/process into m ajor functional or technological units.
186
Working Wilh STEP 7 Programs and Doto
~
Shrink ---......
--
Oevioe or LOOP n
Wrq::per
Sl.btaslc (I'\) ....___ Device or LOop 1
Devioe or LOop n
-• Opefqtor
Sl.blasl: 1 o evice or LOop 1
~
Device or Loop n
PO"lel
Slbtask (n) Device or Loop 1
'--. Devic e or IDOP n
~~
--- OtherUnrt
Sl.blosk 1
.. ---- - Device or Loop 1
Device or LOOP n
Figure 4-2. Illustration of p rogram design based on d ivision of control task into major
--~ Devk:e or LOop 1
Device or LOop n
lunclional or technological units. unit subtasks, a nd finally into device or loop operations.
As you develop th e program, you may subdivide ii into as many sections or blocks as you
like. To the degree tha t it is possib le , each block sho uld be self-conta ined and relatively
independent of other blocks. Wrth this approach, the block con be easily tested and
debugged, and later problems con be pinpoin ted too block based on the func tion.
187
STEP 7 in 7 Steps
While all of the resource listed below may be used in your programs, the actual number of
blocks that may be programmed (e.g.. FBs, FCs, DBsl. or that ore available (e.g., OBs, SFCs
and SFBs), is CPU-dependent. The size I hot o block con be (i.e., length in bytes) Is also
dependent on lhe CPU. You may view the performance characteristics for a CPU, from the
online window o f lhe SIMATIC Manager. ofler selecting the CPU lhen from lhe menu
selecting PLC ► Module Information.
Finally, system blocks include system doto b locks (SDBs), which contain doto used by lhe
PLC. SDBs contain the compiled configuration data generated by the hardware and
network configura tion tools, as well as function module configuration tools. Ultima tely, the
SDBs ore downloaded to the CPU and lo the associated modules (e.g., CPs, FMs, e tc .).
188
Working With STEP 7 Programs and Doto
Just os OB 100 ond OB 10 1 ore assigned too specific lype or slor1up. each OB ho.so specific
processing task, based on system-related event. When tho! specific cond ilion or event
occurs. the S7 operaling system responds by colling the associated OB to be processed. lhe
oc tuol response. however. is based on the code tho l you will hove wri llen in the O B. By
implementing code in !he various organization b locks, you determine what code ls
processed o f startup, duri ng the normal cycle, in lhe event of timed or hardware in terrupts.
and syslem-rela ted errors. An overview of organiza tion b locks according lo lhelr processing
function ond the events or conditions lhot trigger their calllng is shown in the loltowing table.
Ta ble 4-2 . 0 verv,ew o f 57 0 raan1za r,on Blocksond lheir. ossoc1a e noaenna even I.
OIType OB No. Cal Event and Appllcalfon Description
Normal Cyclical Called ofter each CPU slort-up ond therea fter, cyclically. to process
1
Processlng Iha moin user progron1.
Background Called lo process non-critical code, when the octuol cycle time of
90
Processing lhe current cycle is less than the user-defined minimum cycle.
CPU Startups
- Called of each CPU start-up and pnor to colling OB I, lo process
100-101
Processing fnlliolizotlon code thol must be execuled once ot each startup.
189
STEP 7 in 7 Steps
In on FB you may define temporary /TEMP} local variables. for those values that ore only
required by the FB w hile the b lock is processing; you may d efine static {STAT) variables, for
those values that must be saved and ovoiloble from one coll o f the FB to the next (I.e..
memory). You may also define formal parameters. a special type of variable. which allows
you lo develop on FB os o b la ck box function. When specifying formal parameters. you may
define IN. OUT. or IN_OUT variables. IN variables are inp uts to the function. read into the FB;
OUT variables ore outpu ts from the FB. written to by the FB; on tN_OUT variable is both read
from and written to by the FB. Formal parameter variables to an FB act as substitute address
holders. Each time you coll the FB as o function in you p rogram. you will supply a different se t
o f actual addresses (actual parameters) in p lace o f lhe form al parameters.
FBlOO : Title:
~t;.;,~k-~:
. , ,. ... -~--. .,~l
T it.l e :
Figure 4-3. The LAD editor open lo the template for programming o function block (FB).
In STL. on FB wilnoul form al parameters is called using the CALL instruction. to specify the FB
number and the instance DB number (e.g ., CALL FB t 00. DB 100). If the FB hos formal
parameters. each parame ter is listed on a separale line beneath the CALL line. allowing you
to specify on address for each ac tual parameter.
190
Working With STEP 7 Programs a nd Doto
Functions (FC)
A Function (FC) is one of three user block types (08, FB, and FC) in which you may write port
of your program. Unlike the FB, the FC does no1 require on assigned da ta block (DB) as
memory, However, o n FC con access o global data block Fo r reading or wri ting doto tha t
other blocks may access. FCs ore suitable for simple logic to complex digital opera tions, ond
In many S7 applications, will account for os much as seventy to eigh ty percen t o f the to ta l
program. As seen in the template fo r p rogramming ond FC, like o th er blocks ii contains o
variable declaration section (lop pane of block window), for declaring block variables: o nd
a code section (bottom pone of b lock window), for writing the program.
In an FC, you may define temporary (TEMP) variables, for those values that are only required
by the FC and ore only available white the FC is processing. Each FC also allows you lo
define a RETURN variable tha t is re tu rned to the colling block. You may also define formal
parameters, a special type of variable tha t a llow s you to develop an FC as a b lock box
function - similar too box instruc tio n. When specifying format parame ters. you may define
IN, OUT, or IN_OUT variables. IN variables o re inputs to the function and are read into the FC;
OUT va riables are outputs from the FC or w ritten lo by the FC; an IN_OUT variable is b oth read
from and written to by the FC. Format parameter va riables to a n FC act as substitute address
ho lders. Each lime you c o ll the FC as a func tion in you p rogram, you w ill supply a d ifferent
set of actual addresses (actua l parameters) in place of 1he formal parameters.
- f□l ~
,Contents Of: 'Envitl:ltlrnent\l~foce~•
,.,....--,-----
Int etface Name Data Type Comment
0-11. 0
,...o, our
!
IB -0 IN_OUT
1!1 ~ TEMP
f!l··ORETURN
Ftl : Title:
,.~t;.;,~k
.......... ~·-il: Titl e :
.,
Figure 4-4. The LAD editor open lo the template for programming a function (FC).
Calling a Function
An FC con be called from a ny other block (e.g., OB, FB, FCI in LA D, FBD, o r in STL. If the FC is
written without formal parameters, lhen in LAD/FBD you may coll !he FC using the CALL coil
or o utp ut resp ectively; you must specify lhe FC number above the coil or output. You may
also drag the function from the FC Blocks folder of the Program Elements and d rop ii inlo lhe
c urre nt network. You may call !he FC with o r withou t preceding logic cond itions, If the FC hos
forma l parameters, the CALL coil o r output canno t b e used. Instead, you must take the FC
box from the Program Elements browser a nd place ii onto lhe nelworl<. where you must
sp ecify the address of each a c tual parameter as required by each formal parameter.
In STL. an FC w ithout formal poromelers is called using the CALL instruclion lo specify !he FC
number (e.g .. CALL FC 1). If the FC hos formal parameters, each is lisled on o separate line
be nea th !he CALL line, allowing you lo specify on actual parameter (address) for each.
19 1
STEP 7 in 7 Steps
Figure 4-5 . Each data block may be defined according to your data requirements.
There ore two doto block types in STEP 7. The DB type, is defined when lhe data block is
created, and is based on haw the 08 will be used in conjunction with logic b lacks. Shored
DBs (also called global DBs) ore used to store dolo tha t may be reod from or wril ten to by
any block within the complete program. An instance DB, on the other hand, is o data b lock
assigned too specific Function Block a s required memory. The FB hos read/write access lo
lhe instance DB and stores both ils declared stalic (STAT) variables and formal parameter
variables in the DB. When an instance DB is created, it must be explicitly assigned to on FB.
FC 10 (
R/W ,. Shaed DB
OB I
DP, 20
RJVll
FC20 - -
R/W .
fnstonce DB
R/W DB 100
FB 10 (
•
Figure 4-6. Illustration of Access to Instance and Shared [Global) Doto Blocks.
192
Working With STEP 7 Programs and Doto
Before accessing o DB variable. you must open the doto block Firs!, using the appropriate
instruc tion to rererence lhe DB number (e.g.. OPN DB n). Once o doto block is open. any
variable may be accessed. using the correct identifier and address (e.g .. DBW4, Tobie 4-3).
Each S7 CPU hos lwo regislers lhol ii can use lo open a DB. These registers. which the CPU
uses to hold the number of the current DB. ore called the DB-<egisler a nd the DI-register.
Although both g lobal a nd instance DBs may be opened in either register. it is preferable that
global DBs ore opened with the DB-register and instance DBs with the DI-register.
While the CPU uses the DB and DI registers identically, some restrictions and guidelines help lo
minimize potential errors. In LAD/FBD, for example , you con only affect lhe DB register when
you use the OPN coil or OPN output. Therefore. in LAD/FBD you may open a global data
block. Any data element can then be accessed in the following networks until a new DB is
opened. In LAD/FBD. the instance DB associated with on FB is, by design. opened with lhe Dl-
regisler whenever the FB is coiled. In STL. the open instruc tion is simply 'OPN DB n' (e.g., OPN
DB 22). or OPN DI n (e.g., OPN DI 23). As shown in Tobie 4-3, a dolo word is addressed DBW if
you used OPN DB a nd is addressed DtW if you used OPN DI.
Other methods for addressing the elements of a DB include fully addressed access, and
symbolic addressing. Fully addressed access, only possible in LAD and FBD. does not require
opening lhe DB. The DB is specified os port of the address (e.g.. DB 10.DBW 4). Similar to full
addressing. the symbolic address of each data loca tion is derived by combining the
assigned symbolic name or a dolo block w ith the assigned name o r each e lement in the
d ata block (e.g., Zone_l.TMP_PRESET_3). In this case, the DB name is Zone_ l a nd the variable
is TMP_PRESET_3 (See Figure 4 -5).
193
STEP 7 in 7 Steps
S7 Program Processing
An essential step in STEP 7 p rogramming, is deciding how each block is called for processing.
This step involves defining what should trigger the coll of o block, a nd how often lhe block
needs processing. Before any block con be processed. it must be downloaded lo the CPU
and called from somewhere within the program. How orten a block needs processing and
what triggers its coll is generally based on the function the block performs. In any case, the
processing needs of your program con be efficiently handled by the OBs listed In Tobie 4· 4.
As you define how lhe blocks of your p rogram will be processed. you will need to consider
using OBs. Consider colling blocks that initialize va lues at each startup, from the slarl-up OBs.
Coll blocks that need processing at fixed Intervals (e.g.. every 500 ms), from o c yclic OB (e.g.,
OB 30) . Blocks tha t act as service rou tines, responding to p rocess or module-generated
interrupts, ore called from on interrupt OB (e.g ., OB40/. Blocks that need continuous
processing. ore coiled fro m OB 1 [main program).
194
Working With STEP 7 Programs a nd Doto
The CPU uses o p riority schem e to manage how o th er OBs may interrup t OB 1. as well as o ne
ano ther. With priority classes from 1- 28, priority 28 is the highest. If an OB is called while one o f
lower priority (e.g .. OB 1) is being proc essed, the lower priority is interrupted. After the
interrup ting OB is done. the interrup led OB con tinues at lhe point immediately following the
po int o f interruptio n. OBs that ore assig ned the sa me prio rity (e.g., OB 10-0B 17, priority 2) are
processed in sequenc e , should they be triggered simultaneously. OB 90 hos o priority of 29.
a lthough ii is interpre ted o s 0.29. ma king it the lowest p riorily. In g e nera l. priorities o re tixed in
the S7-300: however. in the CPU 318 and in S7-400 C PUs. certa in OB priorities may be a ltered.
Detec t I
Start Lp
Power Up '
I
I
Progrom
'
I
I
" "'
I
I
Program
'
'
I
I OB I FC 20
"
:I
I
I
Orqorilofioo Block
I
I
.
lrotenvp t ln tenvpted Pro c ess lntell\,f.>t
Detected
- SeNk:e Rovtine
'
I
I
-
I
I
I
FC30
:I
Error/ f'Ov lt .
I
I
I
I
l
lntenvpted
" ,
Orgori10Jion lllock
Pr◊<::e$s rovn
Detec ted '
I
SeNice R◊Vtir,e
I '
I
'
I
I
I
~
'II FC -40
I
'
I
I
I
I
~
I
FC SO F& 43
Process
PII/ PIQ
I
I
'
I
I
I
blo ck End
"-
T I
I
I
'
'
~--~·~ ------ --- ------- - --- ----- -- - --- -----···--J
I
Figure 4-7. Illustration of S7 Program Processing; and Organiza tion Blocks as the Interface
between the S7 Operoiing System a nd th e User Program.
195
STEP 7 in 7 Steps
ID 8 Input lyfe-8 (111) Input lyte-9 (119) Input lyfe-10 (1110) Input lyle-11 (1111)
Bit Positions 7 0 0 7 0 7 0
Figure 4-8. Illustration of input double word-8. Bit address t 9.7 is highlighted. On a 32-point
rnodule. with start address of input byte-8. byte-8 is the first group of eight inpul circuits.
Bit Positions 7 r 6 5 4 3 2 0 7 6 5 4 3 0
Figure 4-9. Illustration o f ou tput word-4. Bit address Q 5.2 is highlighted. On a 16-point
module, with start address of byte-4. by1e-4 is the second group of eight output circuits.
196
Working With STEP 7 Programs a nd Doto
Bil memory addresses o re accessed in the program using the identifier letter ; M'. A bit
loca tion is addressed M byte.bit. a byte is addressed MB n, o word is addressed MW n. and o
d ouble word as MD n (e.g., M 101.2, MB 100. MW 100. MD 100). When configuring the CPU
parameters, contiguous areas of bit memory con be defined as retentive. Otherwise, the
con tents o r bit memory ore lost when power is removed.
Figure 4-10. Memory word- 100: A b it address is written ·M byte.bit' (e.g .. M 101.2).
Uke other S7 memory areas. the peripheral memory sta rts al byte-0. In fact. the Input image
area (I) reflects d ata read d irectly from d ig ita l input modules by the CPU on each scan. The
CPU reads the input modules starting wilh peripheral input byle-0 (PIB OJ and places the
results in the inpu t image area starting with input byte-0 (1B 0). You can also read a module
from anywhere in your program by accessing the desired input byte from the Pl a rea.
Conversely. you may transfer data too digital o utput module by accessing the desired
p erip heral output byte (e.g., PQB O updates the eight bits of the digita l outp uts at QB OJ.
The peripheral memory area nol only corresponds to the addresses assig ned in lhe hardware
configuration, for both d ig ital modules. bul a lso lo analog modules. Unlike d igital modules,
analog input modules ore not read cyclically to on input image; nor is on analog outpu t
imoge transferred cyclically to analog output modules. Each analog 1/0 musl be read or
written o n d emand in your p rogram, via peripheral memory, Analog inp ut addresses are
pre F1Xed with PIW a nd analog ou tp uts ore prefixed with PQW. In LAD/FBD, the Move
operatio n is used to reod ond write analog 1/0. In Statement Ust (STL), the load operation
rea ds an a nalog input (e.g., L PIW 256) a nd the transfer operation writes lo on analog output
(e.g .. T PQW 256).
LPIW 256 Perfpheral Input lyfe-256 (PII ~) Petfpheral Input lyte.257 (PII 257)
F[rst Analog Input ' 7 6 5 4 3 2 I 0 7 6 5 4 3 2 I 0
Figure 4- 11 . Accessing peripheral input word-256. The next analog input channel is PIW 258.
TPQW 256 Pertpheral Output lyt9•256 (Pll 256) Perlpheral output lyt9•257 (PII 257)
•
Firs! Anolog Output 7 6
••
5 4
"
3 2 I
•
0
·•
7
-6 5 4
•
3
••
2 1 0
Figure 4-12. Accessing peripheral ou tput word-256. The next analog output is PQW 258.
197
STEP 7 in 7 Steps
15 14 13 12 11 10 09 I oo 07 06 05 04 03 I 02 I 01 I oo
"
X X 0 0 0 1 0 1 0 I 0 1 0 0 0 0 TO
-
X X 0 I Tl
X X I 0 T2
' -
X X I 1 T(n)
Figure 4- 13. lllustrotion of Timer Word formal. The preset value of TO= 550 x .01. or 5.5 sec.
15 14 13 12 11 10 09 08 07 06 I os 04 I 02 01 00
X X X X 0 1 0 I 0 I 0 1
03
0 0 0 0 co
-
X X X X Cl
X X X X C2
- - ,_ - - - -
X X X X Cjn)
Figure 4-14. Illustration of Counter Word format.
198
Working With STEP 7 Programs and Doto
The total size of the local memory is CPU dependent. The ac tual size of the tocot stock
available too block is actually the size allocated lo the OB from which the b lock is called. By
default. the local memory available is equally divided among each OB {e.g.. 256) bytes). In
S7-400 C PUs and in the CPU 318. the amoun t of local memory allocated to each priority con
b e modified. Since not all priorities require the sam e size local stack. a larger local slack can
be assigned to priori ty classes needing more local memory. Furthermore. priority c lasses lhat
are not required in the p rogram may be deactivated. to free additiona l local memory.
199
STEP 7 in 7 Steps
BOOL
Dalo type BOOL reserves a single bit for o variable lhot con take on the permissible values
ot e ither TRUE or FALSE.
..!J /4
Figure 4- 15. The first two bits of DB 100 ore declared as BOOL variables.
BYTE
A varia ble of doto type BYTE. reserves 8-bits. These bits ore not evaluated individually, but as
on 8-bit hex number. Each hex digit is represented In four-bits, allowing a lwo-d ig lt Hex value.
A constant of data type BYTE is specified using the identifier 8# 16#. where " B" is for byte, and
' 16' is for hex (e.g .• B# I 6# OA). The permissible range o f values is from B# 16#00 lo 8-# 1611 FF.
I 0 0 I 1
A F B# l 6/!AF
Figure 4- 16. A BYTE variable
WORD
Variables o f d ata type WORD reserve 16-bits. Da to typ e WORD re presents a 16-bit string,
where the ind ividual bits ore no t evaluated as a unit. therefore a WORD variable supports
several bit-oriented uses. A WORD variable can simply be a 16-bil b inary string of Is and Os; o
4-digil Hexadecimal number; a 3-digii count value in BCD; or two unsigned decimal va lues,
each stored in one byte (e.g .. 255, 255).
200
Working With STEP 7 Programs a nd Doto
The 16-b il hex format con also support o 3-decode BCD value. simply by only e ntering hex
digits 0-to- 9 in order lo avoid invalid BCD numbers. BCD does not use a unique identifier, but
instead uses the hexa d ecimal identifier. The range for o valid 16-bil BCD number is ±9 ,99.
specified as W# 16#FOOO to W# 16#0999. Bits 12-l 5 are used to indicate the sign. Negative is
denoted by I XXX. a nd positive by OXXX, since only bil 15 is used for the sign.
8 4 I 2 1 I8 4 I 2 1 8 I 4 2 I1 8 I 4 I 2 . 1 I Weight
15 14 13 12 11 10 09 08 '11 06 OS m 02 01 oo ■ Na.
1 1 1 1 1 1 l 1 1 1 1 1 1 1 1 1
F F F F W#16#Ffff
Figure 4-17. WORD variable interpreted as 16-b it hexadecimal.
14 13 12 11 10 m 01
15
1 1
•
1 1 1 1
•
09
1
08 ! 07
1 1
°' 1
OS
1
-
OI
1 1
02
1 1
00
1
-
■ No.
-
255 255 a#(255,255)
Figure 4-18. A WORD variable interpreted as 2-bytes unsigned decimal.
201
STEP 7 in 7 Steps
DWORD
Variables of data type DWORD reserve 32-bil s. Data type DWORD represents a 32-bil siring,
where the individual bits ore no t evaluated as o unit, thereby allowing o DWORD va riable to
be used for several b it-oriented purposes. A DWORD variable con simply be a 32-bil b inary
string of Is and Os; on 8-digit Hexadecimal number; or four unsig ned decimal values, each
stored in o ne byte (e.g.. 255. 255. 255.1 ). Because the binary equivale nt o f Hex 0-9 Is the
same for BCD, DWORD variables moy also be used in BCD opera tions.
The 32-bit hex forma t co n also support o 7-decode BCD value, simply by o nly using the digits
O-to-9. in order to ovoid invalid BCD numbers. The valid range for 32-bil BCD numbers is
±9.999.999. Specified using the 32-bit hex identifier, is OW# I 6#F9999999 to OW # l 6#09999999.
Bits 28-3 1 are used lo ind icate the sig n. Negative is denoted by 1XXX. and positive by OXXX.
since only b it 31 is used For the sig n.
8421
'
8421 8421 I 8421 8421 I 8421 I 8421 I 8421 I Weight
7 0 7 0 7 I
0 7 I 0 Bil No.
I 1 1 1 1 I I 1 1 l 1 I l 1 1 1 1 1 1 I 1 1 1 I 1 1 1 1 1 1 I 1
202
Working With STEP 7 Programs a nd Doto
INT
Variables of data type INT represent sig ned decimal integers in o 16-bil word. The permissib le
range for data type INT variables is -32.768 to +32.767. A constant of type INT is entered in the
declaration a re a o f a code block, data block. or as on input va lue to on instruc tion. simply
with the appropriate sign (e.g.. +2575). No ide ntifier is required.
15 14 13 12 11 10 09 C8 rn 06 04 00 BitNo.
0 0 0 0 0 0 0 0 I 0 I 0 I 0
512 + 64 + 16 + I +
'I +597
Figure 4•2 1. Doto type INT variable . interpre ted as signed 16-bil integer.
Using the two 's complement melhod of representing negative values, data type INT uses bit-
15 l o represent the sign. A 'O' Indicates o positive value; o 'l' Indicates negative. The
remaining b its (0-14) hold the actual va lue. The two 's complement value o f any value is
oblained by inverting each bit from right-lo -left. bul only after lhe first ' 1• is detec led. This
m ethod is equivalent to inverting each bi t (i.e ., change ls to Os and Os to Is) then adding+ I.
. I '
15 14
.
13 12 11 I 10 09 08 07 06 05 . 04 03 02 . 01 . 00 Bil No.
0 0 0 0 0 0 0 I 0 1 0 I 0 t 0 I +597
' •
I 1 I I 1 1 1 0 1 0 1 0 1 0 1 I -597
Figure 4-22. Two' s Complement representation of data type INT negative number.
DINT
Variab les of data typ e DIN1 represent signed decim al integers in on S7 double word (32-bits).
The permissible range of DINT variables is -2. 147,483,648 lo +2. 147.483.647. DINT variables
should be used whenever the intended operations ore expected to exceed the range of
d ata type INT. An initial DINT constant is entered in a code b lock. data block. or as on input
value to an instruction. using the lo ng integer identifier 'l' (e.g.. L#500000).
Using the two 's complement melhod lo represen l negative values. DINT variables use b it-31
as the sign b i1. A ·o· in lhe si9n bit indicates a positive va lue: a ' 1' indicates negative. The
remaining 31 bils hold the value.
s I
I I I I
'
31 - 28 27 - 24 23-20 I 19 • 16 15 • 12 11 - 08 I 07 · 04 [ 03 - 00 [ Bil No.
203
STEP 7 in 7 Steps
REAL
Variables of d ata type REAL represe nt floating-point numbers (e.g .. 25.375). REAL varia bles
ore used to work with fractional numbers or to handle calculations or measured quontilies
that require llooting-poinl occurocy. lnlernolly, REAL variables ore represen ted in the IEEE 32-
bit llooling-poinl rormol. In this format. bits 0-22 represent the mantissa, or th e significant
digits of the number: and bits 23--30 represent the exponenf, o signed power o f 10. Bit-31
represents !he sign. where O' indicates o positive value and ' 1' indicates a negative value.
A REA L constan t is specified as the initial value tor a declared variable or as a cons tant input
lo an instruction. using the REAL notation shown below. This shorthand notation places the
first o t the significan t d ig its (non-zero) to the left of the decimal point a nd up lo six additiona l
significant digits to lhe right and preceding the exponent. An uppercase 'E' or lowercase 'e'
is valid. The number in the exponen t reflects the number of places the decimal point must b e
moved to th e left or righ t of the most-sig nificant digit, in order lo represent the o riginal value.
A positive exponent reflects o move to the right - o nega tive exponent o move to the teH.
--0.0000023
+0.00000000067 5
-2.3 e -06
6.75 e - 10
.- .001
.0001
1.0 E-3
1.0 E-4
DATE
A variable of data type DATE reserves a n S7 ward. lo represent a dale value as an unsigned
fixed-point number. Internally the time value is interpreted as o fixed-point number that
represents the total days since January 01, 1990. This IEC formal far specifying o dote uses the
identifier 'DATE #' or 'D'. and lhe year, month and day separated by hyphens (e.g..
DATE/#2002-08-22). Doto type DATE supports dates from January 1, 1990 through December
2168. This range or values is exp ressed DATE# 1990·01 -01 through DATElt2168- I 2-31.
TIME
Variables o f d ata typ e TIME reserve on S7 double word. Constants of data lype TIME ore
defined in units o f days (D), hours (H). minutes (M). seconds (S). and milliseconds (MS),
preceded by the identifier 'TIME' or 'T'. Unit identifiers may be entered as upper or
lowercase, and unneeded units may b e omitted (e.g., TIME# 10H30M). This IEC format for
specifying o lime value is intended for specifying o delay (e.g.. a 'wait time' in your STL
code). Both positive and negative Time values ore supported, with a range o f TIME#-
24d20h31m23s647ms lo TlME#+24D20H3 l M23S647MS. The internal representation of the lime
value is as o signed 32-bii fixed-point number, interpreted by STEP 7 as total milliseconds.
TIME_OF_DAY
A vorlable of doto type TIME_OF_DAY reserve on S7 double word. A TIME_OF_DAY constant Is
sp ecified using the identifier 'TIME_OF_DAY#' or 'TOD#' preceding the hours, minutes, and
seconds w hich ore separated by colons (e.g.. TOO#Ol : 15:00). Milliseconds may be added to
the lime using o period os lhe separator. or omitting it altogether. The internal representation
of th e TIME_O F_DAY time value is as o signed 32-blt fixed-point number, Interpreted by STEP 7
as total milliseconds.
204
Working With STEP 7 Programs a nd Doto
CHAR
A variab le of data type CHAR reserves o ne byle (8-bils) a nd rep resents a single ASCII
character. All printable characters including upper and lower cose a lphabe ts, numbers 0-9.
and some special characters are valid. An inilia l charac ter value is specified for variab les of
data type CHAR. by enclosing the character using apostrophes (e.g., ' Y' ). It is o lso possible
with the MOVE instructio n. to transfer either two or four charac ters enc losed in apostrophes,
lo a word or double word localion. The spec ia l choraclers listed in the following toble. are
entered using a specia l notation . (See ASCII c ha racter table in Appendix C ).
S5TIME
A variable of da ta type S5TIME is specified to represent a preset value for a timer. This 16-b il
format is the some as wha t was formerly used to store the STEP 5 timer preset. An initial S5TIME
value is enlered in units of hours (H). minules (M), seconds (SI, and milliseconds (MS}.
preceded by the dalo type identifier 'SSTIME#' or 'SST#' (e.g .. S5Tl/2H30M30S), The unit
identifiers may be in upper or lowercase. and un-needed units may be o mitted.
As described in detail under S7 Memory Areas. the internal format of the S5TIME data type
involves o single w ord encoded in lwo BCD ports. The time value. represenled in bils 00-11 of
the timer word, allows a BCD value from OOO-to-999; the time base. represented in bits 12- 15,
tokes on encoded va lues o f 0000, 0001 , 0010. and 001l. These values ore in lerpreled as .01
sec . . I sec, 1.0 sec.. or IO sec .. respeclively.
15 ,~ 13 12 11 10 09 08 07 06 05 04 03 02 01 00 nmer Word
0 0 0 I 0 I 0 0 0 I 0 1 0 1 TO
00 = .01 sec
01 = 0.l sec
205
STEP 7 in 7 Steps
REAL
DATE
=i 32
16
IEEE Floating Poin~
D# 1990-1-1-to- 0#'2168-12-31
CHAR 8 •
ASCII Character 'A'. 'B'. ·c·. 'D', and so o n
SST#Of-!_OM_OS_IOMS -to-
SSTIME 16 SS Time (I Oms)
SST# 2H_46M_30S_OMS
Note: Constan ts entered as binary. BCD count. or os unsig ned bytes all revert to Hex va lues
when declared, but may viewed in the desired forma t in the Monitor/Modify Variables tool.
STRING
A variable o f dote type STRING defines o string of up to 254 ASCII characters (CHAR). By
default. a character-stri ng reserves 256 bytes that allows for 254 c ha racters and a 2 byte
header. A string con be specified as STRING [n). where n d efines the maximum number of
characters (e.g .. STRING[6)) the variable can accommoda te . II no leng th is sp ecified , 256
characters ore reserved. An initial string is defined by enclosing the characters with
apostrophes. or p receded by the dolla r sign in the case of the special characters defined
under data type CHAR. The aclual storage requirement o f a string is. minimized by specifying
the exact number or charac ters (e.g .. string( 12]. with initial value 'System Ready') . 11 lhe Initial
siring is shor1er than the specified length then the actual length is reserve d .
206
Working With STEP 7 Programs a nd Doto
DATE_AND_TIME
Variables of data type DATE_A ND_TIME are comprised of the d ote and lime . When
specirying this variable in o doto block or os o static va riable in o functio n block (FB), on
initia l value is enlered using the identifier DATE_AND_TIME# or DT#, followed by the units of
yyyy-mm-dd:hh:mm:ss:ms (e.g., DT#2004:12-31 -23:59:59.999) , where milliseconds may be
omitted. Internally, this variable is stored in BCD formal using 8-bytes. Starting w ith the byte
(n), lhe variable contains the year (00-99). month (l -12.), day (1-31), hour (0-23). m inu le (0-
59) . second (0-59), millisecond (0-999). and finally th e weekday ( 1-7). w here Sunday is day I.
ARRAY
An array variable represents o fixed number o r data elements of the same do lo type (e .g ..
10 values of data type INT), that may include all dala types except parameter types. A n
array is declared as ARRAY [xl ..yl }, where the dimensio n limits xl and y l define the size of
lhe a rray. The index values may start al a negative integer. zero, or o positive integer (e.g.. (·
10.. 10). defines on orroy with 21 elements. Up lo six dimensions moy be declared by
separating each d imension by a comma. ARRAY (1..2, 1..6), defines a two-d imensio na l array
with 12 elements. The doto type of on orroy (e.g.. INT, DINT, or REAL), ls assigned on the
dec laratio n row immediately following the dec lara tion of the a rray name and size (Fig. 4-25).
lnittol values may be assigned to each array element by entering each value separa ted by
commas. The some value c on be assigned to consecu tive elements by enclosing the value
in parentheses preceded by o repetition factor (e.g .. 5( I 00). Elemen ts not assigned on initial
value will default to zero. An a rray element in a single d imension array is addressed in the
program os Nome [index) (e.g.. temp (4)). The full indices must be used when specifying on
a rray element in o m ulti-dimensional array. Given the two-dimensional array ·ARRAY [ 1..3,
1..4] .' the firs I element is addressed Nome [ 1, l ]; the lhird element is addressed Nome (1.3];
the fo urth element is addressed Nome (2, l J; and the last element is addressed Name [3.4).
STRUCT
A variable o f dola type STRUCT is represents a structure with a fixed number of elemen ts that
m ay invo lve any combinati on of other data types. In the declaration table, the STRUCT
variable includes the data e lements enclosed between the keywords STRUCT and
END_STRUCT as shown In the figure below. Stru ctures may be defined either in the variable
decla ratio n of the logic b lock or in o data block. The individual elements of the structure
may be accessed using the structure name ond the variable element name separated by a
p eriod (e .g ., Reclpe_A.Sys_Rdy).
207
STEP 7 in 7 Steps
I ID!ff 4il§t'tillit,iilmtl4111L.-r::
lddre•• If.- Tne I:nit:Lal value Cc 11: at
0.0 S'IRUCT
+0 . 0 Recipe_A S'IIUICT Stai:t Recipe A; St.z :uctuLe LJ
+o.o Sy$_Rdy BOOL FALSE Element~~ Recipe . Sy:,_Rdy
+2.0 Ingred l IJIT 1500 Element == Recipe. lngced_l
+4.0 lngred_2 REAL 1.502345e+002 Element •e Recipe.Ingred_2
-t-8.0 Stop:, All.RAY(l.,10] 10 (FALSE) End Recipe A; Sttuctuce
"0 . l BOOL
•10.0
◄
-
END S'rnUCT
- l□t~
Jddress lfalle Tn,)e IAitial value Coa111ent
o.o STRUCT
+o . o Loop_lfo IJORD lJ#l6#1 Loop NUil.bee
+2.0 PV REAL O.OOOOOOe+OOO Process Input Vatial:lle
+6.0 SP REAL 5. soooooe+002 Setpoint. _J
+10.0 UL REAL 6.750000e+002 Upper Limit Alarm
+14. 0 LL REAL 6. 550000e+002 Lo~er Limit. Alarm
+18. CTRL IJORD 1Jf16eO Cont.col lolocd
=20.0 l!lID STRUCT ...
◄
Figure 4-27. A UDT (User-Defined Type) is c reated from the SIMATIC Manager.
208
Working With STEP 7 Programs a nd Doto
Introduction
The LAD/FBD/STL editor may be started from the Windows Slort Menu or from inside the
SIMATIC Manager. Aller a block is genera fed in fhe offllne b locks folder of a program.
double clicking on the b lock launches the editor and opens the b lock in its own win dow.
Once developed, a block may be copied to o fher STEP 7 programs or projects. and
d ownloaded to the CPU. Each block con be checked for correct operation, using several
monitoring and debugging tools (See following c hap ter). Once created and downloaded.
the status of any b lock may b e open a nd viewed onfine. showing th e status of opera ling
values.
/ Tl Proaramrn no Ed1tor
Table 4-9. LAD/ FBDS . c ore Toolbar Buttons.
[!] Save
-
I§• Insert New Network
-
1~1,1 Compile SCL Text [into block)
-
[I8 Insert Normally-Open Contacl
...00 00
Cut Selected Obiect Insert Normally-Closed Confac t
ii]
->
Download lo PLC
-
~ l
Close Parallel Branch (LAD)
209
STEP 7 in 7 Steps
PretSFl ~OO(Ho'I>.
Figure 4-28 fa ) Left-Docking with Program (b) Un-Docked window with Coll Structure
Elements tab selected . tab selected.
The Coll Struc ture lob. when selec ted. conta ins o tree-like struc ture o r the colling hierarchy of
lhe o pen program. The coll structure shows the called blocks and lhe re la tionships between
each and ifs colling block. Each bloc k in the project is listed a t the for lett. with OBs b eing
leH-mos t. Th e b locks called from each OB are indented underneath ii is a list of the b locks
lhot ii con call or use. Blocks which ore not called from a nywhere in the program ore shown
a l the bottom of the coll structure and marked with a b lo c k c ross. When you click on the plus
(+) symbol. the lower structures of the coll hierarc hy are expanded and displayed. When you
click o n the minus (·) symbol. lhe lower structures of the coll hierarchy ore collapsed and no
lo nger displa yed. With o block selected. from the right-click. you may na vigate d irectly lo
the b lock or lo lhe location from which the b lock is called_
210
Working With STEP 7 Programs a nd Doto
Block Window
Each b lock is opened In its own window. You may orrange the open windows in a horizontal,
verlical or cascaded layout. As seen in the figure below, each b lock window consists of a
variable declaration pone and a code pone. where the ocluol program code is w ritten. If
lhe block is new, lo begin writing code, simply click inside the p one a t the first network; for
existing b locks that you wish to edit, find and select the network you w ish to edit. You may
open as many b locks as you like, and must select lhe specific b lock you wish to work w ith.
While a block is open. you may copy any block element (e.g .. Network Tille, Network
Comment. Network Logic . e tc .) and paste it to the some or to a different b lock.
LAD !irL 1W fU
= 'b r,;i&M;,..
<I! Ei) "' ""'
1-tit•ftot
ltJ 0, ltl
tJ WGc~ ~ 'i! OC,JJ
-;i~tt:~1
i-t-0- ltf_CU'I
·ij ti.I"""'
!.ti fill IC•C-l l
1-1 ti- ro,1
~ ORCT..Ffj
Zf!!iJ' )._~
:J! [D lri'"P' f.1-.1>.11
<jlli:il
t:I ~
""'n""'"
n,.,._
It<
rn 1 o u01 n aJ!t r «-t 1JUJtt."On.111ru,,
• •
...........,
.··-·-~······
.ii S, ~,..,.w m.1
,~ li,i 9 . .......
aetw rl. 1!' 1 txca,le1 lf!tli!,1 aie er Dd~
.......... Th1.ct - e, ~ ~~ :>;--~! !. .u:11cle U:,1.r,, .ldd!:c,e P.:!il t111=e t -!~ De
*fill~•
;ti ~ !...-. l•I , l
liW _,.,, , •• , 1'0$ I 00.1
~ CC
'Ii-I ia GI """'
1--- · ~ - - - - - 1 ( ) , -l
t.o,s
ffi IJ;3 9'101:1:h
~!Ki,,,.,
1:U t,U , • - ll~~rt I
l II "~ t"f.:~
"'•"'-
Details Window
The Details window is opened from the menu by selecting View Details and hidden by again
selecting the Details option from the View menu. The Details window allows you to select any
one of seven views. b y selecting lhe Error. Info. Cross-Re ference. Address Info. Modify,
Diagn ostics. or Comparison tab.
Each tab provides a different service lhot enhances working with the open block. The cross-
reference tab. tor instance, lets you see in whol other networks or blocks ore lhe addresses of
the c urrent network located. The comparison tab is used in conjunction with the block
compare function. When the results o f a compare opera tion ore determined. lhe compared
blocks ore shown in two windows and the found differences lis ted on the comparison lob.
211
STEP 7 in 7 Steps
Normolly-Open Input Examine the reterence<l address for o logic 1 5latus. A status
Conto ct of logic I ollows loglc conlinui1y; logic Olntem.ip ts continuity.
?? . ? ?? .? I
-II-
Normally-Closed Negote Input Exomine the referenced address for o logic Ostatus. A status
Contact o f logic O allows logic continuity: logle I interrupls con tinuity.
.,., ..')
~
??. ? --01
-VI-
.,, ,
Set Output Set Output
??.?
If the result of the logic operotion (RLO) preceding the
referenced output tronsltlons from logic I -to- logic O. then
......:.(s5- ??.?-__:_J assign logic I to the oddress, Remain al logic I unlit reset.
Reset Output Reset Output When the result ol loglc operolions (RLO) p(eceding the
,, ?
??. ? referenced output transitions from logic I -to- logic 0, then
- (R} - assign logic O lo lhe oddress, Remain al logic O until set ogoin.
??. ? - ~
Invert RLO Negate RLO Invert the RLO (result of logic operation} status at the point at
- l rroT ~ which the instruction Is Inserted (i.e.. logic O -lo- logic I:
--0 logic I -to· logic OJ.
Note; In FBD, the Negate opera tion performs the same func tion as the NC contact in LAD.
The Negate in FBD also serves lhe some function as the NOT operation in LAD (i.e.. lo invert
lhe RLO or power flow ot lhe poinl of insertion.
212
Working With STEP 7 Programs and Doto
Positive RLO Detects 0-l o•1 transi tion resulting from the preceding
Edge Defection Edge Detection logic operation [RLOI, An edge defection is signaled by
??.? ??. ?
the oulput going high for one CPU scon /single pulse).
~
(P} - f'
??. ? -
Negative RLO Negative RLO Detects 1-to-O transition resulting from the preceding
Edge Detection Edge Detection logic operation [RLOI, An edge detection is signaled by
..,., ,
.. .. ??. ?
lhe output going high for one CPU scon /single pulsel,
~
(N}- II
? ?. ?-
... - S . .. - s 0 -
Address Negolive Address Negolive Detect a negolive-edge transition o f o specific bil
Edge Detec tion
??. ?
Edge Detection ~,,
.. .. address. An edge de tection is signaled by the output
IIEO going high for one CPU scan (single pulse).
HE-0
ol ??. ?- M BIT
- Q~
Add1ess Positive
r Address Positive Detects o poillive-edge lronsllion of a specific bit
Edge Detection Edge Detection address. An edge delecllon 1s signaled by the output
??.?
POS
0 ~
?1,?
??. ?- M BIT
POS
Q
t going high for one CPU scan (single pvtse).
??. ?- II_B rT
213
STEP 7 in 7 Steps
Counter Instructions
The counter instructions include the Up counter, the Down counter. and the Up/Down
coun ter, whic h counts both up a nd down. The UP and Down counters ore implemented both
os box functions and os ou tput instructions. Box counter functions support the full funclionolity
of th e counter in o single instruction. a llowing the counter to be triggered, o prese t value
loaded. monitored. and reset. Th e UP and Down counter output opera tio ns simply support
counting. Separate instructions would be used to food o preset, or to reset o counter ou tput.
The compare operation would be used to check the current count value.
Each counter you specify, numbered CO, Cl, C2, and so on, will reference o single word in
the counter memory area. The exact number o f counters ovo~obte is CPU-dependent.
UP Counter Coil UP Coun ter Output Whenever the driving logic tronsitions from logic O-to-
?? ., ??? logic 1, increment the specified counter by one count.
-(cu)- ??. ?- ~
DOWN Counter Coil DOWN Counter Whenever the driving logic transitions from logic O-to-
??? ??'! logic I . decrement the specified counter by one count.
- (co)- ??. ?-
CD
I
UP Coun ter UP Cout1ter Whenever the toglc lnpul line CU tronslllons from logic 0-
??? ??? lo- logic 1. increment the specined counter by one
5_CU I s_co count. Logic l on the reset inpu1 line R resets the counter
- CU Or - cu lo zero .
-S CVr -s CV -
=~ CV_BCD r
- PVCV_BCD
-R
-
0-
Down Cout1ter Down Counter Whenever the logic input line CO tronsitions from logic O -
??? ??? lo- logic 1, decrement the specified counler by one
-CD
S_ CI)
o
I - CD
s_co count. Logic 1 on the reset lnpul line R rese ts lhe coun ler
to zero.
-S t:V1
r -s CV -
- PVCV BCD -
-~ - R 0 -
UP-Down Counter UP-Down Counter For eoch loglc O-to- logic I tronsilion on the cu lnpul
??? '1?? fine. increment the specified counter by +I: tor each
s_cuo s_cuo
-CU 0
- - cu
logic O to- logic 1 transition on 1he CO lnpot line.
decrement the co11nt by+ I. Lo.g ic 1 on lhe reset Input
- CD CV - - CD line R resets the counter to i;ero.
~ s CV_BCD - -s CV -
- IV
- -
- PVCV BCD
- R. -R 0 -
214
Working With STEP 7 Programs and Doto
Timer Instructions
STEP 7 timers, ore based upon the STEP 5 implementation of timers, and os such ore referred
to as SS Timers. The instruction set includes five timer types. each o f w hich is implemented a s
o box function a nd a s o simple ou tp ut instruc tion. Bo x timers support the fu ll func lion otity of
the timer in o single instruc tion, a llowing lhe timer to be loaded with o p reset value, started ,
reset. a n d monitored. Timer ou tputs simply a llow a specific timer type to be started with a
give n preset value. Separa te instruc tio n s ore used to reset or monitor th e timer' s opera tion.
Ea c h timer you specify. numbered TO, Tl . T2. and so on. will reference o single word in the
timer memory area. The exact number o f timers available is CPU-dependent.
.,,,
ON-Deloy Timer ON-Deloy Timer
???
When lhe enoble input s tronsillons horn 0 -lo• I, lhe fim ei
s_oi>i- I s_o~t
storts timing ond continues lo lime unless lhe enable goes
raise or lhe reset input R transitions lrom O-lo• 1. The oulpul
- S o -s 81 -
BIi1
Q is o ctivo led ofter lhe p reset l ime hos elop$8d. ond sta ys
~ 'IV - 'Ill BCD - energized until lhe enable slgnol lronsllfons from I -lo- Oor
the timer is reset.
-R BCD r -R 0 -
OFF-Deloy Timer When the enable input s transitions from 0 -lo- I , the tlmet
,,, OFF-Deloy Timer
7,, output Q is octivotod. The timer storts ttming when the
I
-~ S_Off OT
or -s
$_0FFOT
-Bl
enoble signol S transitions from l -to- 0. The timer win run unto
the programmed delay expires, unless the reset slgnol R
-TV Bir - T\I BCD - transitions tromO-to- I . After the limed delay expires. the
timer oulpl.Jt Q Is de-activated. The output Q is also de-
- R BCD r -R 0- oc tivoted whenever the 1lmer is reset.
Retentive Re tentive When lhe enoble input S lronsitlons from O•lo - I . lhe timer
ON-Deloy Timer ON -Delo y Timer starts liming ond conlinues lo lime and continues to lime
1?? 'J')?
even ii lhe enable signol S lronsilions from I •to• O. If lhe
s_o1>rs I S_OOTS
enoble signal c hanges bock lo · l' before the timer expires.
-5 or -s BI - the ti mer wilt restart. The outpu t Q is o cllvoted oiler l he
- 'TV BIi -TV BCD - preset lime hos elapsed , ond remains o clivoled until the
timer is reset.
- R llCD r •R 0 -
Pulse n mer Pulse Timer When 1he enoblei nput S lransiliot'ls from O-1o• 1. l he timer
??? ??? starts timing and continues lo lime for os long os the S Input
s_PULSE I s.PULSE is ' I ·• or unm lhe pro91ommed detoy expires. WhDe the timer
-S 0 -s BI - isrunning. the oulput Q is octivotect for as long os the
enable signol S is octivoled. If the enable signol S returns to
- 'IV BI ~ - TV 8C1) - ·o· before the timer el(pi(es. the1imer ls stopped and lhe
output Q ls de-oclivo ted. Whfle the timer ls running. o
- R BCD r -R 0 - frohsifion from O-to- I on lhe reset fine Rresels1he timer.
Extended Extended When lhe enable input S tronsitlons fro m O-lo - I . lhe llmer
Pulse n mer starts timing ond con tinues to time until the programmed
,,, Pulse Timer
? ?? delo y expires, even if the inpu t S returns to 'O'. The output Q
s.PEXT
- !! or J
-s
S.f'EXT
BI - is oc livoled whenever lhe tim er isrunning. While lhe timer is
running. o transition from O-to- I on the reset line R resets
-TV BIi - TV BCD - the timer.
-R BCDr -R 0 -
215
STEP 7 in 7 Steps
Conversion Instructions
A conversion operotion changes the fo rmal or data type of a variable to a new format or
data type - generally before the dolo is further used. For instance, o value inpu t as BCD
must be converted before use in on integer arithmetic operation. Conversely. if the integer
resul t must be o utpu t to o BCD d isplay, then the value would need to be converted to BCD.
II on arithmetic or comparison is to be pertormed on the data stored in two locations. the
variables must be of the some data type or format to ovoid erroneous resul ts. Furthermore.
since STEP 7 a rithmetic opera lions ore only performed on integer. double integer or real
numbers. a variable not of these data types would require the appropriate conversio n.
Conversion operations include conversions for variables of data type INT (integer) and DINT
(double integer) variables. BCD numbers. a nd REAL numbers. There are a lso four opera tions
for converting a REAL number to DINT formal by rounding. These four operations differ in how
the number is rounded w ith respect to the fractional port of the floating-point number.
Integer lo
Double Integer Integer to
DJ
I DI
ElfO
I Double Integer When EN is al logic l . convert tho 16-bit INT value supplied
1_01 o l IN lo o 32-bil DINT value. Put the result in lhe location
• .. - £11 Otrr ....??7
???-DI OlfT ~???
specified al OUT.
??? - I l l EllO
--
BCD to BCD to
Double lnleger Double Integer
ec1>_1>1 I BCl>_DI
When EN is ot logfc 1, convert the 7-digil BCD valve
"Wpplied ot IN lo o 32-bit DINT value. Put the resvll in the
EN ENO ... - a 01.rr ,-777
lacotloo specified al OUT.
???- Ill OUT~??? ??? - Ill EIIO ....
Double Integer Double Integer lo
to BCD BCD
QI_BCO I C>J_PCD
When EN is at logic 1. convert lhe 32-bit DINT value
supplied ot IN to a 7•digit BCD value. Put lhe result in lhe
£If EJIO ' .. - !Ji our ....??? location $pacified 01OUT.
???-111 Otrr~??? ??? - !Ji ENO ...
Double Integer Double Integer
to REAL to REAL
Whe!'l EN is ol logic 1. convert lheJ2•bil DINT value
£If
DI.JI
£NO
I ... -Df
DI_R
OIIT ._???
supplied o t IN loo REAL value trtooling-pointj. Put the
result in lhe location specifled o t OUT.
??? -IN OUT ~??? ??? - 11l ERO ...
Note: When EN is' 1' ENO will also be • 1· except on error: then w hile EN is' l '; ENO is 'O'.
216
Working With STEP 7 Programs a nd Doto
EJJ
11110_ 11
EIIO
I ... -
IIEG_ R
Ell OUT ~ ? ? ?
When EN is al logic l . negate the REAL value supplied
at IN (posilive-to-negolive. negative-to-positive). Put
!he result in the location specified ot OUT.
???-IJI OUTl??? ??? - DJ EJIO ...
Round lo Round to
Double Integer Double Integer When EN Is al logic 1, convert the REAL value
ROUrlO I ROUND supplied al IN to Integer by Rounding lo nearest
Ill E110 ... - E!J OUT ~? ?? Double lntege< value. Pvl the resull In the location
speclfled al OUT.
???-DI ourl??? ??? - m DIO ...
Truncate Trunco le
Double Integer Po/I Double Integer Port When EN is of logic I, convert lhe REAL value
l:fl
TRUIIC
ENO
I . .. - EJJ
TIIOIIC
OUT --???
supplied ot IN lo Integer by Truncating the fractlonol
port of the REAL volue. Put the resul t in the locolion
specified ol OUT.
•??- IJI OIITl ??? ??? - !ll !110 ...
Celling lo Ceiling lo
Double lnleger Double Integer When EN is ol logic I. convert the RfAL value
EH
Cl'll
!VO
I ... - EN
CEIL
OUT r--???
supplied al IN lo DINT 1/0lue by Rounding lo lowesl
DINT value greoter•lhon-or•equct lo IN. Put the resull
In the loco lion specified al OUT.
77?- lll OIJTk777 ??? -IN ENO ...
Floor to Floor to
Double In teger Double Integer When EN is at logic I. convert !he REAL value
Ell
FLOOR
E:110
I fUJOR
our - ???
supplied a l IN lo DINT value by Rounding to hig hest
.. • - EN DINT value tess-lhon-or-eQuol to IN. Pul lhe result In
the location specified a l OUT.
??? - I ll OUTl ??? ??? - IM !NO -
Note: Wh en EN is •1• ENO will also be ' l ' except on error: then while EN is • 1·; ENO is ·o•.
217
STEP 7 in 7 Steps
Ari thmetic opera tions ore performed o n the values specified ot INl and IN2, p lacing th e
resull I lhe loca tion specified at OUT. The orilhmelic operation is a lways relative to IN l (e.g.,
DIV_R; IN 1divided by IN2). A cceptable values. as shown below, include constants within the
valid range, the con ten ts of absolute memory locations, or declared variables of the correct
data type. If absolute memory locations ore supplied, the correct memory wid th must be
specified (i.e.. word. double word). In any case. the contents of the specified memory
localions or variables must be of the correct data type and fall within th e permissible range.
Tobte 4- 17. Exomote LAD/ FBD tnteaer, Double lnteaer. and REAL Addihon lnslruc tions.
IN1/IN2/0UT INT DINT REAL
I I
- -,!11
A00 j
-i:wo --Elf
ADO_DI
&I/Or - -EN
Al>D_R
.ENO
IW 28 1D 28 ID 28
S7 Memo,y Locations Q W42 QD42 QD42
(Absolu te or Symbotrc) MW 54 MD54 MD54
DB6.0BW l2 D86.DBDl2 DB6.DBDl2
Note: Wh en EN is' 1' ENO wilt also be ' I ' except on error: then while EN is' 1'; ENO is 'O'.
218
Working With STEP 7 Programs a nd Doto
In addition to the fou r bosic a ri th metic opera tions. the STEP 7 instruc tion sets include standord
ma the m atical function s, as listed in the ta b le below. These operations in c lude functions for
finding angle ond rodion measurement. absolute value. squa re root. square of o number.
na tura l tog of o number. and finally. o function to determine l he exponent of o number wi lh
a rad ix of base e. In th e STEP 7 p rogramming software , t hese o p eration s ore lo cated in the
floating-point folder of th e Program Elements lob.
Tobie 4-18. LA D/FBD: Standard Math Functions {REAL numberaoera tio ns).
LAD/ FBD Name Brief DescrlpHon
SIU I Sine When lhe EN signol is ot logic 1. find lhe Sine of lhe REAL volue
EN mor. (rodion angle) supplied at IN . Pu t the resulf in location
specified ol OUT.
???-IH OUT r???
cos I Cosine When the EN signor is o f logic 1, find the Cosine or the Ri:AL
EH l:NOr/ value (rodiao o ngle) supplled o l IN. Pul result in locotlon
specified o t OUT.
??? - IH OUT,???
TA U I Tongenl When the EN signol is ot logic 1, find the Tangent o f the REAL
!!l
ENOr value (radian a ngle) supplied a l IN. Put the resull in location
specified al OUT.
???- Ill our ,111
AS1~ I Arc Sine When the EN signal is a l logic 1, find the Arc Sine of lhe v alue
EJl ENOr. supplied o t IN (- 1 to+ I J. Put ongle result jrodiansJ In tocolion
specified ot OUT,
???-W OIJT ,???
ACOS I Arc Cosine When lhe EN signal is al logic 1. find the Arc Cosine of the
EN l:NOr/ value supplied at IN (-1 to + I ). Put ongle resull [radio ns) in
location specified o t OUT.
??? - J'N OUT,???
A TA U I Arc Tongent When the EN signal is ot logic 1, tind the Arc Tangent of the
tlJ ENO r✓ value supp lied a t IN. Put angle resull (rodianstin locolion
specified a l OUT,
??? - lll OIJT r ???
Absolute When the EN signal is at logic 1, find the Absolute Va lue of the
tlJ ABS ENOI Volue volue supplied o l IN. Put the resull in location specified o t OUT.
SORT I Square Root When the EN signal is at logic 1. find the Square Rool o t the
EW ENOr value supp lled a t IN. Pul lhe result in loca1ion specified a t OUT.
$OR I Squore When the EN signal is ot logic 1, lind !he Squore of the value
EW tNOr supplied ot IN. Put the result in location specified ot OUT.
Noturol LOG When the EN signol is ol logic 1. find the Nolurol Log of the
tN LIi ENOr votue supplied a l IN . Pul the result in location specified a t
OUT.
???-IN our r~?
EXP I Exponent When the EN signal is at logic I. find lhe Exponent of the v alue
llJ !:NO r✓ supplied at IN. Pu t lhe result in location specified at OUT.
219
STEP 7 in 7 Steps
Compare Instructions
STEP 7 compare Instruc tions a llow compa rison o f integer (INT). d ouble-integer (DINT). and
REAL (floating-point) values. There ore six compare typ es. each of w hich may be performed
using each o f the three numeric data types (i.e .• tNT. DINT. REAL). Th e c o mpare tests inc lude
equa l. not equal. less fhan . greater than. less than-or-equal. and greater- than-or-equal.
Compare opera tions o re often used fo r range chec king . set point c ontrol, or limit checks on
calculations.
Comparisons allow decisions b ased on the o utcome of the specified compa rison o f the
va lues input at INl and IN2. The compare test is always rela tive to INI (e .g., CMP>I; IN I > IN21.
Accepta ble values, as shown below, inc lude constan ts within the valid range o f the data
type. the contents o f a bsolule memory locatio ns. or tocol varia bles decla red in a code
b lock. ti absolute me mory locations ore supplied as the inp ut va lues, then lhe correct
memory wid th must be specified (i.e .. word. doub le word). In a ny case. the c ompared
va lues must fo ll within the permissible number range of the data typ e being compa red .
. . amoe
Ta b le 420Ex I LAD/ FBD In teoer, D OU bl e In Ieoer. an d REA L C om oare E:QUO I Instrue f,ons.
IN1 /IN2 INT DINT IEAL
CtAP -1
I_ Cr,IF>.,. I>
I CUP - R
???- Dll
'-
??? - lNi! ?? ? j l112 ???-lll2
IW 28 ID 2a ID28
S7 Mem O()' locotions QW 42 QD42 QD42
(Absolute or Symbolic) M W 54 MDS4 MD54
DB6.0BWl2 DB6.DBDl2 OB6.DBDl2
220
Working With STEP 7 Programs and Doto
In both the LAD ond fSD instruction browser. the Jump o nd Lobel instructions ore grouped
with so-called " Jumps" operations; Moster Control Relay, Call. and Return instructions ore all
grouped with ''Progra m Control'' operolions; and Open DB Coil. is under "DB Coll." For the
purposes of our d iscussions, all o f these instructions ore grouped together os "Program Flow
Control Instructions."
~
block jump is direcled lo the oolwork identified by the label
-(JMl'N}- address specified above the JMPN output.
??. , _
MCR Activate MCR Acllvole This uncondilionol output. when encountered. enables the use
- ( MCRA}- !IICRA of MCR zones up lo the poinl of the next MCR Oe-octivate
I instruction. Paired wilt, MCRD inslruction,
MCR Oe-Aclivote MCR De-Activate This uncondjtlonal aujout. when encountered, disables the use
- (MCRD }- MCRI> of MCR zones up lo the polnl ol lhe next MCR Activate
I instruction. Paired with MCRA instruction.
MCR ON MCR ON This t;Qnditlonol output, when activated by the driving 1ogic.
- (MCR<}- ,, ,_
. . .. \
MCR<
I
begins on MCR zone- Paired with MCR•OFF (EndJ instruction,
MCR OFF MCR OFF This unconditional output. when encountered. ends on MCR
- .( l'ICR> }-
_::_J zone. PoireO with MCR-ON (Begin) instrucHon.
.,., ,
Coll Block Coil Coll Block ,,, When the driving logic [conditional or unconditionol} is at logic
l, lhe referenced Function fFCJ Of System Funclion (SFC).
- (c·A-LL}-
• • •- ~~L I having no formal porometers. is called for proces.slng_
,,,
Open Dalo Block Open Doto Block
???
When this uncondilionol lnsfruction Is encounleted, the shared
doto block (OB) referenced above the instruclion is opened.
-( oi>i1)- OPII
I allowing data access to !he doto localions.
Return Coit Return Output When the condllionol loglc driving this output is !rue. execvtfon
- (RE"r)- ,, ,_
- - ..
RET
1
of the cu1Tent block is terminaied and control is.returned to the
colling block; otherwise continue with the following network_
221
STEP 7 in 7 Steps
In LAD, these inslruclions ore implemented as no rma lly-open and normally-c losed contacts
!hot may be cornbined wi th o tt1er instructions. Just as the standard NC contact allows an
inverse conditio n l o be examined. use of the normally-closed status bit instructions allow you
to check !he inverse co nd ition of each status b it. For example. w he n the normally-closed
con ic.ct of the "result b it greater than zero," is used o zero status wilt allow power now
through the contact. In FBD these instructio ns ore available with positive evaluation only. You
may combine these instructions with the ·negate RLO' instruction to examine for the inverse
status bit result. Status bit opera tions may a lso be combined with other bit opera tions.
Tobie 4-22. LAD: Status Bil {Result Bits) Ins tructions Summarv.
LAD lnstrucllons
Name Brief Description
NO NC
BR BR Slnory Result Bil Use 1he NO contocl to check the SR bfl for logic l to ollow
- I t- -VI- power flow: use NC BR bit to check for logic Oto allow power
Row.
>O >O Greoter Thon Zero Check result of previous moth operotion for greoter Ihon
- I I- -Vl- Result Bil zero.
<0 <0 Less Thon Zero Check result ot previous moth operation for less than zero.
-I t- -VJ- Result Bil Combine fn series or porollel with other conlocts.
::>eO >~O Greeter Thon Check resull or previous moth operation for greoter-thon-or-
- I t- - V}- or Equal Zero equal zero.
Result Bil
<•0 <•0 Less Thon Check result of previo11s moth operation for less lhon or equal
-I I- -Ill- or Equol Zero zero.
Result Bit
==O ==O Equol Ze10 Check result of previous moth operation for equal zero.
- I t- -l/1- Result Bil
<>O 00 Not Equol Zero Check result of previous moth opero1ion for not equal zero.
-I t- -J,/j- Result Bil
Note: These some instructions imple me nted in FBD a re represented in a box. In STL. these
operations ore implemented as Jump instructions (i.e .. jump to label). allowing internal block
jumps based on the sta tus result bits.
222
Working With STEP 7 Programs a nd Doto
? ?? - INl OUT ~ ? ? ?
Ell
WOR w
ENO
I ' ... -
WOR_W
£11
logical OR on ihe two 16-b1t values supplied ot
(IN1/ IN2), Put resull in llie location specified at OUT.
Exclusive OR Word Exclusive OR Word When the EN signal is al logic 1. perform a bil-by-bit
I logical XOR on the two 16-bit values supplied at
WXOR
.ED :tNOr
w
... -
WXOR_W
!:II (IN1 / IN2). Put result in the location specified at OUT .
AND Double-Word AND Double-Word When lhe EN signal is ot logic 1, perfom, obit-by-bi t
WANO_DW 1 WAIID_l)VI/ lQgical AND on the two 32-bit values suppUed at
!:II !NO ;, .. ' -tll (IN 1/IN2 1. Pul result In the location specified al OUT.
Exclu~ive OR Double• Exclusive OR Double- When the EN signal is a1 logic 1. perform a bit-by-bit
Word word toglcol XOR on the two 32-bil values supplied ol
wx,oR_ow
!:11 ENO 7
I .. , -Ell
w;x.oR_ow (IN1 / IN2). Pu! result In the location specified at OUT.
??? -Illl
= ~???
??? - Ill2 ??? -Dl2
Note: Wh en EN is' 1' ENO will also b e ' 1' except on error: then w hile EN is' 1' ; ENO is 'O'.
223
STEP 7 in 7 Steps
The move operation copies data from one memory location lo another, leaving the source
unchanged. Often. data is moved too new locofion either prior to performing on opera tion
or just ofter on operation hos been performed. in order to preserve the doto. Changing a
timer prese t, a process set point, or saving and stacking data for transfer to another device.
all ore coses where move operations might be used.
Shift Right Word Shift the 16-bils of the Word specified ot IN, by n-bils to the
righl.
s~i_plli' Shift Left Shift the 32-bits of the specified Double-Word, by n-bits to
- !ll ll'IO
Double Word the lefi.
???- ti
l
- EN !I Xlr ROt_,OW Rotate Lefl
Double Word
Rotate the 32-bits of the Double-Word specified ol IN. by
n-bils lo the left.
??? - Iii 011T r ???
???-! _ ]
- ED
S~R.I
mo
I Shilt Right Integer Shift the 16-bils bits of l he Integer value specified ot IN. by
n-blts lo the right. while mointolnlng lhe sign bll.
?n - tu o]urj ???
'!?"! - 11
Shilt Right Shift the 32-bits of the Double Integer value specified ol IN.
Double Integer by n-bits to lhe right, while mointoinlng sign bil.
224
Working With STEP 7 Programs and Doto
In the remainder of this c hapter. examples of develop ing blocks and using the STEP 7
programming Instructions ore presen ted in o step -by-step manner. Regardless of the size of
your control task, you con accomplish the required tasks by b reaking the job into smaller
tosks. The following checklisl wm aid in this regard a s well as in highlighting major
development steps.
• Specify one or more blocks (I.e .. FCs, FB.s, etc.) to handle each subtask.
• Determine da ta block required by eoch block (i.e .. global D&. instance D&J.
• Develop code blocks, creating con fro/ logic for each task (i.e., each device
or operation}.
• Determine /he processing requirement {how often ond from which 08) of
each block (i.e., start-up only, cyclical, periodic in teNol, on interrup t, error
reaclion, etc.).
• Downfoad and test each block separately by ca/ling the block from OB I.
225
STEP 7 in 7 Steps
Essential Elements
To c reole o symbol address is to assig n o meaningful name (24-characters max.) as o
substitute for on a b solute a d dress. Yo u may a ssig n globa l symbo ls to all S7 memory area s
(See Tobie 4-5) includ ing Inputs (1), Outp u1s (Q). Bit Memory (M). n mers (T), Counters (C),
Peripheral Inputs (Pl). and Peripheral Outpu ts (PQ) . Addresses assigned from these a reas may
include b it. byte. word. and d ouble word locations. Symb o l add resses may also be a ssig ned
lo c ode S7 blocks (e.g .. FB. FC, OB, SFC. and DB). You may assign symbolic a ddresses lo
blocks in the symbo l ed itor or in the b lock p roperties d ialog when the b lock is first c reeled or
lo ter.
Application Tips
Symbol a ddresses are on add itio na l aid in viewing a nd und erstanding your program. The
ed itor c a n be started from the SIMA TI C Manager. by d ouble-clic king o n the Symbo l Table
objec t from the LAD/ FBD/STL editor menu: or from w ithin the Mo nitor/Modify tool. while
editing a Va riable Table (VAT). For fast entry of symbolic names for 1/0 mo dule a ddresses.
consider entering these from the Hardware Configuro lion tool os you insert each module.
M,li@1%4!-\Hi1i•.P•i-il#f41 1fi,j,jnftB4!t!l(!kjlwi,@u\.:llli
Symbol Table Edi; fnseft View Options Window Help
Figure 4·30. STEP 7 Symbol Ed itor. for assigning symbolic labels to S7 memory addresses.
226
Working With STEP 7 Programs a nd Doto
ACTION
1 From the SIMATIC Monager, open the correct the project and select the Program in
which you wish lo creole new or edil existing global symbols.
2 With an S7 Program folder selected, from the right pane o f the project window
double c lick on the Symbols object. or right click on the object and select Open
Object. The symbol tab le is presented like a spreadsheet, with a column tor Symbol,
Address, Data Type , and a Comment.
3 Click in the Symbol field and enter up lo 24 characters for the symbolic name: click
in the Address field and enter the a ssocia ted absolute address: click in the
Comment field and enler a descripllve comment of up to BO-c haracters. The dala
type of each absolute address is a utomatically inserted.
When done wilh entering symbolic addresses. from the menu selec t Symbol Table ►
Close.
227
STEP 7 in 7 Steps
Essential Elements
Doto blocks ore comprised ol lwo sections; lhe block header, and variable declara tion.
When you generate o DB, the header dialog allows you to define attributes of the doto
block, including whether it should be on Instance or Shored DB. Once o shored DB is
generated, you may open the block to define and initialize the data elements. When you
create on insta nce DB you will simply assign ii to on olreody existing FB.
Application Tips
Each FB you create will require an instance DB. You should c reole the FB and define the
declorollon tobte before creotlng the instance DB. When the Instance DB is crea ted and
a ssigned to on existing FB, the structure of the declo rotion oreo of the FB (i.e., static voriobtes.
and fo rm al parameters only), is wrilten to the instance DB. In this way. the static variables and
the actua l parameters ore stored in the DB on each instance the FB is called.
DI ~11 7.-,IIWI 1
fe' ~, A.A.1:-~h::: rm uJ! 1<Nor.te, ,
:;, ., 1-:'
•I
- 0 X
S11>t<m dblo
o7 Oloct ► 1 o,,pi,4tion 81ock
I ZRr.clic,,Block
J fU'lc110!1
S,,"llt<:I f~le
f.·mnoL:,ou,~
Soata Type
, ~ SIMATIC300(21 6 vi.ll:l:llo Table
~ SIMATIC 300(31
l.l
I
Cgm0>!11t
~
OK I
Fig ure 4-32. Dalo Block General Properties Port-I: Shared DB Selec ted.
228
Working With STEP 7 Programs a nd Doto
.:.1
d
I OK I Cancel !__Help-'--_.
Figure 4-33. Doto Block General Properties Port-1: Instance DB Selected.
ACTION
1 Open the p rojec t and select the Blocks folder of the program in which lhe new
dole block is to be inserted.
2 From the menu, select Insert ► S7 Block ► Data Block, lo generate the new data
block object. The block properties dialog is opened lo the General Port-1 lab.
3 In the Name and Type field. the next availab le DB number is placed in lhe left
field . Use either the next available number or type in a new DB number (e.g .. DB
10).
In the adjacent field. to the right of the DB number. selecl the drop arrow and
c hoose Shored DB or Instance DB. based on lhe DB type you wish to creole.
4 If Instance DB is chosen as lhe DB type, press the drop down arrow in lhe right-
most field, and select the FB number to whic h the DB should be assigned.
5 Nex t. in lhe Symbol Name field. enter a label for lhe DB (up to 24-characters). The
symbol name is entered into the Program' s symbol table a s a substitute address.
7 In the Comment Field below. you may enter a descriptive comment tor the entire
data block. perhaps describ ing ils main use in the application.
8 On the General Part 2 tab, an Instance DB will be assigned the same header (i.e ..
Version, Family, elc.) information of the FB to whic h ii was assigned.
9 Press lhe OK button to confirm lhe DB header entries and lo generale lhe new
DB.
229
STEP 7 in 7 Steps
iJ2iLAD/ <;Tt/ F8D • (0810 -· New...J1rj\ 5fMATfC 300(1)\ CPU 316) 11!!1~ ~
0 File Edl 11\sert PLC ~bug V'iew Options wf\dow H~
Type
lddre11• ·-
o.o STRUCT
DJT 0 Tellporacy placeholder vsriehle
END_ST!WCT
.!.J
Figure 4-35. Default screen when editing a Shared Dalo block for the first time.
230
Working With STEP 7 Programs a nd Doto
'. LAD/ STL/ FBD - [0010 -- New_JJrj\ SlMATIC 300{1)\ CPU 316] - IDJ~
O FIie Eat Insert PLC Debuo View Options Wndow Help -1611~
lddress Bame Type Initial value Cw1.e,1t
o. STRUCT
+o.o TIIP PRlSET l Temperature Preset- Zonel
- llIT
nrr
350
+2.0 TiiP PRlSET 2
- - 375 Tempei:ature Preset Zone2
-1-4. 0 TMP PRESET 3
- - nrr 400 Temperatur e Pte:iet Zone3
+6. 0 OVR- IJIT- Tl BOOL FALSE zom: l OVER Limit
+6.1 OVR urr T2 BOOL FALSE zo.m: 2 OVZR Limit
+6. 2 OVR- Lm'- T3 BOOL FALSE zom: 3 OVER Limit
•8 . 0 DID STRUCl
ACTION
1 From the SIMATIC Manager. double-click on the doto block you wish lo edit.
2 From the menu, select View ► Declaration View in order to declare variables.
3 In the first data row. click in the Name field and enter a name; click in the Type field,
right-click and select the dola type from Elemenlo,y Types or Complex Types; click
in the Initial Value field. and enter on inilial value (optional); click in lhe Comment
field and enter a comment (optional).
4 From the menu, select Insert ► Declaration Line ► Before Selection or After Selection
to place the next variable either before or otter the first row. Enter os many variables
as required, and then from the toolbar press the Save bu tlon lo save lhe DB otnine:
press the Download button to save the DB online in the PLC.
2 With the dala block open. from the menu selec t Vie w ► Dato View (if not already
activated) to view the DB with on Actual Value column for editing the variables.
4 If you simply wish to reset all of the variables of the DB to their initial values. from the
menu. selecl the Edit ► Initialize Data Block.
5 Enter os many values os req uired, then press the Save button to save the DB offline:
press the Downtood button to download the entire DB: for lnstonce DBs. if you are
using the DB parameter editor you will also hove the option of only downloading the
parameters values of the data block.
231
STEP 7 in 7 Steps
I 4 Data Block
SData Type
I iii SIMATIC30Q'.2) 61/arleble Tallie
fiil SIMATIC 30(X3J
iii SIMATIC30(X4)
Propertic'i • function
I
Gene,al -Parl 1 Gerietol · Pa,12 I Ca& ] Allribulos I
~lame: jFC19
. , - - - - - - - - -.
Simoolic Name: I
Simbol Cotlllrel"t
I
I, OK I eenee1 I Help j
Figure 4-38. Properties d ia log: General Properties Port I - of Block Heade<.
232
Working With STEP 7 Programs a nd Doto
Properties - Function ·
DK
I Cancel
ACTION
1 Open the p rojec t and select the Blocks folder of the program in which the new
block is to be inserted.
2 From the menu. select Insert ► S7 Block, then select the b lock type (e.g., Function)
lo generate. The block p roperties dialog will be presented.
3 On the General Part I tab, the Name field will contain the next a vailable block
number for the block type you hove chosen. Either use the derived number or enter
a new number (e.g .. FCl 0, or FC 20). This name is the absolute address of the b lock.
4 Click in the Symbol Name field to en ter o mnemonic name !or the block. The
symbolic name is actually a substitu te tor the absolute address.
5 Click in the Symbol Comment rield lo enter o descriptive comment. The comment,
which may contain a maximum of SO-characters. will appear with the symbol name
for the block when the symbol table is opened with the symbols editor.
6 Select the Created in Language drop down arrow, and choose the language in
which the new b lock should be initially edited (e.g., LAD, FBD, or STL).
7 Select the General Parl 2 lob lo enter additional properties for the block.
8 In the appropria te fields, enter o Name (not some as symbol). ror the block; o
Family name. lho l associa tes the block with a group of b locks; a Version number,
tha t allows changes lo the b lock lo be managed; finally, on Author tho l iden tifies
the user or perhaps deportment responsible for creating the block.
9 Press OK to confirm the configured b lock header and to generate the new b lock.
233
STEP 7 in 7 Steps
Application Tip s
You may copy block elements including Block Title. Block Comment. Network Tille. Network
Comment. and Networks. between blocks using Copy a nd Paste operations.
234
Working With STEP 7 Programs and Doto
ACTION
1 From the SIMA TIC Manager, open the required project and 57 Program folder.
Select the offline Blocks folder to display the off/ine blocks in the right pane.
Al ternatively, you con view the online Blocks folder by selecting View ;.. Online from
the menu.
2 Double-click on o b lock or right-c lick on o block and select Open ► Object to open
the b lock in the LAD/FBD/STL editor.
3 From the LAD/FBD/STL Editor menu select View, and then select LAD, lo edit the
block in Ladder format select FBD, to edit the block in Func tion Block Diagram
format; or selec t STL, to edit the block in Slo/ement Us/.
4 Select View ► Status Bar, to display the editor status information on the bo ttom
window edge. Select Slolus Bar again lo hide the slolus bar.
5 Select View ► Display With ► Symbol Representation to toggle between the display
of symbolic addresses or absolute addresses in the open program block.
Selecl View ► Display With ;.- Symbol Information lo toggle the display or symbol
information (i.e., symbol address, absolute address, commen t) with each network.
8 Select View ► Overview to display the Program Elements/Coll Strvcture w indow. The
Program Elements lob lists the instruction folders. Instructions may be dragged trom
a folder and dropped onto the current network. The Coll Structure displays the
hierarchy of how blocks ore called in the open program: you may double click on
any block to open the b lock.
9 From the menu. select View ► Details to display on information window al the
bollom of the main wind ow. The window contains seven tabs offering further access
lo rela ted information for the open block.
10 From the Program Elemenls lob. expand lhe FC Blocks and FB blocks folders. to view
user func tions and func tion blocks that hove been c reated: or expand the Libraries
object and then the Standard Library folder. to access system block folders. FCs. FBs,
SFCs, and SFBs may also be dragged and placed into o network.
11 To edit a program, find the network (e.g., Network I ) you wish to edit; click on a
posilion in the network. lhen insert basic logic elements from the tootbar (e.g.,
normally-open and normally-closed contacts. coil, and branch instruclions) or drag
on instruclion or block from the program elements window.
13 From the menu, select file ► Exit lo c lose oil open blocks and close the editor.
235
STEP 7 in 7 Steps
Essential Elements
A block that already exists moy be opened for ediling from the SIMA TI C Manager or from the
STEP 7 LAO/FBD/STL editor. From the SIMATtC Manager you will o p en the offline blocks
window o f the required project. or to edi t online you w ill need to open lhe online blocks
window from the toolbar or from the menu. The block is selected and is opened by simply
do uble-clicking on the block or with a right-click on the b lock and selecting Open Object.
Application Tips
As o moHer of good practice and solely, consider mo king all program changes offline.
29
Enl1ypoirt v-
iPicioct .:.I Icomponent vew .:.I (" Onn (o' Ollfne
F'C1
il
OK I Holp I
Figure 4-42. In the LAD/FBD/STL editor, File Open presents dialog for opening a block.
236
Working With STEP 7 Programs a nd Doto
-
Fie Edi: llllert PlC Debug -
-
Qptla<IS Wtwlo;, Help
~ rie., nct.m •
l!! tw Btl09ic r ct- lN O IN
lj,' Cb ( Offll>)rolOI 0~0-UT-- - - - - - - - - - - - - - - - - <
o our
b 6/l COl>Y.,ter
e O IN_WT
l:l cc,.,,1 .,
t,;; [!J OOcall i ~ T£M?
IE O RETURN
0 IN_OUT
~ TEMP
~© '""'I>• 0 RETURN
lt (ill lntegor fu-,ctjon
Ee G:!J Flo&tr,g-p,,nt f<t. TC! : Title :
e (29 Mo>v• llct\10r k l : Title: ..J
I:!! fill PI09'atll COOO'Cl
Ci' ~ Shf'tfl\Olate
(! !ill Status txts
II l ZIO,O
1-- - - - - - - - - - ( ) l - - 1
01 7,0
IE12) T111ct•
l?) Qjl W01dlc,g;:
EE i::9 FBbl>d:s Relvork 2 : Tl t.J.e :
& itl! FC !:locks
~ !cl SFi!tlocb
I 120. 1 r 20 . 2 01,.s
li;i) SFC bl<rw 1----v-----r.>-1
Al M.J11319 nstances .:::J 1
ew nr:IW<lfl, '( S
•
Pre.sFI to o-,t lidp. p°iil,,. fiit,, <:S'.2-· (iMtJ /4
~
Figure 4-43. LAD/FBD/STL editor. FCl block open in LAD; Program Elements window on left.
ACTION
1 From the SIMA TI C Monoger open the required project. select the desired program,
and then select the o ffline Blocks folder. ormne blocks ore listed in the right pone.
2 Double-click on o block lo edil. or righ t-click on the block and select Open ►
Object. The LAD/FBD/STL editor opens w ith the offline block.
3 If lhe Program Elements lob is no t in view. select View ),. Overview from the menu.
4 From the menu. select View. then select the language of choice /e.g .. LAD, FBD.
ond STL); in this cose, selec t LAD. lo edit the block in Ladder formal. The Program
Elements tab is refreshed to reflec t o change in the cl,oice of language.
5 Find the network you wish to edit. tor example to odd a normolty-open contac t lo
Network 1: c lick on o position in the network, then insert basic logic instructions from
the toolbar (e.g., normolty-open and normally-closed contoc1s, coil. ond b ranch
instructions) or drag on instruction from the instruc tion browser.
6 To inrert o new network ofter a particular network. select the network ond then from
the menu select Insert ► Network, or from lhe toolbor press th e New Network icon.
7 To sove o block ormne when done editing. from th e menu select FIie ► Save; or from
lhe toolbar. press lhe Save icon.
8 To sove o block online wh en done editing, from the menu select PLC ► Download;
or lrom the loolbor, pres.s the Download icon. An online connection is required.
237
STEP 7 in 7 Steps
Essential Elements
Each b lock you create, whether in LAD. FBD. or STl, allows you to enter (1) Variable
Comments of up lo 8D·cl1aracters. for each local variable declared in lhe declaration loble;
(2) o Block Tille of up lo 64-charoclers, to b riefly title the block: (3) a Block Comment, of up lo
64-K•byles of lext. to describe the p urpose or opera tion of the block; (4) o Network Title of up
lo 64-characters. to title each logic Network: and (5) o Network Comment that allows text
entry of up lo 64-K-bytes per network. lo describe the p urpose or opera tion of each logic
network. Blocks wrillen in Statement List, a lso a llow o Line Comment for each instruclion line.
Application Tips
If o Symbol Tobie hos been c reated for the program. symbolic addressing and symbol
commen ts may be viewed by selec ting View ► Display with ,. Symbol Representation and
View ► Display with ► Symbol Information from the menu.
·Hi1Mtiiitiffilh 'tiiPt·HdihlO~
1 ' ,- f □LXJ
~Ne,•~ •
Ii) gJ Bl loQic
E!l (b Canparoto,
j 0 111 0-IN
o "'o..,.,l!T
= - - - - - - - - - - - - - - --1
Ltl-~ OYT
F! SI CMl«ll!f ill o 111_cur
(u] C0<6ltor OIN_OUT
~-~ T'fl'P
~ (i'f)OOcdl :uJ:- 1'!:MP
rli O Rf'lUR/1
1£ © .)J,rps :0, Rl:l'URN
E!l-[D 1ntege1 ftttucn
~ [!} Fb,tno-po'rn fct, TCI : Tltle :
I'£ (cl Move llct\,ork 1 : Title: _J
(;: 6'f:I P100-orn cor.trol
I
!ti-W) ShftJRot.-:e
8 -wJ Sl•tus l:iU
@:],m.,,s II i - - - - - - - 1 } - I
I 20, 0 017, 0
~w natwerlt "'s
• ~
Pte<•FI toget~. -
{Ab< cs.2 e joifline
J1nsatt J /4
Figure 4-44. Block FC I opened in the LAD/FBD/STL editor. with LAD representation selected
and wi1t1 Display Comments not octivaled.
238
Working With STEP 7 Programs a nd Doto
■ FC 1 -- BrllliantTraining\ 57 Prograrn( 1)
Figure 4-45 . Block FC 1 shown opened in the editor with commenls displayed.
ACTION
1 With the desired block open in the LAD/FBD/STL editor, from the menu. select View
► LAD lo choose ladder as the language o f choice for editing the block.
2 From the menu. selecting View ;.. Display Wtth ► Comments activates comment
entry or toggles lhe display of comments on and off. The check mork is shown when
comments ore displayed. No check mark is shown when commenls ore not active.
3 Click on the word 'Tille' shown just to the right of the block name fe.g .. FC 1: Title). to
enter o Block Tille. Enter up lo a maximum of 64-chorocters for the title.
4 Click on the word 'Comment' in the gray field, below the block name. to enter a
Block Comment. The field c hanges lo white allowing entry of up lo 64-K-bytes to
describe lhe operation or purpose of the block. Click outside the box. when done.
5 Click on the word 'Tille' shown just to the right of each network (e.g .. Network l:
TIHe), in order lo en ter o Network Titte. Enter up to a maximum o f 64-chorocters.
6 Click on the word 'Comment' in the gray field, below each network. to enter o
Network Comment. The field changes to white allowing entry of up lo 64-K-bytes to
describe lhe network operation or purpose. Click outside the box when done.
7 From the menu, select FIie ► Save to save the block and its documentation.
239
STEP 7 in 7 Steps
...
$ O IN
'
,..._
OIN ___________________
Name
jL., I I Q
~)--1-
1 I 0-
Het'W'Ork 2 : Conveyo r Kotor No . 2 Control logic.
I IS . O IS.l 15 . 2 05 . 0
1:,_~3-~-J1----11-~--::~.1-
1 I - ( }--
lfetffllrk J: Conveyo i: l!otoi: No . 3 Concc ol logic .
1
Figure 4-46. A Function (FC) written wilhou I use o f formal parameters. See Figures 4.49
and 4-50 later. lo see how on FC w ith formal parameters c on replace repeated logic.
240
Working With STEP 7 Programs a nd Doto
ACTION
'
1 From the SIMA TIC Manager, open the project and the required p rogram Blocks
folder; then double-click on the FC lo open the block in the LAD/ FBD/STL editor.
Create the FC if necessary.
2 From the editor menu, select View ► then the language of choice (e.g., LAD).
3 Select View ► Overview trom the menu if the Program Elements/Call Structure
window is not in view (LAD/FBD instructions ore in categorized foldersI.
4 To declare new temporary variables: First select the TEMP objec t in lhe left pone of
the declara tion table. then click in the Name field of the declaration row and enter
the name for the variable. Click in the Data Type field and selec t the data type for
the new variable from the drop list. Finally, c lick in the Comment field and enter a
descriptive comment. Enter as many temporary local variables os required.
5 To insert a temporary variable before on existing variable: First select the existing
variable row, th en right c lick and select New Declaration Row. The new declaration
row is placed above the row you selected . You may otso selec t o declaration row
and drag ii lo a new position.
6 To enter code for the block: C lick inside the code sec tion. starting with network 1.
then write the code for each network operation, using either absolute addresses or
symbolic addresses (if already defi ned). Note: Network 1 is au toma tically inserted.
7 To start a new network. from the menu select Insert ► New Network, or from lhe
toolbar press the New Network bu tton.
8 From the menu selec t FIie ► Save when done with lhe lost network.
2 41
STEP 7 in 7 Steps
In Statement Lisi (STl). on FC written without formal p arameters con a lso be called
conditionally or unconditio nally. The cond itional coll (e.g .. CC FC 10) is executed if the
preceding result of logic operations is satisfied {RLO = logic I). The unconditional coll (e.g ..
UC FC 10) is execu ted on every CPU cycle.
I liiGll ffiliHHiitiffil,l·l~ilAl11·1i·\,li4i
1 .-JgJ~
1
1!}-@} 08 cdll .. ~ lnterfo:,e
jcoolecl:s Of: "En~ronment\lnterlace'
Nama •
I If! (sJ Jurps
0- IN
'1B @ Integer f untt1on
I ~ @) Floaling•point fct.
O OUT
'fit ~M4ve U- IN_OUT
1-
1li½-'2d A'og1am COM'ol ~TEMP
' 1'.a) g,ftfRot,,le
I ijt 0 RETURN .:J
'$·t!ll Status bits
'@(w Toners .:.I
1
f4I '.ii) Word log;: Ketwork 11: Call fC l Condi t.iona.l ly if I 20. 0 is a.c eivat.ed.
1fH 1J;jj F8 blocks
1
~ 1JI FC blocks
' 0 F<: ! e,t_Log,:_St d
µo:o fCl
~ CALL }-I
I. 0 FC2 Bil:_Log,c_Spc
II 0
0
FO l imetsjlox
FC4 lime,s Col tlet"110rk 14 : Ca.l l FC 2 Uncondiciona.lly on each scan.
O FC5 Court;,sjlo( rcz
I O Fa. Counters_Ccil I ( CALL }-j
6 FO COffll)llres I
0 FC8 Coo-,,ersions
0 FC9 lnteg,!r _Allth Nctmrk 15 ; Call FC 3 Uncondit.ion,il ly on each :>CClD,
·0 FCIO Real A11th
0 FC I I RealJ'1ath_~ •I I El/
rc3 I
EJJO I .J
I l.~ I
l@)Progr<rnel .. ◄I I ~ -
Figure 4-47. Colling FCs written will1out Formal Parameters in LAD, using Coll Coil or Coll Box.
242
Working With STEP 7 Programs a nd Doto
~~ I i!iG ;bhrbilildb
[Con!e,Jb Of: 'mvtronmalt\lnt;;;feoe'
'$ t'.R!J 08 call =-=1-,-nter
-,f:-
ac:e
-- Nam &
:e-~ Ji.rrps t:O-=+.l'""
N- - - - - - - - - - - - - - - - 1·- 1!
I~ liIJ lnte',)el' funcbon
I$ @I Floating•polnt let. OUT
,i!t(29 Mow ~ IN_OUT
i I& ffi:I PYO<], am conll'ol ~TEMP
Ip' (al 9-i't/Rotale 0 RETURN .=J
ltl ~ Sl:6tUS bits
ffi ~ Timers tretuork ll : Call TC l Condi tionally if I 20. 0 i s ecr:J.11atcd. •
1
ACTION
'
1 Open the b lock (e.g., OB 1) from which on existing function (FCJ will be called.
2 To mo~e o condijionol call in LAD/FBP, click in the code section of the b lock. then
from the toolbor press fhe new network icon. From the Program Control folder, of the
Program Elements tab. drag and drop the CALL Coll (LAD or FBDJ onto the network.
En ter lhe FC address above lhe Instruction (e.g .• FC 1J. then insert lhe conditional
control logic to determine when the FC should be called.
3 To make an unconditional call in LAD/FBD, click in the code section of the block,
then from the toolbor press lhe New Network icon. From the Program Control folder
of the Program Elements lab, drag and drop the CALL Coll (LAD or FBD) onto the
network. Enler the FC address above the coil (e.g., FC 2).
4 If you wish lo see the FC as a box function as shown in Network 15. open the FC
Blocks folder and drag the FC onto the network. The FC number is displayed inside
the box. You may coll the FC box function with or without preceding logic .
5 If lhe FC you wish lo coll will use data locations from a shared DB, coll !he DB in the
network prior lo colling the function. using lhe OPN DB coil (e.g.. OPN DB 22).
6 To moke o conditjonol coll in SIL. click In the code section and en ter o new network:
enter !he conditional logic and end the logic string with the conditional call
instruction (CC) to reference lhe address of lhe FC (e.g.. CC FC 3).
To moke on vncondHional coll in STl. c lick in the code section and enter a new
network; I hen e nter the unconditional coll instruction (UC) referencing lhe address
of the FB to call (e.g.. UC FC 2). without any preceding logic string.
243
STEP 7 in 7 Steps
Essential Elements
Formal parameters o re specified using the IN. OUT. and tN_O UT. declarations. An IN
declara tio n represents on input to the FC. a value lo be read: on OUT declaration represents
on ou tp ut from the FC, a value to be written; the IN_O UT decla ration represents both on
inpul lo and ou tput from the FC. a value that is read and written by lhe FB.
The example AC motor FC might include inputs lor the Start PB, Slop PB. Emergency Stop PB.
and Holding Coll contac ts. a nd outputs for the Motor starter, and a Status light. If temporary
variables are req uired , they are specified using TEMP declarations. After defining as many
forma t parameters and temporary variables as required, the b lock code is then written using
one or more networks just a s you would normally, bu t instead o f using actual inpu t and
ou tp ut addresses. you w ill en ter the formal parame ters instead (See Figure 4-49).
Application Tips
Use of fo rma l parameters is a great advantage In that while the actual code is written once.
the FB may be called repea tedly. Memory use is also minimized and errors ore reduc ed.
!contents Of_1'Envlronment\Interface\IN'
lfifi'Tr1rt;;e;rfha~ce; ---- Name Data Type Comment
ltl O fm t?I START Boot Start Pu shbutton
~' 0 OUT t!1 STOP 8001 Slop Pu shbutton
:··0 1N_OUT ~ ESTOP 80 01 Emergency Slop Pushbutton
, ..,a. TEMP
m HCOIL 8001 Motor Holding Coil Auxitary Contact
ttl•-:e- RETURN
u
FC40 : Motor Func tion ( FC)
Loqio is vritten using foaal Paraaeters (substitut.e paroeters) .
cwal pe.r8.llet:ers ( add.I:esses) e.re supplied wen the re is ctlled.
GCO,-IL- - -I - - -I ---,-~:TUS
,----i l }-I
•
Figure 4--49. FC 40 Molar Conlrot Logic: IN formal parameters shown in dec laration table.
244
Working With STEP 7 Programs a nd Doto
ACTION
1 From lhe SIMA TIC Manager, open the project and the required program Blocks
fo lder. and then double-click on the FC to open the in lhe LAD/FBD/STL edito,.
Create the FC if necessary.
2 From the menu. select View ► then the programming language to use (e.g .. LAD);
then select View ► Overview from the menu if the Program Bements/Coll Structure
window is not in view.
3 To declare a new formal parame ter: From the left pone of the declaration table ,
select the parameter type you wish to declare (i.e .. IN, OUT, or IN_OUT), then click in
the Name field o l lhe first declaration row ond enter the name for the variable.
Click in the Data Type field and select the d a ta type from the drop list. Finally. c lick
in the Comment field and enter o descriptive commen t. Enter as many variables o t
o particular parameter type before moving loo new formal parameter type.
4 To decla re a new tempo ra ry variable, firs1 selec t lhe TEMP object in the left p one of
the declaration table; then click in the Name field of the first declaration row and
e nter the na me for the variable: c lick In the Doto Type field and select the dole
type for from the drop list. Finally. clic k in the Comment field and enter a descriptive
comment. Enter os many temporary local variables os required.
6 To enter code for the block. click inside the code section; starting with network I.
write the code for lhe device or operatio n as you would normally, using lhe rormol
parameters where you would normally use absolute addresses (See Figure 4-49),
7 From the menu. select FIie ),, Save when done wilh the lost network.
245
STEP 7 in 7 Steps
Essential Elements
When called in LAD or FBD, on FC with parameters appears as o box containing its input
parameters on the left side of the box and output parameters on the right side. Each
parameter hos a name that reflects the actual input or ou tput for which it is a p laceholder.
The AC motor con trol Function inc ludes START. STOP. ESTOP. and HCOIL inputs: MOTOR, and
STATUS ore outputs. On each coll of the FC. you must supply an absolute or symbolic address
o l each parameter. As you use on FC with format parameters. you must ensure Iha! the
correct addresses are entered al the appropriale parame ters and ore of the some dola
type (e.g.. BOOL, WORD, INT, and DINT). In this example. all of the parameters ore of data
type BOOL. and require that addresses of bit variables be specified (e.g .• I 4.1 , or Q 5. 1) .
Application Tips
A system function (SFC) with parame ters is handled in the same manner as a user-developed
function (FC) w ilh parameters. In LAD/FBD. the EN/ENO signals allow lhe FC or SFC with
parameters to be used in a network like any other box operation. To use an SFC or existing FC
correctly, you will need appropriate documentation to know the purpose and operation of
the block. II is essential to know the type of memory variable (e.g.• I. Q. M. Pl. PQ, and DBDW)
and data type (e.g.. BOOL. DINT. INT, and CHAR) expected at each parameter.
- (Pl ,cJ
{2S) Mwe Name
G: G'fl Progrom cortnJI e "'rN_______________----l
I:,' \iii Sh(,\/Rot.ote
:Q- OUT
Gl~ Stolus bils
E·-G2) llmetS 0 IN_OUT
IS fi:I Word loge ~ TE~IP
1,:- i;jl FB bhl.s :ORE RN
8 'iii FC bb:l<s
· 0 FC I llt.Jooi'~td llet110rk , : Cllll Motor Control runct1on (TC•IO) tor Botot !Jo . l
0 FC2 llt_Logi<Jp<
0 FCJ 1'1Toor$_8ox
0 Fe, rtners_Col
FC40 mo~I____
0 FC5 COU'\!91S_Box
0 FC6 Counle,s_Ccil
0 FC7 C ""'°""" IQ . z- ESTOP
Q FCO Convt<si:>ls
0 FC9 lnl•9!'_;.,~h
- 0 FC 10 Real_llllth
0 FCI I Real)'\Mh_Funttkn
GFC12 ~ lletlJork 18 : Coll Bator Control function (ff40) for ltotor Ila. 2
0FC13 ~CR
0 FC11 5t&JSjlil$ ;-I_ __ Ell EC40 IJIQ 1,-_ _ __
·0 FCIS :sNft_Rot<>le
·• 0 FC 16 Mo~_OP; ts.o-STAXT
_J
0 FC17 W<rd_Loglc
.
0 FCI \I f'loV'b,,_Cnttl
IS. 2 - ESTOP
0 FC40 AC_M0t01 ~lot<>,-$ ..:::J
~ IS. 3 - lltOIL
'
~ " ' of the pr<>jel.'l "-{
..
®Prog,.,..•li!fne... ; c..'t &t,i.d.,o ~ •::=!.____________________-=.!.G~
n
Figure 4-50. Coll from FC 19 to FC40 (M o tor Control Logic) for two motors.
246
Working With STEP 7 Programs and Doto
ACTION
1 Open 1he desired S7 program and the colling block (e.g.. FCS) from w here you will
make o coll to on existing function (FC) wi th parameters.
2 From the View menu. select l.AD as the programming language lo use.
3 If the instruction browser is not already in view. from the menu selec t View ►
Overview.
4 To make first coll in LAD. click in the code section o f th e block. then from the toolbor
press the New Network icon lo enter a new network in w hich to coll the FC.
5 From lhe Program 8ements lob. open the FC Blocks folder to display all user-
created Functions (FCs) of the currently opened S7 program: locale the desired FC
number (e.g., FC 40). then drog and drop the FC onto the network.
6 For eoch parameter, enter lhe actual addresses for the first coll of 1he operation.
lnserl logic in the EN inpu l line for a conditional coll lo the FC; insert the FC without
logic conditions preceding the EN input tine for an unconditional call.
7 To make second coll in LAD, press the New Network button to insert o new network
in which to coll the function. Repeal the programming process, of steps 5 and 6, but
supply the next set of actual addresses (absolu te or symbolic) for lhe next device or
operation.
8 From the menu, select File ► Save when done with the last network.
247
STEP 7 in 7 Steps
•~ Of: 'Emi,,i,...,rt\lr,tCtf<itc\si'AT1
Name
UI CHOJ.CC
Data TVl)e Address tnttial Value Comment
Int 0.0 0 Accumulator for 1st Ma log Input Chan...
-
00--0 CU! 1!I CH1_11CC lnl 2.0 0 Accumulator for 2nd Analog Input Chan...
0 IN_OOT UI CH2..ACC Inf 4.0 0 Accumulator for 31dAnaloo Input Chan...
=lit 5TAT
'ID CH3_ACC lnl &O 0 Accumulator for , th Ana log Input Chan,
lB :Ii)- TEl'P
•
f'BSO : f ouc Channel J.Mlog I npuc Yilu:c Roucine .
lletlKlr k l : on each c all o c cht fB r eact each 1.npuc end add to previous veJu!: . _J
- - - - -Ell
.. 111:. I I
-!D0; . . . . . . - - - - - - - -!11
ADO_I I 1188 , 7
!!lO; . . . . . . - - - - -•f ) I
PIIJ256-INJ Otn''r~CHO_ACC PU1'258 - _I D
_ l_ _o_lTT_ .r' CHJ _.I.CC
ICHO_ACc - _r_m_ ___._ #Clil_ACC -lll2 _
i - - - - - -EN
AOD_I I
EBO. . - - - - - - - - - -ED
ADO.I I
,t!IO _ _ _ ___.
PI11260 - Dll Otrr~ #CHZ_ACC PIW26Z ~__ l _ _o_ur
!U __.r ' CH3_ACC
~2___.,!
f Clll-_Acc-_r_ ,fCR3_Acc- ID2 !
ff~t1'10r~ 2: Incce•ent. Sl!P_ACC ; Councec f oe nWlbec of ,az,:,10, wen.
- - - - -£11
1',01) I I
E:110; - - - - - - - - - - -
fSMP _,.cc - I NJ OllT'r~SltP_ ACC
1-IllZ _
llctlror k 3: Tc,t to ,cc if the ol l , anplc, ht!vc been telten; 1f not. ll£TIJJUI
f.1,1P Cl
, - - - - - -,( ru:T} -1
J!'il!P_ ACC - llll
4 - 1112'
◄
Figure 4-5 1. An FB without formal parameters. w ritten as o 4•c honnel Analog Input Filler.
248
Working With STEP 7 Programs a nd Doto
_J
lletmr k , : Resee st-ae1c ~ciables Ctt0_ACC,Clll_ACC,C112_ACC ,CH3_ACC ,SHP_ACC .
I. - - - -Ell MOVE I
ENO; - - - - - -IEfl
MOiie I M88 . 6
ENO . - - - - - - - - - - - - . , . . ( ) -1
ACTION
I
1 From lhe SIMATIC Manager. open lhe projecl and the required program Blocks
folder, and then double-click on the FB lo open the in lhe LAD/FBD/STL editor.
2 From lhe menu, select View ► lhen lhe language of choice (e.g.• LAD for ladder).
3 Select View ► Overview from lhe menu If the Program Elemen ts/Coll Structure
window is not in view (LAD/FBD instructions are in categorized folders I.
4 To deciore o new tem oorory or static vorioble: First select the TEMP or STAT object in
the left pane of !he d eclara tion table; then click in the Name field of the
declorotion row and enter the name for the variable. Click in the Data Type field
and selecl !he doto type for rrom lhe drop list. Click in lhe Comment field and enler
a descriptive comment. Enter as many lemporary or static variables os required.
5 To insert o lemporory or slolic variable before on exisling variable: Firsl selecl lhe
TEMP or STAT objecl from the left pane of lhe declaration table, to display the
c urrent records o f that type. Then. selecl on existing variable row. right c lick and
select New Declaratton Row . The new row is inserted before the row you selected.
6 To enter code for the block: Click inside the code sec tion. starting with network t.
then write the code for each network opera tion. using either absolute addresses or
symbolic addresses /if already definedl. Nole: Network 1 is au tomatically inserted.
7 To storl o new network. press the New Network bulton from the toolbar.
8 From lhe menu select Ale ► Save when done with lhe lost network: select FIie ► Exit
to c lose the editor.
249
STEP 7 in 7 Steps
Essential Elements
In LAD and FBD, an FB with no parameters is coiled os o CALL box. All user-created function
blocks. ore located in the FB Blocks folder o r the Program Elements tab. To coll the FB. you
must d rag the box fro m the FB blocks folder and drop ii onto the network. You must then
speciry the instanc e DB. belonging to the FB. above the box. The EN parameter allow you to
coll the FB IN'ilh or IN'ilhoul preceding logic. If the coll is based on logic conditions. the FB Is
called w hen the conditions ore satisfied; otherwise, the inslruclion immediolely follolN'ing lhe
coll is processed. In Sta tement List (STL). a n FB without parameters and without a ny static
variables can a lso be called conditionally. using the conditional call statement (e.g .• cc FB
60); or unconditionally. using the unconditional coll sta tement (e.g •• UC FB 50). Since no static
va riables or parame te rs are used. no insta nce DB i.s used; nor does one need to be specified.
Application Tip
Calls to an FB may be from the main organiza tion block (OB 1) or from another b lock (e.g ..
OB. FC, FB). Based on the purpose of an FB. you IN'ill determine where it is cotted from and
how often it is called. The analog filtering FB. for example. might be called from on FB
responsib le for processing analog 1/0 (e.g.• reading. sc a ling. filtering). at periodic intervals. By
supplying a d ifferent instance DB with each call. d ifferent data se ts may be used.
/t<A<'ru~ ,tmi-orrntnt\l~f~,.,·
I r.!: Nw, l'Ctworl: "'"71.nl-:--e<-,f_a<e_ _ ,.:---.,-N,-am""'e------'--------------,-
.
l t1 Gil Bt boc G O IN O IN
~ aJ Carp,-ator i.: :O OUT o "=o""ur= - - - - - - - - - - - - - - - --
Eb Ea c..,,..,t«
;; 0 lfl_OU1 0 IN_OVT
$ Ii! CC>JrUr • ~ Jl:Jq> :& TEMP
fjl lli! 08 "'' ® -0 RETURN O RFTIJFlN
(iJ (i) )Jmps
ljl @} tntooer fu.-.:tm FC19 : User Progran Concrol ~
Ill @) Fbbtl!Q-l>Clftt f<t,
m-(c) ~- fletvor• 1 : C001dic.ional Ca l! f'BSO: 4- c ruumel A.Ill Fl.le.er, '1/ lnscenc e DB.SO _J
m-G:a PrOQtomccrirol DBSO
(a) SMt/Rot<>:c
l!l 6i!J Status bts
Ir I 4. 1
1--
l
I4, 2
--111 - - t l l
FBSO I
!!lo ....- - - -
[jl eJTmers 1
m-Gii) Wordloglc
8-(gj FB bic:d<s Network 2 : Condlt1onol Coll f1160 : Totolitc< f11, vi.th lrult<1ncc I>B60
0B60
0
0
F65IO liltcriCH
F8S3 Fit«◄CH.,llox
0 R!60 Total,,.,
Ir 14, 3 14. 4
I1----1! 1 - -Ell
FB60
!IIOi-
I
1----
,e} f!!6 I Totalzet_Box
0 f8 l00
Network 3 : Un- Conditlon<>l Ce ll rBlOO, v!th In~t<II\Co DBlOO
0 FBIOI
l•l IC! FC blod:s DBlOO
250
Working With STEP 7 Programs a nd Doto
•
DUSO•· Drilbi,ntTr.-.inm!J\ 57 Pro!Jram(I)
Figure 4-53. lnstonce DB 50. for F850, The DB is opened oulomolically when the FB is coiled.
ACTION
'
1 Open the b lock (e.g .. OB 1) rrom which an existing !unction (FB) will be called.
2 Ta make a conditional coll in LAD. click in the code section of the block and enler a
new network in which to coll the function. To call the FB conditionally. enter the
control logic lo determine when the FB st1ould be called. then from the FB Blocks
folder of the instruc tion browser then drag ond drop the CALL COIL al the end of the
network. Enter the FB address above th e coil (e.g .. FB I)
3 To make an unconditional c al! in LAD. click in the cod e sec tion of the block and
enter o new network in which lo call the function. To coll the FB unconditionally.
simply open the Program Flo w C on trol fold er of the instruc tion browser then drag
and drop the CALL COIL ot the end of the network. Enter the FB address above th e
coil (e.g.. FB 2)
1 To make a conditional coll in STL, click in the code section or the block and enter a
new network in which to call the function; to coll the FB conditionally enter the
conditional logic and end the logic string with the condi tional coll instruction (CC)
referencing the address of the FB to call (e.g.. CC FB l ). No instance DB is needed.
2 To make on unconditional coll in STL. click in the code section of the block and
enter a new network in which to call the function; lo catl the FB unconditionally
simply enter the unconditionol call instruction (UC ) referencing the oddress of the FB
to coll (e.g .. UC FB 2). w ithout any preceding logic string. No instonce DB is needed.
251
STEP 7 in 7 Steps
____.
ICHO_ni - Il/2 ICRl_DI - ~
- - - - -t:ll
Al>O_,I
E J I O , - - - - - - - - - -EN
J\l)li_ lI
ENO , - - - - - - - '
fCH2_IN -_Dl
_2 _ __, I CH3 _ DI -_lll
_ 2 _ __,
252
Working With STEP 7 Programs a nd Doto
ACTION
1 From the SIMATIC Monager, open the project and the required program Blocks
folder. and !hen double-clic k on lhe FC lo open lhe in the LAD/FBD/STL editor.
2 From the menu. selecl View :;. then the programming langua ge to use (e.g., LAD):
lhen select View :,. Overview from lhe menu, if lhe Program Elemenls/Coll Structure
window is not in view.
3 To declare a new fonnat p arameter: From the left pane of the d eclara lion table.
select the parameter type you wish to declare (i.e., IN. OUT, or IN_OUT), then c lick in
the Name field of the first declaration row and enler the name for the va riable. Click
in the Data Type field and select the data type from the drop list. Finally, click in the
Comment field and enter a descriptive comment. En1er os many variables of a
particular parameter type before moving to a new tonnol param eter type.
To insert o formal parome1er before an existing variable: F~I selec t lhe desired
fonnal parameter type (i.e .• IN. OUT. or IN_OUT) from the lefl pane. to display lhe
current records of lho t type. Then. selec t o n existing variable row , right click and
selec t New Declaration Row. The new row is inserted before the row you selected.
You may also select on existing variab le a nd drag it too new position.
4 To declare o new te mporary or static variable: First select the TEMP or STAT o bject In
lhe left pane of lhe declaration table; lhen click in lhe Name field o f lhe firsl
declaralion row and enter the name for the va riable. Click in the Data Type field
and selecl lhe dolo type for from the drop lisl. Finally. click in lhe Comment iield
and enter a descrip tive comment.
6 To enler code for the block: Click inside lhe code section, starting with nelwork l .
write the code for the device or opera tion as you would nonnally, using the formal
porometers w here you would no rmally use absolute addresses (See Figure 4-53).
7 From lhe menu, select FIie ► Save when done with the lost nelwork.
253
STEP 7 in 7 Steps
Essential Elements
When called in LAD or FBD, an FC with parame ters appears as a box containing its input
parameters on the left side o f the box and output parameters on the right side. Each
parameter has a name that reflects the actual input or ou tput for which it is a p laceholder.
The FB for filtering four analog inputs includes CHO, CHl . CH2. CH3. and SAMPLE inputs;
CHO_AVG, CHl _AVG , C H2_AVG. CH3_AVG , and DONE are outputs. On each call of the FB,
you must supply on absolute or symbolic address al each parameter. As you use on FB with
formal parameters, you must ensure tha t lhe correc t addresses are en tered at the
appropriate parameters and match the data type (e.g.. BOOL, WORD. INT. and DINT) al the
parameter. For example, the parameters that accept the analog inputs ore of type INT, The
filtered output is also of data type INT.
Application Tips
A system function block (SFB) with parameters is handled in the same manner as a user-
developed function block (FBI with poromelers. In LAD/FBD. the EN/ENO signals allow the FB
or SFB w ith parameters to be used in a network like any other box operation. To use on SFB or
existing FB correctly. you will need appropriate documentation to know lhe purpose and
operation of the b lock. II is essential to know the type of memory variable (e.g., t. Q , M, Pf,
PQ, and DBDW) and data type (e.g.. BOOL. DINT. INT. and CHAR) expected at each
parameter.
• New netwo,k
.ii SIJ B1tbgc
• "'"""Int
-:-er
- f,--occ
- - 1::::-T.'.N~a;.;;
----
mc:.e_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _, :::-l
• I
'
IN
:11 '.rt COIT'!>"••lor
l'll '.:il Convmcr llot 'IIOr k 5 : Call PB 253 4-Cbe.,u,el Ane.log Inpue l'ilur ;
3J £ii COlrtei
'al iill D6 ea~
i>BS3
1110 .6 1199. 0 1"8S3 I
.!l !.s) ""''
@ fill Jrt.eger f,mct;,n
.--I ,... - - - t ( p)1---DI DID i - - - -
254
Working With STEP 7 Programs a nd Doto
~I _J ll
Figure 4-56. Instance DB 53, for FB53. The DB is opened automatically when the FB is called.
ACTION
1 Open 1he desired S7 program and the colling b lock (e.g.. OB I ) from where you will
make a coll lo an existing function block (FB) w ith parameters.
2 From the View menu, select LAD as lhe p rogramming language to use.
3 From lhe View menu, selec t Overview ii lhe Instruc tion browser is nol In view.
4 To moke first coll in LAD. click in lhe code section or lhe b lock. lhen from the toolbar
press the New Network icon to enter a new network in which to call the function.
5 From the Program Elements tob. open the FB Blocks folder to display oil user•
created Function Blocks (FBsJ of the currently opened S7 p rogram: locate the
desired FB number (e.g .. FB 40), then drag and drop the FB onto the network.
6 For each parameter. enter th e actual addresses for the first coll of the opera tion.
Insert logic in the EN input line for a conditional coll to the FB; insert the FB withou t
logic conditions preceding the EN Input line for on unconditional c o ll.
7 To make second call in LAD, insert a new network in which lo call the function.
Repeat the p rogramming process. o r steps 5 and 6. b ut supply the next se t or actual
addresses (absolute or symbolic) for the next device or operation.
8 From the menu, select File ► Save when done with the lost network.
255
STEP 7 in 7 Steps
Essential Elements
This group of operations allow the status of bit addressable variables or memory (e.g.. I. Q. or
MJ to be examined using normally-open and normally-closed contacls; or conlrolled using
the standard output or the set and reset ou tputs. Set and Reset outputs. provide the facility
for latching and unlatching o v tpul signals. In essence, these operations allow you lo develop
logic to examine or influence the result or logic operations (RLO) . For examp le. the NOT
conlact in LAD, and !he Negate (NOT} input in FBD. allow the RLO to be inver1ed.
Application Tips
The following two figures illustrate basic logic combinalions of series and parallel circuits. In
FBD these combinations you will use the AND gale for series logic. and the OR gate for
parallel logic. As many inputs os required may be input to o gate. Outputs may be placed in
parallel in bolh LAD and FBD, however when working in LAD. the secondary outputs must not
branch off the Jeff power roil. Finally, if programming in STL, remember that when combining
·AND' and 'OR' circuits. !hot lhe OR must be performed first, which is ensured by placing the
OR operation wilhin parentheses.
I I20. 0 017 . 0
r-1 ,- - - - - - - - - 0 - -11
tletwork 2 : Serie:, ci r cuit (AND loqic ) with two contactB.
r1
I I20. l 120 .2
1---~:l/ 1 - - - - - - - - ! ~
1
017 . S
:1
Ne tffllrk 3 : Pai:ellel circuit (OR logic) with two N.O . contacts.
I 120. 2 011 . 7
1 1 - ~ - - - - ------<!) i
1j 120. 3
r
ffet110rk 4 : Simple Latching Circuit.
017.7
1
, - - - - - - -,rJ :1
17.7
rl
Figure 4-57. Example In LAD: Using Basic Bil-Logic lnstrucflons lo form logic combinolions.
256
Working With STEP 7 Programs a nd Doto
1111 I:
Ketwrk a: Logic Clt:CUit. \11th pat:aJ ell outpucs .
I 030.3
I:
017.S
() I
017 . 6
I R01": ()-1
Figure 4-58. Example in LAD: Using Basic Bil-Logic Instruc tions to form logic combinations.
GUIDELINE
1 Open the Sil Logic folder of the Program Elements lob lo access bit instruc tions like
NO and NC contacts. NOT conlact and coils.
2 Use toolb ar bullons or hotkeys F2. F3. F7. F8, and F9 for frequently used operations
like NO and NC contac ts, branch open, branch close and coil.
3 Examine logic O or logic 1 status of memory operands including lnp uls (1) , Ou tpu ts
(Q), memoiy b its (M). g lo b al DB bits (DBn.DBXy.x), temporary local doto bits (Ln.y),
static local doto bits. limer status [Tn), counter status (Cn), or CPU stolus b its.
4 Use normally-open contact to examine for logic I to allow power flow: use normally-
c losed conloct to examine for logic O lo allow power flow.
S Combine bit-logic opera tio ns to c reate series (AND), parallel {OR). and series-
porollel (AND-be fore-OR. OR-before-AND) logic combinations (See Networks 1-7).
6 Combine multiple coils in parallel (See Network 8). Contacts may also be placed in
the parallel coil branc h, but only preceding th e coil instruc tion (See Network 8).
7 Use the NOT contact lo invert the result of logic operation o t the point of insertion, or
os lhe lost contocl lo invert the normal operation of o coil ( See Network 8).
257
STEP 7 in 7 Steps
Essential Elements
The Set and Reset coils ore generally programmed lo operate as a pair. but ore
programmed in s.ep orote networks that each re ference the some b it address. When power
flows to the Se t coil. the address is set to logic 1. When power nows to the Reset coil. the
a ddress is set lo logic 0. Na power flow to the Set or the Reset output. does not a ffec t the
sig nal stole o f the bit address. Whic hever of the two opera tions is programmed lost is
considered the dominan t of the two; this is true since when both coils o re activa ted
simultaneously, the o ne processed last overrides the status determined by the other.
The Functionality of the SR flip-flop and the RS flip-flop is the same as the individua l instructions
excep t that bolh functions ore handled in a single box inslruc tion. The dorninance of the set
or reset in o flip.flop operation is based on which of the two input lines is processed lost in the
box. In lhe RS flip-nap. the s is processed last. and therefore is dominant should both occur
simultaneously. In the SR flip-flop. the R is processed lost, a nd therefore is dominant should
both occur simultaneously.
Application Tips
Like standard outpuls and other bil logic operations. sel ond reset coils ond flip-flop
instructions ore generally driven by o combina tion of series-parallel logic tha t controls bit-
addressable locations. Logic may be inserted preceding or following set/rese t flip-flops . In
FBD. on AND gate is inserted lo create series logic: o n OR gate is Inserted for parallel logic.
Set/reset coils may be paralleled in both LAD and FBD, but in LAD. parallel branches for
secondary coils must not start ot the left power roil.
I 113 . l 13 . 2 04. 6
- -1 - - - - - (s) -J
1
lfe twur k , : Illus t cation of the Reset Output
1 ) If I 3.3 AND I 3.4 is at Logic 1, THDl Q 4.6 is reset to l ogic O and will
remain at 1011,1c o until set. A ehttnge in st.ate at the dciving logic
bas no infl uence on Q 4,6 vhile the output is r eset .
13 . 3 I3 .4 0 4. 6
--1 1 - - -l 1 - - - - - - - (R) -I
Figure 4-59. Example in LAD: Using Sel and Reset Ou tput Instruc tions.
258
Working With STEP 7 Programs a nd Doto
I I 3.5
MlOl . 5
SR
ol 04. 7
r,3.6
I
I!
I:
13 . 7
II
s
R
() J
2) If the signal staee at inputs bec omes l o',Jic 1, the address 11 101. 3 is
set t.o logic l and cuains at 1001c l. as long as input S ill !lC l OOiO 1,
end independent of the status at input. line R.
MlO l .3
!4.1 RS 0 4. S
. I I R al ( }-I
1'4-'2
I I:
14. 3
I: s
Figure 4-60. Example in LAD: Using Set/Reset flip-flop and Reset/Set flip-flop Instructions.
GUIDELINE
1 Sel and rese t operations ore in the Bit Logic folder of lhe Program Elements tab.
2 Use the Set/ Resel coils a s a pair lo provide the latch/unla tch functions. Both
op erations should reference the some a ddress.
3 Use the SR or RS flip-flop box instruction lo implement both the la tching and
unla tching function .
4 Combine series (AND) and p arallel (OR) logic combina tions, lo d rive lhe set/reset
coils and SR or RS flip- flop opero lions.
6 Set and reset coils and SR and RS flip-flop operations Inside on MC R zone will
maintain their last sta te wh en !he MCR is no t activated.
7 Like stand ard coils, set and resel coils may b e combined as p arallel coils and
contacts may be placed in lhe branch preceding lhe sel or resel coil.
259
STEP 7 in 7 Steps
Essential Elements
There ore two types of edge detection opera tions. both of which support detection of
negative and positive edge transitions. The Address Positive-edge Detect instruction and the
Address Negative-Edge Detect instructions look for an edge transition in a specific bil
address. The second edge evaluation type looks for on edge transition in the result of a logic
operation [RLO) at any point in a logic network. The instructions include the RLO Positive--
Edge De/eel and the RLO Negative-Edge Detect. Bo lh types of operations signal that an
edge hos been detected by causing a one-shot pulse at its outpu t. The indicating signal is at
logic 1 for one CPU scan. and then returns lo fogic 0.
I 14. l
II
14. 2 POS 03.7
ol () I
I
MlOl. l - M_BIT I
iii;i~ ~~ ·:ij: .Exwaple
I; ,~ ••
u, ino Adc1i:e,s lleqetive Edge Detection
l) l f the ,utus at 1cnput 14. 3 ti:ansition, t coa 1-to-o men the ,utus ot
output: QJ .IS goes High (l) foe one s can and thl!n go es 1o~CO ).
14 . 3
NEG Q3.6
al C}-1
·1 Ml 01 . 3 - M_BIT r
Ket,11>1:k 3 : Ex emnl e Usina RLO Positive- Edoe and RLO Nea a tJ.ve- Edae Detection
l ) If the i: esult ot the l ogic operation (RLO) pi:eceding M-Coi l t:1:ansitions
tcoa 1- t o-O, then 03.0 qoes High(l) tot one s een then goes Low (O) .
2) It the cesult ot the l ogic opecation (RLO ) preceding P-Coil tt8rulitions
tcoa 0-CO-l, then Q3 .l goes Hi~ (l) toe one ~can then goes Lov (O) .
I
G 4:3
I:
Ml 00. 2
(P!
Q3 . l
{) I
Figure 4-61. Example In LAD: Address and RLO Positive- and Negative-Edge Operations.
260
Working With STEP 7 Programs and Doto
&
14.l 03 . 7
>; 1
14. 2 -
&
!4.3 - - 111 00 . 1 03 . 0
14.4 -
H
!-_:_J
11100 . 2 03 . l
p
_ _:_J
Figure 4-62. Example in FBD: Address and RLO Positive- and Negative-Edge Opera tions.
GUIDELINE
1 Access address edge detect and RLO edge detect edge evaluallon instructions in
the Bil Logic folder of the Program Elements lob.
2 Use the address edge detect operations to delect a signal change in a specific
address; use the RLO edge detect operations to detect a signal change in the RLO a l
the point of insertion of the instruc tion.
The address edge detect operations may evaluate a specific address alone or in
combination with other logic condilions(See Network I and Network 2); the instructions
moy be programmed in series and in parallel similar to a contact instruc tion.
4 The RLO edge delec l operations must b e placed ofter preceding logic conditions; the
ins1ruclions may b e placed in parallel branches, but only in a branch Iha! starts al the
left power rail.
261
STEP 7 in 7 Steps
I IS.2
I
H3 . 7
v:
cs
s_cu I
aCr)
H101.1
I
Gs.
I
1 cu
3 CV !m42
I s.
f:o~.4
I
C#lOO - PV
-
CV BCD [IN·14.
I
11S.
I
1
4
I
r:o~.7
I R
I I:
Figure 4-63. Example in LAD: Programming a Counter box instruction.
262
Working With STEP 7 Programs a nd Doto
rs.2- cs
s_cu
M3 . 7 -0____,- cu
IS.3 -
GUIDELINE
1 Counter box and coil operations o re in lhe Counters folder o f lhe Program Elemen ts
lob.
2 Counters ore addressed CO, C l, C2, ond so on. Avoilobte number of timers is CPU
dependent (e.g., CO to C255)
3 Contac ts may be arranged in series/porollel ot eoch counter input (i.e ., CU, CD, S,
R), to achieve the desired control logic, as well as ofler the status signal (Q).
4 PV accepts valid BCD or Hex constants os p reset count values (e.g .. C/1525 or
W I/ 16#0525). The maximum counter range and value for PV is 000 lo 999.
5 PV may also be se t os o variable by desig no ling o valid word location (e.g.. MW 40.
IW 10) or using o local variable of data type WORD.
6 A counter is incremented (CU) or decremented (CD) by one, only when !he RLO on
the coun l input line or preceding the counter coil changes from logic O lo logic I.
7 You may check the status of o counter. using N.0 . or N.C . contacts that reference
lhe coun ler number (i.e .. C4). The status Q is logic I whenever the counler value no t
equal to zero.
8 You con c heck the value of the counter a l intermediate points for control o r other
purposes, using the compare operation and comparing the values al CV (decimal)
o r cv_sco (BCD).
263
STEP 7 in 7 Steps
3) Off- ON cz:ansition of IS. 4 True (1 ) on the R l ine, z:esets- the ti•ez: co zei:o.
I IS . 2
I s
T24
S_ODT I MlOl. 3
( } -I
115:3 '"'"""' -,, ·+"""
I Q
264
Working With STEP 7 Programs a nd Doto
>=1
IS.2 - T24
IS. 3 - _ ,S -
S ODT
BI MtJ60
IS. 4 - R Q. . . - - - - - - -
-----
Figure 4-66. Example in FBD: Programming a nmer box instruction.
GUIDELINE
1 Timer box ond coil operations ore in the Timers folder or the Program Elements tab.
2 Timers ore addressed TO, Tl , T2. and so on. Available number of timers is CPU
dependent (e.g., TO to 1255)
3 A timer box may be placed in any branc h that is connected to the left power roll.
4 Contac ts may be arranged in series and in parallel a t each binal'{ inpul (i.e .. s. RJ.
of o timer, ta achieve the desired control logic, as well as af1er the sta tus signal (Q).
5 A valid preset lime is SST# 10m_30s (10 MIN. 30 SEC.). Only lhe needed units of the
timer value need be used (e.g ., SST# 1SOOms).
7 The operation of the timer status signal (Q ) varies according to the timer type.
8 You may check the ru nning status o f a timer. using N.0 . or N.C . contacts that
reference the timer number.
9 You con c heck the remai ning time at intermed iate point for control or o ther
purposes, using the compare opera tion and comparing the values al Bl or BCD.
10 Time base unils ore binary encoded in b it- 12 and bit- 13 of the timer word o f each
timer. 00 =0.0 I second s. 01 = O. l seconds, lO =1.0 seconds. and 11 =10 seconds.
265
STEP 7 in 7 Steps
Essential Elements
The enable input line EN allows con trol logic to determine if the conversion is executed. The
pa rameter IN. w hich specifies the v alue to be converte d. may be a constant or local
variable of the correct data type. or a memory localion of the correct wid th. When EN is a t
logic 1, the conversion is executed and the result is placed in the loca tion specified at the
parameter OUT. The variable specified al OUT may be a local variable of the correct data
type, or a memory loca tion of the correct width. The enable outpu t line ENO. signals
execution of the instruction and whe ther on error hos occurred. If an error occurs w hile EN is
al logic 1, ENO is set to logic 0; otherwise. the sta tus of ENO follows the sta tus of EN.
Application Tips
Conversions o re used to change the form at or data type o f a variable. A BCD input value.
for example. would require conversio n before use in an integer a ri thmetic operation. The
result would o lso need conversion, were ii to be sen t to a BCD display. STEP 7 orithmetic
operations use integer. double integer or real numbers; values o f any other data type would
require conversion. Finally. when specifying the input and output variables of a conversion.
remember that input and o utput variables may differ in data type and size, based on the
operatio n. For lnslonce, in the INT_ DINT conversion. the inpu t is 16-b it and the oulput is 32-b il.
2) The output coil in after each conversion is activated (lt When l:he operaci.on
is perfor:aed mthout "Crror. Otl'.herwise, ENO is 'O • while Ell is at l ogic 1.
HEG_I I HS0,2
Efl E.NO () I
mT66-IB mrrl111n6
,_ 01 I KSO. 3
Efi
DiOC ( ) I
6
ftlif 8 -111 otn' 1 1ID78
266
Working With STEP 7 Programs a nd Doto
3)If H30.4 is Tcue (1), the Real value in MD 110 is rounded to nearest
doubl e integer: v alue gceater than val ue at. DJ (e. !l·, 3 . 44 to 4) .
4 , If H30. 3 is True (l), the Real value in 110 i s rounded to neatest
}ID
double integer val\le less than value at IN (e.g., 3. 44 to 3) .
I H3 0 . 6 ROUND I MSO. 0
...--1 11---EJI ENO,..------,---r )J--
HD110 - _Ill
__· __O_U___,
T 1 MD210
1130. 5 TRUNO I
- -11 .o1 ENO - - - -,
!00. 4 CEIL I
~-I I EJI ENO ~ - - - - 1
H30. 3 FLOOR I
, - -Ell
1-1 ENO ~ - - - - '
1I 11D110 - _nr
___o_trr....r MD 22 2
Figure 4-68. Example in LAD: Programming Conversion rounding instructions.
GUIDELINE
1 Conversion operations are in the Converter folder of the Program Elements tab.
2 Series and Parallel conditional logic may be inserted before the enable (EN) input
and after the enable ou tput (ENO).
3 Conversion boxes may be inserted in series by connecting the ENO line of one
conversion box to the EN line of the following conversion box.
5 If o network with two or more parallel branches contains conversion boxes in series,
boxes ore evaluated from left-lo-right slarting wilh the first branch.
6 Slalus b it instructions OV and OS may be used to check for errors resulting from
invalid REAL numbers at IN. or values loo large to convert lo 3-digit or 7-digil BCD;
status bit contac ts may also be used to ct,ecl: ir th e result or a conversion is
negative, positive, or zero.
267
STEP 7 in 7 Steps
Application Tips
The compare operation con be placed in a ne twork, much like a normally-open conta ct
instruc tion, with preceding and following logic. When the c ompare is successful. power flows
through the compare; if the compare test foils. power flow through the compare is
interrupted. Also like a con tac t. multiple compare boxes may be placed in series or in
parallel. If in parallel. a logic 1 result is produced for the branch when any compare is
sa tisfied. lf in series. a logic 1 result is prod uced only when all o f th e compa res ore satisfied.
llet'ffl>r.k 1: Compa r e tor Equal , using I n ~ ge t, Doub l e I n teger and REAL value:,
1) In tl\111 ex$111Pl.e, any one ot the thte.e coapares ,11erJ.stied, ptoduces 1 0011: l
f or the parallel bcenob. An equalit.y OOJIP&te is pecfomed on wo IIIT, I>INT,
8!ld REAL values.
2 ) H 101.l is activated it 145. l OR 145.2 is T!:ue AND either coapare il!I True.
3 ) Note that the integer uses a v otd location, double integer uses a double vocd
l ooati~n , end the f l oatinu- po>.nt coapace u~e:, double voi:d l ocations.
I 145. l CMP=I
I MlO l . l
I I
1 () I
1 145 • 2 555 -Dll
IJ
Hli62 - I1l2
CMP ••D
I.
Lf5 5500 - llll
MD72-Di2
C!l,IP ••R
l-
s. sssoooe+
0 05 - INl
m>82 - Dl2
Figure 4-69. Compare Opero t·ions in LAD: Compare Eq ua l for two INT. DINT, and REAL values.
268
Working With STEP 7 Programs a nd Doto
145. J. -
CMP ==I
555 - DJl
Mll62 - '.i!
,Dl~2_ _jr--
CMP ••0
I,i 55500 - Ull
CMP ==R
s.sssoooe+
005 - I Nl tllO J. . l
•
MD82 - Ill2
-----'
Figure 4-70. Compare Opera tions in FBD: Compare Equal for two INT, DINT. and REAL values.
GUIDELINE
1 Compare operations ore In the of lhe Comparator folder of the Program Elements
lob.
2 Six compare types con be performed on variables of dalo type INT. DINT, and REAL.
2 The two values input at INl and IN2 musl be or lhe some data type. For example, if
lhe comparison is CMP.: DINT, bo1h IN 1 and IN2 must be of type double integer or
re ference two double word memory locations.
3 To compare values other than INT, DINT, and REAL, the values must tirst be
converted lo one o f these three data types. For example, BCD values ore da·la type
WORD or DWORD. Either a WORD - lo- INT or DWORD - to- DINT conversion may be
required in order lo compare two BCD values.
5 Compare boxes ore like normally-open contocls and may be p laced in series or in
parallel. All compares in series must be sotislfed lo allow power now. Compares in
parallel require a t least compare to be satisfied lo p roduce logic 1 for the branch.
6 When REAL values ore compared. lhe tesl foils if either of the values IN I or IN2 ore
invalid (UO = 1).
269
STEP 7 in 7 Steps
Essential Elements
The two source va lues for lhe c a lcula tion. specified al IN 1 and IN2. must be of the sa me
data type. and may include constants in the permissible range. tocol variables. or memory
loca tions of the correc t w id th /e.g .. MW 42 for INT: or MD 42 for DINT). The va riable sp ecified
a t OUT may be a loca l variable of the correc t d ata type, or a memory location of the
correct width (e.g .. MW 42 fo r INT; or MD 42 for DINT). The enable inp ut line EN allows control
logic to determine 11 lhe opera tion is exe c uted. Wihen EN is a l log ic I, the operatio n Is
executed a nd the resull is p laced in lhe location specified al the pa ra meter OUT. The enable
oui p ul line ENO, signals execution of lhe opera tion and w he ther a n error occurred.
Application Tips
If on error occurs during operation. ENO is set to logic O while EN is a l logic I; otherwise. lhe
status of ENO fo llows the status o f EN. A lier each arithmetic operation. you may use sla lus bil
instructions lo check fo r overflow o r if the result is. neg ative, positive, or zero. Use Integer
instruc tions. w hen whole number results o re acceptable and your results o re expected lo fo ll
within the p ermissib le range (-32.768 lo +32.767 for INT; -21 4.783,648 to +2 14.783,647 fo r DINT).
Mloll 2- IN2
MD 62 - I f12
270
Working With STEP 7 Programs a nd Doto
&
!131. 4 -
MUL. I
!131 . 5-0 - El/
&
!131. 6 -
JIDl)_l)I
1131. 7 -0 - En
1#1575 - Illl Otrr - lID66 M47,7
GUIDELINE
2 Use the INT boxes. for 16-bit opero11ons: and the DINT boxes, for 32-bit operations.
3 Bit instructions moy be combined in series or parallel before the enable EN input
ond ofter the enable output ENO output o f th e arithmetic box, to achieve the
desired control logic that drives the integer box operations.
4 Integer arithmetic boxes may be inserted in series by connecting the ENO line of
one operation to the EN line or the following operalion. A following operation is only
processed if the preceding operation is processed without error.
5 Use o temporary local variable os on intermediate buffer if you need to use the
outpu t value of a preceding opera t·i on in a Following operation.
7 If a network hos two or more parallel branc hes starting al the left rail, each of which
has two or more integer arithmetic boxes in series. the order of p rocessing is from
!ell-to-right starting with the top b ranch. lhen the second branch. and so on.
8 Use sta tus b it OV to check tor on overflow ofter each operation, or o fter a series of
operations use the OS sta tus bl1. Also use sta tus bit instruc tions to determine If the
result is negative. zero. or positive (e.g., <O, = = O. or >OJ. See Status Bit Instructions.
271
STEP 7 in 7 Steps
Essential Elements
Entry o f each REA L arithmetic operation will require you to specify the source values Fo r lhe
c a lculation al parameters INl a nd IN2; a nd the result location at the O UT pa rameter. Valid
en tries for IN 1 and IN2 include o REAL constant in the permissible(± I .75495e-38 lo±
3.402823e+38), local variables o f d a ta type REA L, or double word locations (e.g .• DB22.DD 12
or MO 44); the OUT p arameter may b e specified as o loca l va riable of type REAL or a double
word memory loca tio n (e.g., 0B22.DD16 o r MD 42). The enable input line EN allows control
logic to determine if the opera tion is exe c uted. When EN is a l log ic I, the operatio n ls
executed a nd the resull is p laced in the specified location. The ena ble o utpu-t line ENO ,
sig nals execution o f the o peration a nd whether on error occurred.
Application Tips
After a REAL calculatio n, you may use Sta tus Bit instruc tions to determine if the result is
nega tive, positive. or zero, or if one of the input values (IN I /IN2J is on Invalid real number. If
an erro r occurs while EN is at logic I , ENO is set to logic O; o therwise, the status o f ENO follows
lhe status of EN. Use REAL instructions. when whole number accuracy is not suitable.
Net work 1 : RKA1 c alc u lation UJ!ling Addi tion and Mul t i p l ic ati on .
l ) Wilen the dl:iving logic 1, Truc (l ), the oddl.t 1on i , pecfo tmed and the ce, ult
in double • otd l!li66 is u11ed i n the aul ti:plicat ion,
I 1147 . 6 OS 1147. 1
272
Working With STEP 7 Programs a nd Doto
Hetwurk 1: REAL calcul ation usin cr Addi t ion and Mul tin licati on.
l ) Uhen the driVing logic: is Ttue(l), the addiuon is pert oo.ed and the ce wlt
in doubl e wocd lll)66 is Wied in the :aul t.:i~lication.
&
1'!3l. 4 -
AOO_R
1'1 31. S -0 - IN
5 .750000e+
001 - I Nl OUT - MD66
MUL...R
H062 - IN2 IND Ell
I
tret...,,rk 2: REAL Addition oE two f l oating~po in t numbers .
1) tt an er ro r cesUlt.11 and ENO i.s, ' o' a c.est. 1s made t oe an overtlow (OS)
i:csul ting ti:01 the entice calcula tion.
&
114 7 . 6 -<> 1147 , l
OS
I - - I
Figure 4-74. Example in FBD: REAL Multiply and REAL Addition.
GUIDELINE
1 Real (REAL) arithmelic operations ore in the Floollng-Poin t Functions folder of the
Program Elements lob. Use these instruclions, for 32-bit floating-poin t operations.
2 Bil instructions may be combined in series or parallel before the enable EN input
and offer the enable oulput ENO oulput o f th e a rithmetic box. lo achieve the
desired control logic that drives the inleger box operations.
3 REAL arilhmelic boxes may be inserted in series by connecting the ENO line o f one
operation to the EN line of the following operation. A following operolion is only
p rocessed If the preceding operation is processed without error.
4 Use a temporary local variable as on intermediole bulfer ii you need lo use lhe
outpu t value of o preceding operation in o following operolion.
6 If a network hos two or more parallel branches starting at the left roil. each o f which
hos two or more REAL ori lhmetic boxes in series. the order of processing is from left-
to-right starting with the top b ranch. then the second branch, and so on.
7 Use the OV status bit to check for o n overflow o fter ea ch operation. or after o series
or operations use the OS sta tus b ll. Also use sta tus bil instruclions to de termine if lhe
result is nega tive, zero. or positive (e.g., <O, = = 0, or >0), or if either input value was
on invalid REAL number. See Sia/us Bit Ins/ructions.
273
STEP 7 in 7 Steps
Essential Elements
Entry of each REA L moth function require the p a rameter IN be specifi ed a s the source value
used in !he function; a nd a parameter OUT. tha t designates w here the resul t is stored. Valid
en tries for both IN a nd OUT include local variables of data type REAL. or d ouble word
loca tions (e.g .. D822.DD 12 o r MD 44). The EN line, w hich determines w hether if the operation
is executed. may be controlled by conditional logic or connec ted d irec tly lo the left power
rail without cond itions. When EN is al logic 1. the operation is performed using the noating-
p olnl value specified a l IN and the resufl· is placed in the locatio n specified a t OUT. If the
opera tion executes without error ENO is set lo 'l '. If a n error occurs. ENO is set to ·o·.
Application Tips
Like with REAL arithmetic calculations. Status Bit Instructions may be used o fter processing
each moth func tion. to determine if the inpu t value (IN) is on invalid real number; or if the
result is negative. positive. or zero. The OV a nd OS sta tus b its ore b oth set if the result is ou tside
the permissible range. (See Slo lus Bit Ins/ructions. and Programming Sia /us Bil Operations).
l EN
SOR
DiO
I
DI
SORT I
ENO ~
H37 . 7
() I
#side>. - IN OTJT r f ASO IAB _SQ- DI OlTI' r fsideC
EN
SOR
DIO
I
#sidee - I N ourl,aso
EN
Al>D R
-DIO
I
f ASQ- I Nl OTJT l f AB_SO
,aso- IN2
Figure 4-75. Example in LAO: Moth Func tions - REAL Addition. Square. and Square Rool. In
this exa mp le, first the squa re of side-a (#ASG) and side-b (# BSQ) a re found then the two ore
added. and finally. the square root of the sum (# AB_SGJ is determined.
274
Working With STEP 7 Programs a nd Doto
S Oil
••• - EII OUT --IASO
#sideA - m EIIO
SOR
.. . --,E» ovr ....,aso
lsideB - IJI ENO 1 - - - - - - - 1
... -Ell'
Figure 4-76. Example In FBD: Moth f unctions - REAL Addition, Square, and Square Root,
II 1
GUIDELINE
Real moth functions ore in the Floating -Point Func tions folder ol the Program
Elements lob,
2 Each of the trigonometric functions (StN. COS, and TAN) assume on angle in radian
measure (Le .. 0 lo 2n, where 11 = +3, 14593 e+OO ) as o REAL number input ot IN.
3 Each of the ore functions (ASIN. ACOS. and ATAN) assume a REAL number 1hot foils
within o specific range (i.e .. • 1 to + 1, ASIN; • 1 to+ 1, ACOS: entire range, ATAN). os o
REAL number inpu l of IN.
4 Contoc l instructions may be inserted in series or parallel before lhe enoble (EN)
input. os well os after the enable output [ENO) of math functions.
5 Moth functions may be inserted in series by connecting the ENO line of one function
box to the EN line o f the following function box.
6 Moth func tion boxes may be inserted in parallel if placed in o branch tho! begins
direc lly connected to lhe le ft power roil or lhe nelwork. In such o case, the nelwork
must be terminated with on output.
7 If o network has lwo or more parallel branches starting at the left roil. each of which
has two or more math function boxes in series, the order of processing is from lett-lo-
righl starting wi th the lop branch, then the second branch, and so on.
8 Use the OV status bit lo check for an overflow o fler each operation, or after o series
or operations use the OS stalu s b it. Furthermore, use slo lus bit instructions to
determine if the result is negative. zero. or positive (e.g .. <O, ==0. or >O). or if the
input value was on invalid REAL number, See Status Bit Ins truc tions .
275
STEP 7 in 7 Steps
Essential Elements
A Lobel instruction, whic h moy consist of up to lour c t1orocters, is otwoys the d estination to
whic h a jump instructio n is d irected. Labels may consist o r up lo lour a lphanumeric
characters. the first of which must b e on a lphabet. There o re two LAD/FBD jump instructions.
lhe JMP and JMPN. The JMP con be programmed with or without p receding logic conditions.
With no conditio ns, the JMP is always executed. With logic conditions. the JMP is only
executed w hen the result o f the logic operation (RLO) is logic 1; ii the RLO is lo gic O.
execution con tinues with lhe following network. The JMPN instruc tio n must be progra mmed
with p rec eding logic. IF th e result of the logic operatio n (RLO) is logic 0, the jump la b el is
executed; if the RLO is logic 1, execution continues w ith the following ne twork.
Application Tips
Jumps may be executed in the forwa rd or b a c kwa rd d irection. However, o jump mode
inside an MCR zone must be too Lobel inside the so me zone. Finally. while severa l jump
networks may be directed to the some lab el. o label must appear o nly once in o b lock.
I 14 . l CASl
1 :1-- - - - - - - -- (JHP ) -j
1
Ke~rk 2: Condi t ionalto CASE No. 2
J UllD
l) When I4. 2 i-s at logic l JUllp to Cue Bo . 2
2) Oth.etwise pcocess 1:be next neaiotk.
I I4.2 CAS2
1 : 1 - - - - - - - - - - ( JMP )-1
1
Kctvvrk 3: Con dition a l J WRp to Ci SE No. 3
1) When I4. 3 i3 at logic l JUJ1p to case 1Jo. 3
2) Othetv:1,se -process the next netarock.
~
I _4 .,1
.--3------------I(CA.53
L JMP)-1
276
Working With STEP 7 Programs a nd Doto
CASl
I
I IS. l I S. 2 OS , 7
r-': I: () I
tretmrk 6 , Ret.w:n to calling block
l) Vhen po11ec flows to the Retum irusti::u~ci on, pcogcu conuol iii pesiied back
to the block fron whicb the current. bl ock "1SS celled foc proc:ealfing.
I I S .l
, 1: (RIT) -]
CAS2
I IS. 4 os. 7
~S:l
I: () I
lfetvork 8 : Re1;w:n to callin11 block
l) Uhen power tl~r.,s co the RetUin instr:uctlon, progtea conr;,r ol is passed back
to the bloc1t troa which the cw:cenc block wu called t oc proc.e ssinc;.
I IS. l
, 1: (RIT)-j
Figure 4-78. Jump lo Lobel in LAD: Each Subroutines ends with a Return.
GUIDELINE
1 Jump and Label operations are in lhe Jumps raider of the Program Elements tab; the
return operation is in the Program Control folder.
3 Each label must be unique within a block: however, multiple jump coils from wilhin o
block may target lhe same label.
5 If a jump instruction is used inside an MCR zone, the target label must also be inside
the some MCR zone and MCR area.
6 The JMP coil is used lo jump on RLO = 1 and may be triggered conditionally (with
preceding logic conditions) or unconditionally (without preceding logic conditions).
7 The JMPN coil is used to jump on RLO = 0 and may only be triggered conditionally
(with preceding logic).
277
STEP 7 in 7 Steps
Essential Elements
There ore four basic MCR operations. Eac h instruc tion, when programmed. is poiced with one
of fhe o thers. The MCR Activate (MCRA) and the MCR De-Activate (MCRD) instruc tions are
paired to control activating a nd deoctivating use of the S7 master c ontro l relay fu nction. The
MCR zone Start (MCR<). and the MCR zone End /MCR>), a re paired to create a zo ne in
which logic networks ore enclosed. Networks inside a n MCR zone ore processed only if
power flows (i.e., RLO = 1) to lhe MCR< instructio n. If MCR zone dependency is switched ON
(i.e ., RLO to MCR< transitions to RLO = 0) then a ll o utputs are reset lo zero, except the
Set/Reset ovtputs and flip-flops, which maintain their last sta tes. A value of zero is written to
all digita l values or variables in b ox inslruclions.
Application Tips
MCR zones may be p laced o ne inside another with up to eight nested MCR zones. If MCR
zones o re nested. th e firs! MCR zone con trols the dependency switching for a ll of the zones.
...
I - - - - - - - - - - - - - - - {HCRA} -,1
Afttwork 2: Stace or ~CR zone 1.
ua·,
I .
,,_o_ _ _ _ _ _ _ _ _ _ _ _ __
(MCR< }-<J
Aet110rk 3 : Title:
I 0.7 14,3 08.5
: - - -1~- ------------oc )1a-- ,J
--:• -
M0.6
.;...._
1 _ _ _ _ ___,,r, )--J
ll'elllOrll 4 : Titl e :
1
~ - - - - - - - - - - - - - (Mcit> H
1
lletwrk 6 : Title:
I 1=~-l/:1 -- - - - - - - - -( )-{I
17V:
MS. S 14. 7 tl69 . 0
.
1-
1
- - - - - - - - - - - - - - - - - - . :McRD_h1
Figure 4-79. MCR Example: A single MCR zone.
278
Working With STEP 7 Programs a nd Doto
GUIDELINE
1 MCR operations ore in the Program Control folder o f the Program Elements lob.
2 To use the MCR capability in a block, you must define an MCR area w ithin a block:
MCRA (activate ) defines the slart of lne area and MCRD [deactivate) defines the
end of the oreo. MCRA and MCRD coils o re connec ted d ireclly to the left power roil
without logic conditions.
3 An MCR zone is defined as the networks between a zone start instructio n 'MCR<'.
and the zone end instruction 'MCR>' .
4 The MCR< coil, w hich stam o zone, must be driven by conditional logic.
5 The MCR> coil. which ends a zone. must be directly connected lo the left power roil,
without conditional logic .
6 MCR zones may be nested up to o depth of eight - that is. eight zones may be
opened using the MCR< coil, before a zone is closed wi lh the MCR> coll.
7 Overall MCR nesting depth is not ollecled when a new block is called from within
on MCR zone. The current MCR zone remains o pe n in the new block.
8 When a new block is called from within on MCR zone. the c urre nt MCR zone
remains open in the new b lock altho ug h MCR use must first be re-aclivoled with lhe
MCR-A c oil.
279
STEP 7 in 7 Steps
Essential Elements
Parameters tNl and IN2 must be specified as the source values of each word logic operation
and parameter OUT as the destination for storing the resull. The enable line EN may be
programmed with or without preceding control logic to determine if the opera tio n is
executed. When EN is a t logic 1, th e o peration is performed bit-by-bit, using the two values al
IN 1 and IN2. and placing the resul I in the corresponding bit positions in the location specified
at OUT. The enable ou tp ut ENO is set to ' 1'. signaling executio n of the operation.
2)MW122 is AHDed vi.th hex FF'f'O. The result is stored in H1iT124. Toe ooal is to
c lear the l o11e1: 4-blts ot 9122, and keep the uppet bit. values es th.e y were.
WA.ND_W I H99. l
{)
EN £110 I
2) 1118 (Input 1iocd) is ORed vi th the local viu:iable #patt.Un l . The result is
stored in 0118. -
WOR_W I M99 . 2
(}
DI DIO I
IPaccecn_ 1- n 12
280
Working With STEP 7 Programs a nd Doto
2) ! D12 (I nput l)oub.le liJotd) J.:S XORed v1 th the loca.1 vai:1eble fpettecn_2 . Tbe
result- is stored in lml30.
- - I
WXOR OW M99 .3
EN -END () I
llet-rk 4 : Title:
l) !99.7 is set ~f the i:esultenc val\le of the pi:e11iow, XOR (in HI) 130 ) is zeto,
I,, : ==O
M99. 7
(s} -1
Figure 4-81. Example in LAD: Word XOR (exclusive OR) opera ti on.
GUIDELINE
1 Word logic opera lions ore in lhe Word Logic folder of lhe Program Elemenls lob.
You moy insert contact instructions In series or parallel before the enable (EN) input
and ofter the enable output (ENO), to creole the desire control logic.
2 Word logic boxes may be inserted in series by connecting the ENO line o f one logic
box to the EN line o f the following logic box. A box in series is only execu ted if the
preceding box is processed without error.
3 Word logic boxes may be inserted in porallel if placed in a b ranch lhal begins
direc tly connected lo the le ft power rail or the network. In such a case, the network
must b e lermlno led with a coil.
4 If a network hos two or more parallel branches starting al the left roil, each o f which
ho.s two or more word logic b oxes in series. the order of p rocessing is from left-to-
right starting wi1h the lop branch. !hen the second branc h. and so on.
5 If the resultant bil-paHern al OUT is not equal to zero (all bits = O), CC l of the status
word is sel to ' I '. You may use the >O contact instruction to check for not equal 'O'.
6 IF the resultant bil-pallern at OUTis equal to zero (all bils =OJ. CC I or the status word
is set to 'O '. You may use the,,. = 0 contact instruction to check for equal ·o•.
7 You may use status bi t con tacts instruc tions to check the result or a logic operation
for all bits equal to zero or not all bits equal zero. See Sta tvs Bit Instructions.
281
STEP 7 in 7 Steps
Essential Elements
Para meter IN must be specified as the source value o f each shift-rota te operation, a nd
parameter N os the number of positions to shirt or rotate the doto. The enable line EN. which
d etermines if the operation is execuled. may be programmed wilh or without preceding
logic. When EN is at logic 1. the contents of the WORD. DWORD. or integer (INTor DINT)
variable are shifted (or rota ted) by N -bit positio ns and the result is p laced in the loca ti on
specified a t OUT. The e nable output ENO is set to · 1·. signa ling execution of the operation.
In a shift operation. the bits vaca ted on the shill e nd are filled with zeros and the b its shifted
out o n the opposi te end o re lost. In o rota te operation. bits shifted out on the for end ore
used to fill lhe b it positions vacated at the opposite end. Integer a nd double integer shift
operations shift lhe b its o f a n integer variable. thereby changing the in leger value, but While
maintaining the original sign bit. The b it positions vacated by shift integer operations o re
olwoys filled with lhe original sign b it (bit 15 for INT values. or Bit 31 for DINT va lues).
Application Tips
A lyplcol applic ation of the shift opera tion is to mulliply or d ivide o variable by any b inary
multiple o f two (i.e., 2. 4, 8, 16. etc.}. The variable o t IN is multiplied by 2, simply by shifting lhe
variable contents to the tert by one. Shlrling two posilions lo the lert mulllplies by 4. a nd so
on; conversely, shifting by 1 position to the righ t. results in division by 2: shilling 2 places lo the
right resulls in division by 4, and so on. The shirt operation is ofte n used in this manner. lo index
o value lhot controls on operation or w he n indexing o memory pointer value.
Krllunrl 1 : Ti ~I r-:
IColllitnt:
l
I I ¢. I
'I 01
'~'-""'
rno
I $H"-""'
;:ir IIJIO
I
' lll)40 - 111 OITTr l044 lJ!) «- UI OV1'r KD46
~.fl ~fl - ~ '11 1611 - !t
I 1(.2' ROL w, I
II !II - t!IO
trl1 6f 2 -K
Nettmrk 3 : Tltt e: :
ICOl!Jlel\t:
j
I l 4. 3 GHA-_I 1
IJ 111 i:uu
IC./)0 - .Iii OITTr l!'JlZ
1!'110 - Ii
282
Working With STEP 7 Programs a nd Doto
Guidelines
1 Shifl-Ro tote operolions ore in the Shift-Rotate folder o f the Progrom Elements fob .
2 Contact instructio ns may b e inserted in series or parallel before the e nable (EN)
input and ofter the enoble output (ENO) of shift and rotote instructions.
3 Shift-rotote boxes may be inserted In series by connecting the ENO line of one box lo
the EN tine o f the following box.
5 If o network arrongeme nt involves two or more parallel branc hes, ea c h o f whic h hos
two or more Shift-rotate boxes in series, boxes a re evaluated fro m left-to-right starling
with the first branch. and so o n.
6 In shift func tions bit positions vacated o fter 1he shift ore filled wii h zeros. excep1 in the
case o f shill integer and shill double integer. where vacated positions are filled w ith
the value o f the sig n bit of the original number (i.e., plus= ·o· minus= · l ').
7 In shift-rotate !unctions. the shift parameter (N), moy be o vo rioble or cons tant: if
equal to zero. the operatio n is not executed; is greoler !hon the highest b it position
( 15 in the case of word variables. 31 in the case of double word variables. then zero
is placed in the result locotion OUT.
8 Shift integer operations a lways cause the variable lo be d ivided by o bina ry multiple
of 2 (i.e.. 2, 4, 8. 16, etc). Shift by 1 divides by 2, shift by 2 divides by 4, shift by 3
d ivides by 8, and so o n. The result is a lways the whole number o tter round ing down.
283
STEP 7 in 7 Steps
Essential Elements
The overflow (OV) and overflow stored (OS) slo tus bits are bo th se t al the firs l time in a b lock
where on arithmetic or moth operation exceed the permissib le range. The ov bit is reset a t
the next occurrence of a n error-free arithmetic opera tion , and therefore c on be checked
immediately a fter each o peration. The ov bit remains se t until o new block coll. therefore
con be used lo check fo r overflow o fter a series of calc ulations. The unordered [UO) sta tu s
bit indicates that a t least one of the values inp ut lo o previous REAL opera tio n was invalid.
Application Tips
Condition code bits CCO and CC 1 o re bits of the status word tha t rep ort various results otter
integer and REAL oritl1metic opera tions, as well as ofter compare, conversion, word logic.
and shiH o pera tions. Th e various results indicated by CCO a nd C C I ore mode available lo
the user prog ram via the so-co iled Results Bits which where briefly d escribed bock ln Tobie 4-
21. In lhis toble. contact instructions ore listed for c hecking the results o f a ny arithmetic or
moth function rela tive lo zero (e.g .. equa l zero. nonzero, positive. negative, and o verflow).
Additional results. w hich con be evoluoted in your program. ore p rovided in Appendix E.
2)ID12 (Input Double 1101:d) is XORed nth the l ocal variable #pattel:n
result 1, stoted in HD1 30. -z. The
WXOR_ DW I M99 . 3
.---- --EU tl10 ; - - -- - - - i ( ) ~I
#Pattem _2 -1112
RetUDrl<. !j : Ti tle :
1) If the result value of t.he XOR istoced in HD 130 is z.ei:o , M9 9. 7 iis ~et.
~~ o M99 . 7
~-I :1-----------(s}-I
Figure 4-83. Example in LAO: Status Bit operation. using o Result b it Equal Zero contact.
284
Working With STEP 7 Programs a nd Doto
Ketuo rk 3: Usina St.atus bit:l! t.o check tor ovei:f lov and invalid Real v alue.
l) The t.wo teal values at. ml and 1112 a1:e alvays added and then t.be result
1s aultiplied v.th the val ue in IID12. Toe result is stored in HD16,
I ADl>_R I HlOl.7
(1',
05 1144. 6
;EN l:Jll) INOT '. I! (s}-1
l . 537500e+ uo 1144. 7
001 - INl
Otn' I MD66 - ) NOT: I! (s}-1
HD62- IN2
EN
MUL R
- ENO
I
MD66-!Nl our I MD16
MD12-IN2
GUIDELINE
1 Status bits operations ore in the Status Bits folder of the Program Elements tab.
2 Use results bit instructions /e.g .. < 0. = = O, > 0) immediately ofter any arithmetic or
moth function, to check the result relative to zero. These instructions moy be
combined In series or porollel logic Vvilh other b it Instructions.
4 Use the UO (unordered) stolus bit instruction immediately ofter a REAL arithmetic or
moth function, to check ii either o f the input values to the operation was invalid.
5 Additional result information is available for arithmetic and moth functions, as well
os for digital operations (e.g.. word logic , comparison, shift, and conversions), using
status bits CCO a nd CC I (condition code bits). Combinations of CCO/CCl (e.g ., 0/0.
0/1, 1/0. and 1/1) may be evaluoled using lhe results bil contac t instructions. See
Appendix E.
285
STEP 7 in 7 Steps
3) The concen,:;5 ot local memocy double wrd (LD6) is al ways moved to double
wotd 72 (Ml)72) of the bit. ae:aocy uee.
4 ) When M22.5 is Ttue(l), e 50 :,ec tiaec preset is cop ied to dato bl ock DB30
data word 1 2 (DB~l2).
I !f22 . 7 MOVE I Ml Ol . 7
II Di EBO () I
IIJ4 - Dl OITI' ~ MD 60
l'l22 . 6 MOVE I
II Ell £110
£11
MOVE
£NO
I
LD6- Dl our r MD 72
!'122. 5 MOVE I
II £N £NO
Figure 4-85. Example in LAD: Move operations using d ifferent source/destination areas.
286
Working With STEP 7 Programs a nd Doto
2) Vhen 1123. 6 is Tcuc (11, the hex con:,cant Ull6f 01'U 1, wtlt.ten vie pcc tphcre.L
11.e1101:y (PQW4) , d1%ccely i:o tl\c .L6- b1i:s of the cl1g1tel oui:puc aodulc vhose
start. byte address ~s outpui: byte 4 (0B4) in the output 111ege.
3) The 1:aw dot4 ot anG.l.og lJUJUC (PIV256 I :I,:, olways read fto11 the t1rst analoc;i
cbannel ot the 37-300 and trllllsterred to data block 30 vord 20 (D&30.DBV20).
4) Data block 30, vord 20 (DB30.DBU20) is always copied to the second ma.Log
ou,:pue channel of the S7-300, via petipheral output vocd ~sa ( PQV2581.
~ - - - -Ell
MOVE I
!110 - - - -- i
Pil/256 -_Dl
___
OOT
_,rDB30. 0B020
. - - - - -E>l
MOVE I
!HO . - - - - - - '
GUIDELINE
2 If the size o f the variable at IN Is less than the size of the variable at OUT. the data is
moved into OUT right-justified; the bits lo lhe lef t ore filled with zero. For example, if o
WORD variable is moved too DWORD vorioble. then the word is moved to the right-
most 16 bits of OUT; the le ft-most b its ore filled with zero {Network I. branch I ).
3 If the size or the variable at IN is greater than the size or the variable ot OUT. the
least significant bytes of the variable a t IN, tho1 fit into the variable a t OUT. ore
moved info OUT. For example, if a WORD variable is moved to a byte variable. then
the least significant byte of the WORD variable is moved lo OUT (See Network I,
branch 2).
4 Use lhe MOVE box lo read digital inpuls d ireclly from the module; reference lhe
input start byte address o f IN . Use the MOVE box to write d igital outputs d irectly;
reference the digital output start byte address al OUT (See Ne/work 2. branch I and
branch 2).
5 Use the MOVE box to read row data from on analog input module; reference the
analog input channel address at IN. Use MOVE to wri le o value lo on analog output
module; reference the onotog output channel address o t OUT {See Ne twork 2.
branch 3 and branch 4 ).
287
STEP 7 in 7 Steps
l
- - - - -EH EJIO . - - - - - - - ( )f--
llet-wurk 3: Open DBl l to access data l oca t ions in the f ol lowin g netuotks .
I
.-
· - - - - - - - - - - - ( OPN}-1
DBll
I
fret work 4 : Hove 111 1!110:ry liOtd 20 ( eccuelly 0B1"120 fi:oa DBlO) to DBil20 of DBll.
Move I
ruo1. z
~ - - -£Jr El l O ~ - - - - -,( } -I
_ _ _ _ _ £If
MOVE I MlOl. 3
.ENO ~ - - - - - - ,( ) I
DB10 . 0Bu20 - m our loa11. new20
Figure 4•87. Accessing dato locations using partial and using fully-addressed operands.
288
Working With STEP 7 Programs and Doto
D8100
EH
FBlOO
ERO
I
I
lfet11or :k 1 : Cellina second insc.ence of 1"8100 ; the DB must be soecified.
Comtent:
DBlO l
EN
FBlOO
l!:110
I
Figure 4-88. Specifying the Instance DB; the DB is opened when the FB is coiled
GUIDELINE
'
The OPN DB coil is in the DB Coll folder of the Program Elements lob.
2 The open DB coil con only be used to open a g lobal data block. and may only be
used in LAD and in FBO.
3 Only one OPN DB coil may be programmed In a network and it must be without
conditional logic or other parallel ou tputs.
4 Following the OPN DB instruction in LAD. FBD. o r STL. you may reference data
locations of the specified DB, using partially addressed operands for data bi ts. by1es,
words, or double words (e.g., DBXS. l , D884. DBW20, D8D4). The open data block
may be accessed until o new data block is opened.
5 In LAD, FBD, and STL you may using fully addressed operands for bits. bytes, words,
and double word locolions of g lobal data b locks. Full addressing means that you
specify the DB number and location. For example DB I O.DBW20, is DB 10 word 20;
DB 1O.DBX8.1. is DB I O byte 8 bit 1.). The OPN instruction is no t required in this case.
2 Following the OPN DI Instruc tion in the STL {Statement Lis t) editor only. you may
reference data locations of the specified instance DB, using partially addressed
operands for data bits. by1es, words, or double words (e.g.. DIX8. l . DIB4. DIW20.
D1D4). The open da1a block may be accessed until a new data b lock is opened.
3 The instance DB is also opened in STL in the call statement for colling the FB (e.g ..
Coll FB 100. DB I00).
289
STEP 7 in 7 Steps
Essential Elements
Generally, most logic b locks of o STEP 7 program will be called either directly from 08 1. or
from anolher bloc k (e.g ., FC. or FB) thol is called from OB 1. The calls from OB 1 will be largely
d ependent on how you have d ivided the functional control tasks into blocks and fhe
processing requirements of each of these blocks. Blocks should be called from OBI if they
must be processed on each CPU cycle. or at least evaluated on each cycle bu t processed
only if certain enabling cond itions are met. When 08 l is used strictly for calling code b locks,
the task of testing. sta rtup. a nd d iagnosing problems in the program. w ill be much easier.
Application Tips
As you develop new blocks. especially o fter the orig inal startup. be sure that each newly
c rea ted block is called either directly from OB I . from anoltler b lock that is called from OB I.
or either d irectly or indirectly from another organization block.
FCl
i - - - - - - - - - - - - - - -( CAtL}-j
FC3
~ - - - - - - - - - - -,( CALL )-1
FC S
. . - - - - - - - - - - - - - -,( CALL )-1
f C7
~ - - - - - - - - - - - -( CALL }-I
Figure 4-89. Unconditional calls to b locks from OBI (organization block 11.
290
Working With STEP 7 Programs a nd Doto
I 1s. 3 f C2
( CALL )-1
I I:
lletvork , : Call Progt:8JI SeQment. lllllll)e t 6 Condi t.ionelly.
l) Coll fC4 it IS. 4 OR I S. S 1s ec. logic l; otherwise proceed t-0 lle wotk 7.
I IS . 4 , C4
ns.:s I
, 1
(CALL )-1
08100
I4.2 I
~ ·i .1 : t.11
flll OO
EJIO I
D8101
I4.3 14. 4 m100 I
I l: I f-irn FNOI
Figure 4-90. Conditional calls to blocks in OB 1 [organization b lock 1).
GUIDELINE
3 08 1 should only contain unconditional or conditional calls to FCs, FBs, SFCs, or SFBs:
control logic for driving oulpuls or olher p urposes should not be p laced In OB I.
4 Program all uncondilional block coils firsl. using o separate network for each coll;
make unconditional calls to blocks that must be p rocessed on every CPU cycle.
5 Program all condilional block calls following the unconditional calls. using a
separate network for each coll. The entire conditional logic for o block coll should
be placed in one network.
6 Make conditional calls to b locks that musl b e p rocessed whenever the driving logic
conditions are met. If the RLO = I the block is processed; if the RLO =O the block is
not p rocessed and the following nelwork is evaluated.
7 Except for instance DBs, opened with associated function b locks, ovoid opening
data blocks In OB I. Global data b locks (D8s) should be opened in lhe blocks where
used.
291
Managing Online Operations
with S7 CPUs
STEP 7 in 7 Steps
If there is on MPI subne t with several CPUs connected, then each CPU must hove a unique
address. Initially, and before parameters ore downloaded, each C PU is hos the default MPI
address of '2.' You con set o new MPI address for each CPU as you assign the CPU
parameters for the stations of a project. Before connecting all of the CPUs to the subnet, you
must make direct a connection between the PG/PC and each CPU, to download the
hardware configuration. By downloading the Sys/em Dalo objec t fro m the Offline Blocks
folder o f the associated S7 Program, the new MP! address assigned in the hardware
configuration will lake affect immediately.
294
Managing Online Operations with S7 CPUs
- 1□1~
(m MPI • 5 (direct)
All of the hardware configura tion data for each station is stored In the System Dalo object,
which is located in the offline blocks folder of the associated CPU program. When these
components ore completed. you may then download individual blocks. or the complete
user program, which includes the Sys tem Doto object . If you wont lo download modifications
lo the Hardware Configuration only. then only the System Dalo needs to be downloaded.
Changes or modifications to the connection table con be downloaded from the Network
Configuration tool. or from the CPU objects folder. Core must be token to download
changes to all communications partners.
295
STEP 7 in 7 Steps
To test individual blocks. you must download the block (e.g., FC, FB). and the block that call
the block lo be tested (e.g., OB 1). Required data blocks must also be downloaded.
Compare Olock1
Twe cl compari;on· r
♦ ONUNE/Olflirle r Palh 1/Palh 2
P' Including SDBs
P Execute code compai;on
r lnclo,!ding blocks created n different programmsig languages
- Selected- - - - - - - - - - - - - - - - - - - - - - - - ,
P~ 1: Moking,fat-4\SIMATIC 400(1)\CPU413-1\S7 Ptogram(1)
jBlocks
-Compare wit~. - - - - - - - - - - - - - - - - - - - ~
Pa\b 2.
OK
I Cancel I Help I
Figure 5-3. Compare Blocks d ia log: Online/Offline compare selected.
296
Monoging Online Operations with S7 CPUs
To configure the Po th I /Path 2 compare. simply select the block folder or the individual
blocks you want to compare. Your first seleclion is entered inlo lhe dialog box as Pa th I . You
may then select o second block folder or selected b locks. which will be entered into the
dialog as Po th 2.
Compare Blocks
!Blocks
Compace w~h... - -
Path 2 New_pii\57 F'Klgr61T!(l 0)
!Blocks
OK I Cancel Hefp
297
STEP 7 in 7 Steps
298
Monoging Online Operations with S7 CPUs
Like in preceding chapters several brief tu torials hove been presented here. to offer a quick
overview of handling online operations. In the remainder of this chapter examples of
siandord online operolions such as accessing the CPU online without o projecl. uploading
and downloading blocks. comparing online and offline blocks. clearing C PU memory.
switching CPU operating modes, accessing a password protecled CPU ore all presented in a
step-by-step manner. The following checklist highlights some of the key points in working
online with the S7 CPU.
• Go online with a specific CPU using Ille ossocioled project and the Online
Project Window or without a project, using the Accessible Nodes Window.
• Verify the resources of o CPU: using on onfine connection, select the CPU
then right•click ond select Module Information, then select the Performance
Doto lc,b.
• Verify tha t the CPU Dote and Time are set correctly lo ensure accurate lime
stomping of messages sent to the CPU's diagnostic buffer and /he triggering
of Time-of-Doy interrupts.
• Before downloading oil blocks to the CPU. clear memory first to ensure fhol
a/I old blocks ore removed from the CPU ond that the CPU Is re.fnffiollzed.
• If changes are made lo a ny port of the hard wore configur-alion. you only
need lo download fhe system Doto object of fhe associated station. The
System Dato object is located in lhe offline Blocks folder of th e associated
CPU.
• When downloading individual bfocl<s, with the CPU Is. in the RUN-P mode, you
must ensure that called blocks ore transferred to the CPU before colling
blocks.
299
STEP 7 in 7 Steps
Essential Elements
With o d irect or networked MPt link to the CPU, using the Accessible Nodes utility you con
access CPU module information, set lhe CPU c lock. c lear and reset memory, switch the CPU
operating modes, and transfer blocks to and from the CPU. As shown in the figure below, the
Accessible No d es window will contain on S7 fold er for each of the active S7 sta tio ns !h at con
be reached. Each fo lder. numbered w ith lhe MPI address assigned to the CPU. contains the
online blocks of the CPU. Th e PLC operations are accessed by selecting the desired folder,
then from the menu or lhe right click selecting PLC menu.
Application Tips
You con also access monitoring and diagnostic tools including lhe Monitor/Modify Variables,
Hardware Diagnostics, and the CPU Diagnostic Buffer. Monitoring and d iagnostic tasks o re
discussed in the following chapter. Allhough you may gain access to the program and data
for any CPU opened through the Accessible Nodes utility, this method should be reserved for
monitoring and troubleshooting. Editing CPU programs and doto w ithout the project is nol
recommended, since it could result in the loss or d istorting of critical project information.
Figure 5-5. Displaying active MPI slolions found using th e Accessible Nodes utility.
300
Managing Online Operations with S7 CPUs
ACTION
'
1 Launch the SIMATIC Manager application from the Windows Start button.
2 From the menu. select PLC ► Display Accessible Nodes. or from the toolbar p ress
the Accessible Nodes button. Each CPU that con be reached on the MPI subne t is
d isplayed OS a folder ldenlified by the MPI a ddress assigned lo the CPU.
3 Select the Accessible Nodes folder ond then rrom the menu selec t Vlew ► Expand
All lo view lhe online Blocks folder o f eoch CPU.
4 Se lect the Blocks fo lder ol the desired sto lion, then From the right pone double-click
on the block you wish lo open or righ t-click o n the b lock ond select Open Object.
5 To view performance chorocteristics or o CPU. right click on folder ond select PLC ►
Module Information. See task "Viewing CPU Resources a nd Performance Doto."
6 To view or change the operating mode of o CPU. select PLC ► Operating Mode. See
tosk "Viewing a nd Switching CPU Opera ting Made."
7 To open the dialog for erasing th e CPU memory. selec t PLC ► Clear/ Reset. See task.
"Memory Resel from the SIMATIC Manager."
8 To open the dialog For adjusting lhe CPU c lock, select PLC l- Set Tlme of Day. See
tosk "Selling the CPU Do le a nd Time."
30 1
STEP 7 in 7 Steps
Essential Elements
CPU resource inrormo tion is resident in the CPU and is accessed via on online conneclion
from eilher lhe SIMA TIC Manager or lhe LAD/FBD/STL edilor. Module Information for lhe CPU
d efines features such as memory and 1/0 expansion limits, lhe total number and address
range ror timers. counters, ond bit memory, and ror d ig itol 1/0. This inlormolion also reports.
the number of each user block type is supported (e.g .• FB. FCs, 08s, DBs), wha t syslem blocks
ri.e., SFCs, SFBs) o re available. and the length o l the local dala stack.
CP4A3+ 2===========I
I!! CP 4'3-5 8 0®« 0cl
Iii 11!1 LAB_S7300_1 I ,.._._
l•l !iii SIIMT IC 30011 nscrt New vv,...t •
F1.C ►
~H!!l S7_f'rogran(ll
Pl fii) S7_Progar,(13
CR.I l"3-sSIJQ6S. •'
,,,.,,to,/1'-odfv v....i.1os
R...,.. F2
Obied ~erties-, A,'t+Rot<rn ~ • • °"'91os!u
Spcciol Obiecl l'rc>pOflln ►
o,,e,~,...... . Cttl+l
O~arJ11os«...
~ the '1atus d lhe s,eiea;d nx,dJe (~St.le bl.If«, - Y , scat Set Tmo d Oay .. , /4
Figure 5-7. Online PLC menu from right click o n CPU object.
302
Monoging Online Operations with S7 CPUs
AUg"mmt
f$iitt ... t,y,~, 100% ~
ACTION
1 Open the SIMATIC Manager and select the desired CPU from the online project
window or fro m the Accessible Nodes utility to select lhe CPU.
2 From the menu, select PLC ► Diagnostic/ Setting ► Module Information to view CPU
resources and performance data online (also from right clic k with CPU selected).
3 Select the Genero/ lob lo view basic information or the open C PU, includ ing its port
number, firmware versio n. and the rock and slot in which the module is insta lled. The
Slolus window d isplays information on lhe c urre nt operolio nol sto lus of lhe CPU.
4 Select the Performance Data lob to view o summary o f the C PU resources (e.g ..
number of each b lock type. available system blocks. add ress range of inpul/outpul
image ta bles. memory range for timers. counters, bil memory, and local memory).
5 Select the Memory ta b lo view memory resource d ata; the d ia log shows tota l bytes
of assigned ond free memory for bolh w ork memory o nd load memory areas.
7 Select the Scan Cycle Time lab. lo view !he longest. the shortest, a nd lhe most
recent (or lost) CPU cycle time , since the lo st change from STOP to RUN.
8 Selecl the Time System tab to capture and display CPU time and dote information.
run-time melers. a nd o lher lime related data for the open C PU.
303
STEP 7 in 7 Steps
Essential Elements
In the STOP mode, the CPU program is no t processed. and unless access protec tion is in
p lace, complete read/write access lo the CPU program and data is p ossible. In the RUN-P
mode the CPU program is being processed, bu t may be modified. When the CPU Is in the
RUN mode , the main program block (OBl) is being called cyclically by the opera ting system
to process the user program. ln lhis mode, 'Mile access to lhe CPU is denied and program
d ownloads or o ther 'Mite operations ore not possib le.
Operating Mode ·
304
Monoging Online Operations with S7 CPUs
Operating Mode
ACTION
I
1 To open a CPU without a project, start lhe SIMATIC Manager and from the menu
select PLC ► Dlsplay Acc essible Nodes or from the loolbor press the Accessible
Nodes icon; then. select a specific node address (e.g .. MPI = S). righ t click and setec1
PLC ► Operating Modes.
2 To open a CPU with o project. start the SIMATIC Manager, open the desired project
and then from the from the toolbor press the ontine window icon; then open the
station folder, selec t the CPU module, right c lick and select PLC l- Operating Modes.
3 If the current operating mode is RUN or RUN -P. you may switch the CPU to STOP.
If th e current operating mode is STOP, you may switch the CPU to RUN or RUN -P.
5 To restart, selec t Warm Restart to retain all DB data. retentive timers, retentive
counters. and retentive bi1 memory; non-<etentive data ore reset. Triggers OB 100.
6 To restart. select Cold Restart lo delete system genera ted DBs. reinitialize user DBs
from load memory. and rese t all other memory areas. including retentive. Triggers OB
102.
7 To restart. select Hot Restart ($7-400 only) to re tain all data areas. a nd restart program
at the point ot which it wos interrupted al the lost stop. Triggers 08 10 1.
8 Press the Update but ton to refresh the dialog ofter changes hove been mode.
305
STEP 7 in 7 Steps
Essential Elements
To c lear memory, you musi first switch the CPU to STOP mode. Clearing memory. deletes user
program blocks from the toad and work memory. Address areas o re all cleared. connec tions
with communications partners are b ro ken and cleared. and the CPU and other modules ore
re-initialized to their default state. Both the CPU's diagnostic b uffer a nd MP! add ress are
reta ined, In CPUs where the program is also stored on a Flash EPROM cord the program is not
erased. At power up the EPROM contents are transferred to the CPU's work memory. The MPI
address is overwritten by the address found o n the EPROM.
Application Tips
Memory reset is generally recommended before downloading your program for the first iime
or whenever reloading the entire program. Suc h a case may exist. ror example. if you
suspect faulty program operation or that lhe program resid ing in the CPU is nol the most
current. The CPU may also request a memory reset ofter determining tha t the program is
corrupt or just ofter a PLC operating system update is performed. A CPU reques t for memory
reset is indicated at the CPU by a slow flashing (1/2 sec.) of the STOP indicator.
I Yes
I No Help
I
Figure 5- 12. S7 C PU operating mode dialog.
Clec1r / Reset
Path:
IProL3\LAB_S7400_1\CPU 414-1
306
Monoging Online Operations with S7 CPUs
ACTION
1 Ensure that the CPU mode selec tor switch is switched to the RUN-P or STOP positions.
lhis opera tion is not possible if the key-switch is in the RUN posi1ion.
2 Start the SIMATIC Manager, open the desired project and select View ► Online or
press the Online Window icon to op en the online projec t w indow. Alternatively, you
may open the Accessible Nodes Window; press the Online Window toolbar icon.
3 From the project window, e xpand the d esired Station folder and select the C PU
module whose memory w ill be c leared; or fro m the Accessible Nodes window
select the CPU according to the MPI address.
4 Selec t the CPU object. right-click and select PLC , Clear/ Reset: Con firm your
intention to perform the memory reset by pressing the YES button. You will be
prompted to p lace the CPU in the STOP mode if necessary.
5 After a memory reset. you may download your program and then restart the from
the CPU mode selec tor switch or from the StMATIC Manager (i.e .. select PLC
Diagnostic/ Setting ► Operating Mode, and then select the Worm Res ta rt button.
I Switch the CPU mode selector switc h to the STOP position (The STOP LED will light).
2 Turn and hold the mode switch in the (memory reset) position, until the yellow STOP
LED blinks ot leas.t twice al a 1 second period. after which It will remain illuminated.
3 Release the mode selector switc h lo the STOP position: and immediately return to
the MRES position and hold for 4. 5 second s: the yellow LED will flash quickly while
memory is being cleared and wlll llosh slowly when done.
4 Release lhe switch back to STOP position and the overall reset should be complete.
5 Open the online blocks folder to verify the memory reset (System blocks should list).
307
STEP 7 in 7 Steps
Essential Elements
During normal operations. with level 2 or level 3 protections. upon each a ttempl to perform
certain online functions you will be p rompted to enter the required password. For example,
Monitor/Modify Variables or Upload/Download blocks. ore affected by protection level 2. If
lhe correc l password is entered. access is permitted lo modules for which a particular
protection level wos set d uring parameter assignment. You con then es tablish online
connections lo the protected module and execute the online functions belonging to tha t
protection level.
J l i\
Pastword: 11
OK
I Cancel j Help
I
Figure 5-1 4. Password access rights d ia log.
308
Monoging Online Operations with S7 CPUs
i4i,i,t§lii¥ii41MWJO·H (;\ t f t l - . 1 ~
I J
General J St<11l~
Trn~•Dey lr(er,~s
~ Level d Protecoon,=------,
I 4"Cle/Clocl<. Memc»_y
Cyclic Inlt'lrupC J
Retentive Memocy
Dlag00$tlct/Clocl,.
Mode- - - - - - - - - - - - - - - ,
lrtenuptt
Piotcc:lion
I
r 1: Keymitch Setting
(' Proces. Mode
P Ae:r.ov~e ••rtl?f'~R ,"IOld
Pe1111lltteo InC:S/lll 1n
r 2: w'11te>Protecbon Sec,, l:,IICl~ i llfle PY - "'5ff11r,cmm,.
r. 3; \1,11iw;/Read.f'rolecti011
Panwad: (.' Teu Mode
I, OK I Cancel , __H_e_lP_ _.
Figure 5-15. CPU Hardware Configura tion dialog for setting CPU Protection.
II 1
ACTION
Starl lhe SIMATIC Manager and open lo the desired project; use the Online Window
icon to open lhe project online.
2 Expand the desired Station folder and selec t the CPU module you wish lo access.
3 From the SIMATIC Manager menu. select PLC ► Access Rights ► Setup or with the
CPU selected right click and select PLC ► Access Rights ► Setup. then enter the
correct password when the access rights dialog box appears.
4 Activate the Use Password as Default c heckbox in order to use the some password
ror any o ther installed modules that ore password pro tected.
5 To cancel lhe access rights for the current session you may selec l PLC ► Access
Rights ► Cancel, at any time from the SIMATIC Manager menu. Or rf you ore done.
closing the SIMATIC Manager will terminole the c urren t CPU access rights.
309
STEP 7 in 7 Steps
Essential Elements
The CPU clock may be manually adjusted to whatever time you choose, or synchronized w ith
lhe sys tem time and dale or lhe STEP 7 PC or PG programming system. A lthough reot-lime
may not be req uired in your application, se tting th e CPU c lock with the correct time and
dole is still essential since the CPU c lock is used to assign the dote and time stomp to oil
events logged by the CPU Diagnostic buffer.
Application Tips
Not only con the C PU clock be adjusted manually as d iscussed here. but through the use of
system functions (SFCs) w ilhin your program, it is also possible to sel, stop, and read the
current date a nd time. The syste m fu nction for setting the dote and time is SFC O (SET_CLK);
the sys tem fu nction for reading the dote and time is SFC l (READ_C LK); and the system
function for synchronizing a ll CPU clocks is SFC 48 (SNC_RTCB). See Appendix B.
Apply
I I Close ] Help
I
Figure 5-16. Set S7-300/$7-400 CPU Dale/Time dialog.
310
Monoging Online Operations with S7 CPUs
I I Close
I I
Figure 5-17. Synchronize CPU Dote/Time w ith PC System Dole/Time.
2 Open the station folder and selec l the CPU module for which you in lend to set the
time and dale.
3 Wflh the CPU selec ted right-click and selecl PLC ► Set Time of Day; or from lhe
menu select PLC ► Diagnostic / Setting ► Set Time of Day lo open the C PU c lock
dialog.
4 In the Time field under Module , enter the CPU lime as hour: minute: second, in the
formal hh:mm:ss followed by om or pm.
S In the Dale field under Module , enter the CPU dote as month/day/year. in the
format mm/dd/yy.
6 Activate the "Take from PG/ PC" check box and then press the Apply button. lo set
C PU lime and dote to match lhe operoHng system time ond dole of the PG/PC.
311
STEP 7 in 7 Steps
Essential Elements
The memory compress operation is activa ted rrom the Memory lob of the CPU Module
Information dialog. With an online connection established you ma y open the project w indow
or 1he accessible no d es window. With the desired C PU selected in the online project window
or the desired MPI address folder selec ted in lhe accessible nodes window, right click and
select PLC ► Module Information, then select the Memory lob. The best possible compression
Is achieved when you compress memory w hile the CPU is In lhe STOP mode. Compressio n is
possible in the RUN-P opera ting mode - however b locks that ore being execu ted cannot be
shilled in memory whne they ore open. The compress function is not possible in RUN mode,
since memory is the n write-protected.
Application Tips
The memory comp ress operation may a lso be executed o n demand from your S7 p rogram,
using the system function COMPRESS (SFC25). When coiled lrom SFC 25, the complete
operation is performed over o number of CPU cycles. While still in progress, the SFC BUSY
ou tp ut reports logic 1: the DONE oulput reports logic l when the operation is comple ted. As
mentioned before, the memory gaps ore completely removed only when you perform lhe
comp ress opera tion with the CPU in STOP mode.
El~-
~l lill LAB_S7300_1
I1
1
i
$·1
1±1
) 1±1
Et! CJ S7_F
CP 343-1
"t
Ccpy,
CP 343-1 Paste
CP 3 4 3 - e - - - - - - - - - - - - - 1
$HID! __e_ _ _ _ _~
SIMATIC 30C _ OeJet D~
el - - -•
ijJ-CJ S7_Piog1aml Copy RAM to ROM ...
[B CJ 57_P,ogrlJITll
Ru1-Tlme F!ropertles... CPU Mes~s, ..
Display FOl'Ce Values
ReMrne F2
Monitor(Modfy Va-Jables
Object Properties, •, Al+Retu-n
Hardware Diagill>Stics
Module lniormatic,n... Ctrl+D
Operatill9 ~ . . . Ctrl+l
Clear/Reset...
Oisplll','$ the status of the seleded module (diagnostic btlfer, memor\ Set T~ ct Day., ,
Figure 5-18. Online PLC menu lrom right click on C PU object in online project window.
312
Monoging Online Operations with S7 CPUs
Assignmeri:
!sizes in bytes)
Compiess
I
I Close
I Update
I Prlnl... Help
I
Figure 5-1 9. CPU Module Informa tion: Memory tab.
ACTION
1 Start the SIMATIC Manager; open the desired project and Sia/ion.
2 Under the station. select the CPU w hose memory you intend to compress.
3 With the CPU selec ted righl-click select PLC ► Module Information.
5 Press the Compress button to eliminate gaps from the CPU memory.
6 Press the Update bu tton to refresh the dia tog ond view the compression results.
313
STEP 7 in 7 Steps
Essential Elements
To download an e ntire program or selected b locks. you must first ensure tha t th ere is an
established online connection lo lhe associated CPU. To download b locks. the CPU mode
selector switch must be in either the STOP or RUN-P operating mode. If you are operating in
the RUN-P mode during a download. you will be prompted lo switch the CPU lo the STOP
mode prior to the download and to restart the CPU ofter the download. If you attempt top
d ownload all b locks. you will also be asked if the Sys/em Data should be transferred. Recall
that the System Do to contains the station ho rdwore configuration. To download hordwo re
configuration changes only, simply selec I and download the System Data objec t.
Application Tips
Whe n downloading blocks. if the available load memory is too small you will be asked by
STEP 7 if you wish to compress th e CPU memory. Compressing the memory will make o la rger
contiguous space In me mory lo complete the download , by eliminating memory gaps. An
alterna te download method is to open both the offline and online project windows. selec t
the block folder of each program. then from the offline window select the objects you wont
to download and drag them to the online window.
·@ 57_P,ogiamfl t
:£·@) 57_P,ogrem[13)
Figure 5-20. Offline Blocks Window: Downloading offline blocks folder (all b locks) lo the CPU.
;i,11~ ~
data o OBl 0 0810 o FB t
I
LAB- S740(!- 1 B2 QF83 QF84 Q F85
£t1 lilJ LAB_S?300_1 25
~ WI
;i
SIMATIC 30~1)
f
I
i
aI cPU31s-20P
8 @:) S7 P1ogrom(l 8J
(g:J Sourca.
(iil Block~
:I
Q FC15
i
oFC20 QFC40
i
0 081
$ €i) S7_Prog am(l )
@] S7_Progam(l 31
Figure 5-2 1. Offline Blocks Window: Downloading selec ted o ffline b locks lo lhe CPU.
314
Monoging Online Operations with S7 CPUs
ACTION
Download Program:Wilh the ofrnne Bocl(s folder selec ted. download entire program
1 If your CPU is in the RUN mode, you will need to switch to STOP before attempting the
download.
3 With the SIMATIC Manager open to the required project. from the oflline blocks
window. double c lick on l he program fo lder under the required C PU, and then select
the b locks fo lder under lhe program.
4 With !he program folder selec ted, click on lhe Download icon from !he loolbar: or
from the menu select PLC ► Download. to start the download operation. When
prompted by STEP 7 as to whether a block already in the CPU should be overwritten.
You may respond Yes . All, None, No. or Cancel.
5 Choose Yes to overwrite the current block: All. to overwrite all blocks that already
exist in the CPU; None, to not overwrite any existing blocks; No, to skip the current
block; a nd Cancel. lo abort the Download.
6 Af1er a complete download. switch to the CPU operating modes d ialog and perform
a Worm Restart of the CPU (STOP lo RUN).
Download Blocks: Wilh the offline Blocks folder open. download one or more blocks
1 If your CPU is in the RUN mode, you will need to switch to STOP before attempting the
download. RUN P is a llowed.
2 With the SIMATIC Manager open to the required project and lhe desired CPU folder
open, selecl the offline Blocks folder. The b locks ore d isplayed in the right pone.
3 To select two or more non-adjacent blocks to download. press and hold the CTRL-
key down. and click on as many non-adjacent b locks as required.
4 To select o group o f adjacent blocks in a row or column, press and hold the SHIFT-
key. then c lick on the first the n the lost block of the row or column; press and hold the
CTRL-key down. and click on non-adjacent blocks lo include additional b locks to lhe
already selected blocks.
5 With one or more blocks selected, click on the Download icon from the toolbor; or
from the menu select PLC ► Download, lo start the download operation. When
prompted by STEP 7 as to whether a b lock already in !he CPU should be overwritten.
You may respond Yes . All, None, No. or Cancel.
6 Choose Yes to overwrite the current block; All. to overwrite all blocks lhat already
exis t in the CPU; None. to nol overwrile any existing blocks; No, to skip the current
block; a nd Cancel. lo abort the Download.
315
STEP 7 in 7 Steps
Essential Elements
To upload the entire S7 program or selected blocks of o CPU, you mus1 first ensure tha t there
is on es tablished o nline connec tion to the ossocio ted CPU. There ore no o ther requirements
for performing the upload unless the CPU is password protected. In this case. you will be
prompted to enter the correct password before th e operation can be c ompleted. If yo u
attempt to upload all blocks. you will a lso be asked if lhe System Dalo should b e transferred
- this process w ill overwrite your offline System Da ta. Recall that the System Data contains
the hardware configuration fo r the selected PLC Station.
Application Tips
You may a lso use Copy and Pa ste to tra nsfer the online b locks of a C PU to a program not
associated w ith a p articular CPU (i.e., CPU independent program). Simply open the online
blocks w indow ot lhe CPU, select the desired blocks. open the target offline b locks fo lder
and perform the paste.
Whe n you perform an upload of the online blocks folder, the comp lete offline blocks fold er is
overwri tt en. Prior lo the upload. you may consider copying the offline blocks folder to a CPU
independe nt program, in case for som e reason you may need lo revert lo these blocks.
1
oFC7 oFC8 oFC9
' fil.l i1 dl O FCl 1 O FCl 2 QFC13 O FC1<1
l!l· CP 343·1 ISO O FC15 0 FC20 0 l'C40 o DB1
~· CP 343·1 TCP
EE CP'.!43,5
1£ IU SIMATIC300f1)
IE Cl S7_Prog,am(l )
S Cl 57_Ptogr4m(13)
Figure 5-22. Online Blocks Wind ow: Uploading a ll CPU blocks to the offline blocks folder.
Fig ure 5-23. OnHne Blocks Window: Uploading selected CPU b locks to offline b locks folder.
316
Monoging Online Operations with S7 CPUs
Upload Program: Wi th ihe online Blocks folderselectetf, upload the entire program
1 With the SIMATIC Manager open to the desired projec t, p ress the online window
icon ond then navigate to the correct Slolion ond CPU.
2 Expand the CPU folder, then S7 Program folder, and then select the Blocks folder.
3 With the online blocks folder selected, click on the upload icon on the toolbor; or
from the menu select PLC ► Upload to start the upload operation.
5 Choose Yes to overwrite the currenl block; All , to overwrite oil blocks thot already
exist in the ofrtine blocks folder; None, lo not overwri te any exis ting blocks; No, to
skip lhe c urrent block: and Cancel. to abort the Upload.
Upload Blocks: With the online Blocks folder selected. upload one or more blocks.
1 With the SIMATIC Manager open lo the desired projec t, p ress the online w indow
icon ond then navigate to the correct Slolion and CPU.
2 Expand the CPU folder, then S7 Program folder, and then select the Blocks !older.
3 With the online b locks folder selecfed, the CPU blocks ore listed in the right pane.
4 In the online blocks window. hold the SHIFT-key ond use the mouse to select a group
of adjacent blocks in a row or column; lo select two or more non-adjacen t blocks,
select each block whfle holding CTRL-key.
With lhe highlighted b locks selected, eilher click on lhe upload Icon on the toolbor;
or from the STEP 7 menu select PLC ► Upload, lo start the up load operation.
7 Choose Yes to overwrite the current block: All, lo overwrite all blocks that already
exisl in the ormne blocks folder: None. lo not overwrile any existing blocks: No. to
skip the current block; and Cancel. to abort the Upload.
317
STEP 7 in 7 Steps
Essential Elements
When d efining the online/offline comp are dialog, you must select a CPU p ro gram; you may
selec t the oftline blocks folder to comp are all b locks or one or more selected b locks. You
may include or exclude the System Doto. and include or exclude blocks created in differen t
languages. The compare outcome is presented in a Results w indow tha t lists the bloc ks w ith
differences and allows you lo go directly to the LAD/FBD/STL editor lo view any differences.
Enable the ''Compare code" check box lo compore code blocks o f the program. Once this
function is enabled. you can also specify in the next check box whe ther blocks generated in
different programming languages should b e compared (e.g . OB I in STL with OB 1 in LAD}.
Application Tips
When on off-line b lock folder Is compared w ith on on-line b lock folder. only downloadable
user b lo cks (e.g .. OBs, FBs, FCs. and DBs) ore c omp ared. Variable fables {VATs), user d efined
types (UDTs) SFBs, and SFCs. are not compared.
Block List:
I Result or comparison
FC ll Qi Path 1 contans newer version
0810 lS) only exists in Path 2 ONLINE
Dctarls;, j Go To... !
Close I Update I Prnt ... Help I
Figure 5-24. Compare Blocks Results dialog lists differing blocks.
3 18
Managing Online Operations with S7 CPUs
'
; ilID-be fo s:c- OR 1oqic:: c oJlbin~t:.on..
r'
1~~4 I ~O~ 4
IL/1 .J .J
Ret.-w..n:k 5 : OR-be f ~ ct-iJ.lD l ogic:: c::Obbir-.e.t.ion.
Figure 5-25. LAD/FBD/STL editor wi th Online/Offline windows open to first difference found.
ACTION
1 Start the SIMATIC Manager with the desired projec t; Open the CPU program folder
and select the oflline blocks fold er or a selected group of b locks to compare.
2 With the offline blocks folder or one or more b locks selected, from the menu select
Options :.- Compare Blocks: or right-click and select Compare Blocks.
3 When the Compare Blocks dialog is presented, activa te the Onllne/ Offllne radio
button, if not already selected. n,e selected offline block folder or lhe group or
b locks you selected should already appear in the Path I field.
Activate or deactivate lhe lncludlng SDBs check box lo include or exclude the
system hardware configuration in lhe comp are operation.
7 When, the Compare Blocks Results diolog is presented; it lists each block that differs
In the online IPolh l ) and ofrnne (Poth 2) programs. The result indico les which block
wos the newer version, and whether a block: only exists in the online or offline folder.
8 Press the Go To ... button opens the LAD/FBD/STL editor with online and offtine
windows of the b lock: lhe first round executable code difference is displayed.
9 Use the Next and Previous b uttons to navigate forward to th e next network with
difference or backward to the previous network with a lound code difference.
10 As corrections ore mode and the c hanges ore saved. use the Update b utton to
re fresh the difference list lo reflect the remaining networks with a code difference.
319
STEP 7 in 7 Steps
Essential Elements
When defining the o lmne compare dialog. you may use any two offline programs. including
programs not associa ted with a C PU. You may select on o ffline blocks folder lo compare th e
en tire program, or sele c ted blocks. You moy inc lude or exclude the System Do to (the statio n
configuration). a nd you may include or exclude blocks that were created in d ifferen t
languages. The compare o utcome is presented in a Results window that lists the blocks w ith
differences and allows you to go d irec lly lo view the d ifferenc es in the LAD/FBD/STL editor.
Whe n the editor is open. ensure lhot the Detail view is activated from the menu.
Details... I Go To.,.. j
Close I Update Print ... Help I
Figure 5-26. Compare Bloc ks Offline compare result. lists b locks found d ifferent.
320
Monoging Online Operations with S7 CPUs
'
; ilID-be fo s:c- OR 1oqic:: c oJlbin~t:.on..
r'
1~~4 I ~O~ 4
IL/1 .J .J
Ret.-w..n:k 5 : OR-be f ~ ct-iJ.lD l ogic:: c::Obbir-.e.t.ion.
Figure 5-27. Compare dialog sel to compare offline b locks folders of two progrom.s.
ACTION
1 From the SIMATIC Manager, open the desired project and program. I hen selec l the
offline blocks folder or o group of selected blocks (Path 1) lo compare; then from lhe
menu select Options ► Com pare Bloc ks: or right-click and select Compare Blocks .
2 When lhe Compare dialog is presented. activate lhe Path1 / Path2 radio button. as
the "Type of Comp a rison". Your first selection will already appear in the Path -1 field;
navigate to lhe p rojec t and lhe second p rogram folder to select lhe o ffline blocks
fold er or o group of selected blocks to be compared (Path 2).
3 Activate or deactivate the Including SDB.s check box to include or exclud e the
system hordwore configuration in the compare operation.
5 Con firm your selec tion with OK lo start the compare opera lion.
6. When, the Compare Blocks Results dialog is presen ted; it displays o lis1 of each block
that differs in the Polh l and Poth 2 programs. The result indicates which offline b lock
was the newer version, and whether o block only exists in Path I or in Path 2.
7 Press the Go To ... b utton opens the LAD/FBD/STL editor ,...-ith online and offline
windows of the block: the first found executable code difference is displayed.
8 Use the Next and Previous b uttons lo navigote forward to th e next network with
difference or backward lo the previous network with o found code difference. As
you press Next or Previous, both editor windows ore positioned al the selected
network.
9 As correc tions ore m ode and the changes ore sa ved, use the Up da te b utton to
re fresh the difference list lo reflec t th e remaining networks with a code difference.
321
Working with Monitoring
and Diagnostic Tools
Ob j ectives
324
Working with Monitoring and Diagnostic Tools
Program Rererence doto reports include the Assignment Lists. Program Sfrucfure. Cross
References. Unused Symbols. and Addresses without Symbols.
Assignment List
The assignment lisl is o memory usage overview ol lhe inpu ls [IJ. outputs [Q), bil memory (M).
limers [T). and counters (C). Th e report is actually divided Into two parts - the so-called
1/Q/M list. and the Timer/Counter list. Since the entire area is shown for each of these memory
areas, you con easily determine who I locations ore avoiloble and ii any were lmproperty
assigned.
The 1/Q/M assignment list, as shown in the figure below, is a table in which the byte locations
ot each areo are depicted as rows in 1he table. Each byte is divided into eight boxes. each
or which indicates a bit location. The b ils are numbered rrom the least-significant b it starting
from the right, as seen in the table header. Each b it location that is used in your p rogram, is
marked by on ·x·. Furthermore. the column header otso indicates w hether lhe loc ations ore
accessed in the program as a byte IB), word (W), or doubleword ID) location. As seen in
Figure 6-1a. the individual bits of by1e-4 and byte--5 are each used; these two bytes are also
accessed as o word location IW 4. The Timer/Counter list also shows uses a table formal to
show which timers and counters ore used in the program.
•··
lll>'Jtc, outpub, ~ melllOi)'
,. Input$, output~, ~ l'MfllOI)'
IB 0
7 6 5 1 3 2 I 0 8 W D
I
MB229
7 !12.l.tl.! 2 I 0 8 W D
IB 1
18 2 X X X X X X
MB230 I l
IB 3 X X
MB23l I I
IB 4 X X X X X X X X MB232 I I
18 5 X X X X X X X X MB233 I .I
IB 6 X XX X M8234
Figure 6-20. t/Q/M list: Input Memory Area b) 1/Q/M list: Bil Memory Area. MD 230 is used.
Program Structure
The program structure provides a visual mop of how b locks ore called within your S7 user
program. In a tree-like struc ture, that can be expanded and collapsed, all of the nesting
levels of b lock calls of the program con be viewed. This graphical view of the program con
be a useful tool to quickly see wha t b locks ore called from a given block os welt os the
nesting depth or o given coll path. Furthermore. lhe p rogram structure gives you the exact
temporary local data requirements for each coll path (i.e .. O B colts}.
325
STEP 7 in 7 Steps
326
Working with Monitoring and Diagnostic Tools
Like in p receding chapters several brief tutorials have been presenled here, to offer o quick
overview of working with onllne monitoring ond diognoslic operations. In lhe remainder of
this chapter examples of monitoring and d iagnostic operations such as monitoring program
status with or without a project, forcing variables, diagnosing hardware, and using the CPU
diagnostic butler, are all presented in o step-by-step manner. The following checklist
highlights some of the key points in working w ith the S7 monitoring and diagnostic tools.
• From lhe Simotic Manager. use the Online Window loo/bar button lo access
lhe onf/ne operations ofo specific CPU with /he project.
• From /he Simotic Manager, use the Accessible Nodes loo/bar buHon to
access the online opera/Ions of a specific CPU wi/houl a project,
• Use the Debug Monitor tool in RUN mode to view the S7 program logic and
data, with visual aids, as the program is being processed.
• Create Variable Tables {VATs} as o convenlen/ looJ and starting pain/ for
Monitoring/Modifying Variobfes and Forcing Vanobles.
• Use the Monitor/Modify toot to view and assign new values lo memory and
program variables as /he conlro/ program is being processed.
• Use the Force Variables tool for overriding /he actual stalus/vo/ues of
memory and 1/0 variables as the control program is being processed.
• Use lhe CPU Diagnostic Buffer to quickly determine the cause of o stop by
ascertaining what events lead up lo /he CPU entering /he STOP mode.
• Use the Diagnose Hardware toot to quickly pinpoint errors or faults in the
hardware of a station tho/ hos stopped.
• Use /he CPU S1acl<s {e.g., S.Stock, I-Stock, L-Stacl<J to determine the causes of
a CPU STOP, due to program-related faults.
• Generale lhe various program reference data and memory address usage
repor1s to ossisl in diagnosing program-related problems.
327
STEP 7 in 7 Steps
Essential Elements
An online connection musl be established with lhe CPU to d isplay a block in lhe monitor
mode. With the connectio n In p lace and lhe block o nscreen. simply enable the Monitor
mode rrom lhe menu (Debug ► Monitor), or using the Monitor toolbor bu I to n (eyeglasses).
Each LAD network is highlighted to show b inary resul ts a long the network , as contac ts open
and c lose. Similar logic continuity is shown in FBD, and STL. In oddi1ion lo showing the logic
continui ty, the digital con lents of each program variable is also shown.
Application Tips
While in lhe Debug Monitor mode. the screen is only updated from the poinl of the cursor
forward. If you need lo switch between the language representations (i.e., LAD/ FDB/Sll) , the
status mode must first be turned off temporarily.
BO • @OBI
Fib Edi Insert fl.C Oebug 'l1ew o,,bons Wi,dor, lt,lp
-----
D 1~1
~--l,'ffL~ ~ 1~161.,, I · ICJr~l• lf0 ~~ 11'.Jll§II t'::1➔~111-l-01 ~14 l_j'l1-d~
Isl @OBI - Maliinjj ~c:•\SJMAm <100(1t;:~<113-I DNLXl;lf}
: 1'10 Set1es-Patal1e1 citC:Ult$ in secics ~i!:h a •inglc NO contac,.
I20, 1
I20.3
I:20. 2
120.4
, 120. 5
... ... ..... - .... .I ,' ..... ........" .......
'
-.....
030 . '1
'. .. .... .
....
- - : :···--· .. ···I r.....
Network 12: 3ecies-Patall el citcui~ c0Db1na~1on.
~ I
Figure 6-4. Block in Monitor mode. Status fulfilled = Green; Nol fulfilled = Red Dosh.
328
Working with Monitoring a nd Diagnostic Tools
I l 20 .l l 20 . 2 Q30 , 2
1 1-I----11 1 - - , - - - - - s 1 }-I
1I 120 . J 1 20.4
1 I t .-~
let\,orl< 10' : !:xclu:uv~- OR implencnt.et.1.on in Lcdde-1:: !09lc .
120 , 1 120 . 2
1--,, 120. l 1 20 . 2
.-1-
ACTION
I Launch the Simo tic Manager application from the Windows Start button and open
to the desired projec t and the S7 Program whose status you wish to monitor.
2 Selecl the Blocks folder of the Program. and then from the right pone double-click
on the block you wish to open or righ t-click on the b lock and select Open Object.
3 From the STEP 7 menu, selec t View ► fhen select LAD, FBD. or STL as the language
represenlolion in which 1he b lock was created.
4 From the menu select Debug ► Monitor or p ress the Monitor foolbar icon (eye
g losses/ to view fhe block status, while processing (CPU in RUN or RUN-P mode).
S Select the network header (e.g .. Network 11 ), for the network you wish to evalua te
first. Alfhough the entire block is being p rocessed. only networks below the selec led
network are updated - thereby minimizing the overhead due to status update.
6 If 1he program status does not appear to be updating. check the status bar o f the
editor window 1o verily tha t the CPU is in the RUN or RUN-P o pera ting mode.
7 After the editor opens. maximize the window and use the View menu to hide the
Program Elements browser (de-oclivo le th e Overview), lo enlarge the viewing area.
8 For additional diagnostic aids while in the monitor mode select View ► Detail.
9 To open and monitor another block, select Ale , Open from the menu.
329
STEP 7 in 7 Steps
Essential Elements
Accessing o C PU program without the project means that you a.re not accessing the o rmne
program. but instead the program residing in the CPU. Either a direct MPI link to the CPU or
on MP! o r Profibus network must be in p lace since the Accessible Nodes utility o nly opera tes
over these links /Accessible Nodes Utility is not p ossible via Ind ustrial Ethernet). To view the
program while it is p rocessing, the CPU must be in the RUN or RUN-P operating mode.
Application Tips
Although you may gain a ccess to any CPU program and data opened through the
Accessible Nodes utility, this method should be used only for monitoring a nd not for editing a
program. Editing CPU programs and data w ithout the project may result in the loss or
distorting of critical project information.
@] MPI = 5 (direct)
Figure 6-6. Displaying active MPI stations found using the Accessible Nodes utility.
Fig ure 6-7. Accessing o n/ine blocks folder of MPI address = 5, withou t project.
330
Working with Monitoring a nd Diagnostic Tools
I I Z0 . 1 I 20.2 OJ0 . 2
11
i----11 t - ~ - -- 1 }-I
1I I 20 . 3 I 20 .4
1 I I
lchmrk lG : Exc lu31vc- OR 1nplenent c t 10n 1n Loddcc logic .
''
I
.
I20 . l
I
.
120 . 2
ti
·•
•• • ••••••••• , i o- • • · -
I
030. 3
_J
I 20 . l I 20.2
--, A
Figure 6-8. LAD/ FBD/STL in Status mode, with the view set lo LAD representation.
ACTION
I Launch the Sima tic Manager applica tion from the Windows Start button and from
lhe menu. select PLC ;.. Display Accessible Nodes; or from the toolbor p ress the
Accessible Nodes Jeon. Each sta tion folder is id entified by the station MPI address.
2 Select the Blocks folder of the desired s1olion. then from the right pone double -click
on the block you wish lo open or righ t-click on the b lock and select Open Object.
3 From the menu, select View ► then select LAD. FBD. or STL a s the langua ge
representation in which lhe b lock was created.
4 From the menu select Debug ► Monitor or p ress the Monitor toolbar icon (eye
glosses) lo view the block status, while processing !CPU in RUN or RUN-P mode}.
S Select the header (e.g., Network 10) for the network you wish lo evaluate First.
Although the entire block is being processed . only networks below the selected
network ore updated - thereby minimizing the overhead due to status updale.
7 After the editor opens. maximize the w indow and use the View menu to hide the
Program Elements browser (de-ac tivate th e Overview). to enlarge the viewing area.
8 For additional diagnostic aids while in lhe monitor mode select View ► Detail.
9 To open and monitor another btock, select F1Je ► Open from the menu.
331
STEP 7 in 7 Steps
Essential Elements
VATs may be comprised o f any S7 memory locations, including lhe peripheral area, and
timers and counters. Bit, byte, word. ond double word locations from the Input (I), Output (Q) ,
Bil memory (M) , a nd d ata b lock memory (DB) areas may b e used in the table. For example.
bit Q 4.7. byte QB 4, word QW 4. ond double word QD 4 are all valid entries. Only byte, word
and double word a reas of the Peripheral memory area are allowed (e.g., PIB 256, PQW 512).
When defining each variable , you may use either its absolute or symbolic address.
For each VAT. you may define a Trigger Point and Trigger Freqvency ror managing how lhe
variables ore monitored ond modified. The trigger point. defines the point of w hich the new
valves ore as.signed to variables being modified, and at which variables being monitored
ore updated. The trigger frequency defines how often variables you are modifying should be
assigned the new values, ond how often the variables you ore monitoring should be
updated. You moy se t the trigger point for the Beginning of Scan Cycle, End of Scan Cycle,
or Transition to STOP. You may set the trigger frequency for only Once, or Every Cycle.
Application Tips
Using VATs con be o great monitoring and troubleshoo ting tool. Try to creole tables for the
sections of your machine or process where you a nticipate problems. To e nhance readability
o l each loble, limit the number of entries to only those memory locations tha t ore essential.
Modify value
1 MW 30
........ •·••·•·••·•• .. ·• i !
' ............... . ,... .
, ..................
' DEC .................... ····•·• ..• .............. ..... . ............. ···11
·
2 .T...... ~ ..... •··•--···..... , .. [ ~IM~!l.~.,,_TI_ ~ ~- .: .............. ···----·.. , ·f
3 C i
3 •---1·--·---·--··--....
----..··--·•· \COUNTER
. . -....--.--............_._._,............______,., ____._... .__.. ,..._._____..... .__.............r
.-.....
It I 32.0 i i BOOL
····--..·····-·····-····~----·····-...---·-~----·------·-·-·····
5 I 32.1 \ , BOOL _ -
. . . . . · - - ··· • · • I t - ' ' - . · - -. . · - - · - - · ' . . . . . . . . · · - · · . . ····•"' · - · - ·•·· , . . . . . . . . 1· .. . . . . . . . . . . . . . . . . . ·• ................... ' ...
6 I 32.2 t 1BOOL
....··-···---~····---····+-·-···-·-----··-·-···•-+-•---····--··--·-·--·..._. --- --- ····-·..···------·-··-····-·-·--··· i
7 I 32.3 ! I BDOL ~
8 . i. . . . . 32·4··•---H••r·••H-..........................!.B Oo-c.··.... --..-......,..-....... - . . ····-.. ·-·--·---.....-,.-...........-.!
.... ......,,..,_.,... .........- ..........,_, ,....... ...........................,.. ,......
.- _. _. ,, ... ..... -............ _, ..............
,._. ,,(",
9
10
I 32.5 ! BOOL
·ci··--·32~·0-·-••1••,o•·-···--..-·-····. -re·oo-c·. . . . . . . . . . . ._,. , _ !
·····-••«••··--"•-·--·-..............~---~
.......-..,....- ..........................._....,.... ·-·..-··......~---·---····....·····-...... ... .. ...·-·......·-·.....-·-........-··--··-·-<
11 Q 321 i [ BOOL ' [
t-1-2---i.-...;•.. ' ......... . . ... ,.. . ·-·•· ..... -: ' ' ...... .. . ·• ..... ..... . . ·--··--· ··- ....... - . ·•1
i-:::....11-...ii..,...... --··.. ·····-·- .........,, .... ,__ .....-... ,_,_,.... ~············-··•--~--.. ··· ····••·-••· ....·- - - - - - ·····-·"···-......,."rl............-. ...... ...5
Figure 6-9. Variable Table (VAT) entry d ialog. Enter absolute address, and display format,
332
Working with Monitoring a nd Diagnostic Tools
Trigger ,
Trigget Point fOf Moniloring- - ~ Trigger Cond~ion for Monitoring-~
C.- Beginning or Sean Cycle 1 Once
(" End of Scan Cyde C.- Every Cycle
(" Transition to STOP
DK I Cancel I I..._H_e1p_ _l
Figure 6- 10. Default VAT !rigger se ttings for Monitoring and Modifying.
ACTION
1 Open the Simotic Manager to lhe p ro jec l and S7 Program you v,1ish to use.
2 From the menu, Insert S7 Block ;.. Variable Table and accept lhe next available
number (e.g., VAT 1). The number [or each new VAT is outomolicolly assigned
Confirm the new VAT with OK.
3 Next. double-click on the new VAT to hove ii open in lhe variable table editor.
4 To odd or remove a standard column from the variable table, select View from the
menu and activate or deoctivole lhe desired column (e.g.. Symbol Commen t) .
S Next, build the table with o group of variables you wish to mo nitor or modify; enter
each Address, a nd right-click in th e Display Format field lo select the formal in
which you wish to view the data (e.g .. BOOL. Decimal. Hex. Binary, or Counter/.
6 To enter a range of addresses click in the address field , right-click and select Insert
Range of Vorlobles - the n in the appropriate Field , type the starting address, the
number o f locations. and the d isplay format to use. Co nfirm your entries with OK.
7 To insert o comment line lo describe a variable en try, selec t the entry and lhen from
the menu or the right c lick, select Insert ;.. Comment line. The comment is inserted
above the variable row.
8 From the menu. select Variable ► Trigger lo set lhe trigger point and trigger
frequency for both monitoring and modifying the variables of the VAT.
9 From the menu, select Table ► Save to save entries und er th e VAT you opened;
select Tobie > Save As to save en tries unde, another VAT number.
333
STEP 7 in 7 Steps
Essential Elements
To monitor or modify the variables you entered in o variable loble (VAT). you must a lready
hove a physical online connection lo the desired CPU. You must also establish a logical
connec tion to the CPU. The logical connection is established using the PLC menu oplion
Connect To► . You may connect to the Configured CPU. which is the CPU associated with the
S7 program in which th e VAT was c reated; lo a Direct connect CPU. which is lo any C PU that
you have o d irect connection; or any Accessible CPU, which con be reached via lhe
accessible nodes utility. Whenever a VAT is open with on online connection, you will see
"Online" in lhe title bar. The status bar will display the opera ting stoles "RUN," "STOP,"
"Disconnec ted," or "Connected."
Application Tips
You may open as many VAT windows as required, all of w hich may be online simultaneously.
Allhough each VAT you create is generally connected to the CPU of the associated
program. ii is possible to link each varia ble fable wi th any C PU. For example, you might
create o VAT in a CPU-independenl program, which hos variables tha t ore common to
several CPUs. You may then connect to any one of the CPU lo a nd use the VAT.
2
1 ~Y'! . .
MW
~~-
50 l
.! ..
o_ E~. ... . .. . ... . . .;.-21 ~
' DEC
2~qo ... ·-· ... __
....,.._, ..................... ,.. _,, ___,, ......;,, ........................ .....................
999
I.
.... ............ •............- .........., c
J
[
3 MW
..... , .. ,
52 {i . ,
.,,, .. i~. HEX
' ..... ,,
Win 61t0999 ',.,,, ... '
i
{
4
.MW' '
60
., ..,.
i
.;, . ...
i;, DEC
. " . " ... ...
'
11178 2500 .,.,. - . 'i
... i
5 T.. • O ,.,
l
j ' . • ... ' ' '··-:• ' .
1SIMATIC_TIME ,. •. " ....
S5T~Oms .. . __,,.. . .' ' . <
'i
•H•O ..
I 32.0
l ,.,,,., • ' •••' •;•i COUNTER
l l BOOL
• "" ,,._ ' • " ' ! • •
Clt999
false
..
_.,,. ,., - ... -·- ..... ~
'" ~
'
7
,.._ •.• ·-· • · -... ' - · - -..~' ., _ ....._ ••• ·- ·..- i. .. - - · ,._, ,. · - · ..... -... ·- · - - · · - · ..... ...............-.... . . . . . ·-·-·-·-···---!'
8 32.1
.... . .. , ....
i , BOOL
.l... .. ..........:......... _,,., ., .. , , ..
false ,,_..., ................... t ,(
!
9 32.2 l · BOOL false !
10
···- ···-· ........ _,_., .. J. •.•- ... ·--··· •..,.,,_!,_ - ·--···"'· ,. ·-····"-". ·-·---·-· .....
I 32.3 i iBOOL false
' - ...............-..--····· .....-..........-,, t
;
• - -..••~••••~•••-••-..••1•••-,oo_,,_,_,._,.,, ..:••••••••••..- ...•-••--•••-••••-•••-••T•••--- . '•t
- · · - · ....... ·-··--···· ......... - ....- ...... C:
334
Working with Monitoring a nd Diagnostic Tools
ACTION
I
1 Open the Simotic Manager lo the desired project and program: lhen from the
Blocks lolderdouble click on the desired variable table (VAT), lo open the table in
the Monitor/Modify utility.
2 Based on your actual situa tion. from the menu. select PLC ► Connect To ►
Configured CPU: Direct CPU; or Accessible CPU to make an online connec tion to the
desired CPU (e.g., the Configured CPU or any accessible CPU).
3 To start updating your monitored variables, from the toolbar. press lhe Monitor Icon
(eyeglasses); or form the menu select Variable ► M o nitor,
4 To a:;sign a new value to one or more of the variables of your VAT, select the row of
lhe address and click in lhe Modify column and type in a new value: then from the
menu. selec t Variable ► Modify: or from the toolbor. p ress lhe Modify icon.
5 From the menu. select PLC ► Disconnect to break the online connection be tween
the CPU and the active variable table.
The Configured CPU is th e CPU linked lo the S7 program in which lhe VAT was
created; the Direct CPU, would be a CPU lo w hich the PG/PC is directly connected
via the standard coble; on Accessible CPU , is any one of the p roject configured
CPUs or other CPU tha t con be accessed.
Note: Any variable modified while in the STOP or RUN mod e will remain as set unless
overwritten by the program when the C PU Is in lhe RUN mode. If the sta tuses or
inputs ore modified o l lhe beginning of lhe scan, th e actual slates ore only
overwritten until the next 1/0 upda te.
335
STEP 7 in 7 Steps
Essential Elements
The voriobles you wis h to force ore hand led from o so-coiled "Force Va lues Window.'' like
with monitor/modify variables, to force varia bles, you can create the loble of variables as
needed. or you can use an existing vorioble toble (VAT). A connection with the CPU is also
required. The co nnection can be set to co nfigure automatically, in the Options menu. or you
con use the menu command PLC ► Connect To ► . You may connect to the Configured CPU,
associaled w ith lhe S7 program; a Direc t connect CPU; or any Accessible CPU. In the S7-400.
you may force bit memory (M), input (I) , o utput [Q), peripheral input {Pl), and peripheral
oulpul (PQ) memory. In the S7-300 you may force inpul (I) and oulput (Q) memory.
Application Tips
Before you slar1 a Force job you must ensure lhat a force job is nol already oclive in the CPU.
To ensure safely, however, you should not sto p a force job started by someone else. unless
you ore owore of the total impact o n the con trol system. When you are done with a forc ing
job. you must explici tly termina te the job. A force job is not termina ted by closing the
applica tion or by breaking the CPU connection; instead, forcing is o nly terminated by the
menu comma nd Voriobte ► Stop. UnHI a force job is stopped. the force values are still In lhe
CPU and not deleted. An ac tive force job is indicoled by on LED on the CPU face p lole a nd
on the Force Values Window status bar.
flt Yar • force Values : Hrdware\ 57,300. 1.lJer,,fbced=~!lf!.\CPU JIS\57 Progran,(20) :, tel~
Table Edit Insert PlC V&tlable View Options Window Help
••• • - t....
.
Time of l11st Upd&te: 17:02:27
Figure 6-12. Force value table shown normal, to reflec t that the table volues are being edited
ond not yet " forced" in CPU.
336
Working with Monitoring a nd Diagnostic Tools
ACTION
1 Open the Simatic Manager lo your project; and select the CPU where you w ish lo
initiate or work wilh "Forcing." A physical connection should already be established.
2 You may also establish an online connection with the desired CPU, from the menu, by
selecting PLC ► Connect To ► Configured CPU: Direct CPU; or Acces.slble CPU.
3 With lhe CPU selected. from 1he menu or the righ1 click, select PLC ► Dlsplay Force
Values; this opens the Force Value Window. Forcing menu options are grayed oul if
forcing is nol supported on 1he CPU.
4 If a force job is active already, it will be indicated in the Status bar as ..FRCE." You
must decide if the existing force Job can be removed or replaced. (See Figure 6· 12).
5 Wilh the Force Value window open. you may en1er the memory variables you wish lo
force in lhe table. or use an existing variable Jobie (VAT).
6 To use an existing variable Iable [VAT). from 1he menu select Insert ► Variable Tobie;
If there is no existing VAT for the force job. then enter each variable you wish to force
in the Address column: then, in the Force Value column en1er the values thal you
want to assign to each variable (Figure 6-11 ).
7 To Initiate the force job, from !he menu select Variable , Force. If no force Job is
curren 11y aclive. 1he variables ore assigned the new rorce values.
8 To save a force window as a variable table, from !he menu select Table ► Save As.
9 To stop a force job, select Variable ► Stop Forcing. This causes the forced job lo be
deleted from the CPU and the forced values to be released to normal behavior.
10 Fram the menu. selec t PLC ► Disconnect to break the anline connec tion between
the CPU and lhe active variable table.
337
STEP 7 in 7 Steps
Essential Elements
Diagnostic information obtained via the PG/ PC. comes rrom a number of sources. SIMA TI C
S7 provides various diagnostic functions. Some of these functions a re integrated o n the CPU,
o thers ore provided by the modules (SMs. CPs. &FMs). System diagnostics detect. evaluate.
and report errors that occur within a programmable controller. For this purpose, every CPU
and every module with system diagnostics capability (for example. FM 354) has a diagnostic
bu ffer in which detailed informo lion on each diagnostic event is en lered in the order it
occurs.
Application Tips
The online diagnostics con also be opened trom on online projec t window in the Simatic
Manager. With the Simotic Manager open to the desired project, select View ► Onllne to
open an online project window. With the station selected. rig ht click and select Open
Object, or double click o n the station' s Hardware object to open the Hardware
Configuration o nline.
338
Working with Monitoring a nd Diagnostic Tools
I Ver.ioo j
0 Ackr=; I 212
5 Modlie witlh: 1
r ~ I .!Jpdate Help
ACTION
'
1 Open the Simatic Manager and the project to go o nline with lhe problem PLC. or
without the project use Accessible Nodes to select and go online wi th the sta tio n.
2 From the menu, select PLC ► Dlagnosllcs/ Selttngs ► Hardware Diagnostics or w ith
lhe CPU or MPI folder selec ted. right click ond select PLC ► Hardware Diagnostics.
The Quick View dialog will be d isp layed (unless the check box on the Quick Vi ew
dialog hos been deactivated. Along with the CPU, the Foully Modules ore listed.
3 Select a mod ule that is indicating a fault a nd press the Module Information button,
to obtain furt her d iagnostic information on lhe selected module.
4 You con view b rief diagnoslic information tor the module. In the Status box on the
General p roperties fob. The available d iagnostic details will depend on the module.
CPUs. FMs, and CPs. for example may have additional diagnostic screens.
5 Next, you con press the Open Station Online b utton, lo open the station's hardware
config uration online, as o g raphic diagnostic fool.
6 With the Hardware Configuration tool open online. the rac ks a nd any faulty modules
will be shown. with visual sta tus indicators; use the STEP 7 o nline help sys1em for
context-sensitive assistance with lhe visual error indicators.
7 In the configuration, you wm be able to verily the module's address, and obtain
specific information by opening the module's properties d ialog.
8 Finally. you may also selec t the C PU irom the Quick View d ialog or from wilh the
hardware configuration anline. to then select Module Information. By viewing the
d iagnostic buffer, you may see the events leading up to the CPU going into STOP.
339
STEP 7 in 7 Steps
Essential Elements
The Events list box of the d iagnostic buffer contains a list of each diagnostic even t that has
occurred. Each event Is listed with the event number (e.g .. 1-100, where 100 is the oldest
event); th e Dale/Time of the event; and the Event with description. In the lower window
Detalls of Event, additional informatio n is d isplayed for the currently selected event. This
information provides a more detailed description, such as CPU Mode transition caused by
the event, and reference to the location o f the error in a block (e.g .. block type, number.
and rela tive address).
Application Tips
The Information entered in the diagnostic buffer when o system dia gnostic even t occurs Is
identical lo the start informatio n tra nsferred to the corresponding organization bloc k.
0 Addresg;
2
Close
I Update !__P_r_i'lt_..._..,l Help
Figure 6-16. The CPU General Properties lob: Stolus box g ives brief d iag nostic information.
340
Working with Monitoring a nd Diagnostic Tools
!'D'[Modulelnformation -CPU 3 15 ~ -- -
Path; jHrdware\57300_1_Tiei~Fllled_El'.l)\CPU 31 Operatng mode ol the CPU: @STOP
St~:: •!1 Errot Not a force job
I I
Time Syi~
Geneid
Pedormence Dete
Oiligll0$lio Buffer I
Communleetion
Memory I
Stecks
Sean C}ocle Time I
Events: r Filter .e..'trlg~active r T1meinc~C?U/localtfmedf.e-ence
No. I Time oi deu I Date I Event I•
1 05:49:54:071 pm 02/08/05 STOP caused by stop swtthbmg activated -
2 05:28-« :254 pm 02/08/05 Mode tramition from STAR TUP to AUN
3 05 28 44 248 m 02/;)8/05 Re ue~• to, manulll w~rm reit~rl
4 05:28,44:158 pm 02/08/05 Mode tr~sition from STOP to STARTUP
5 05:19;51:752 pm 02/08/05 STOP ceused by stop swtchbeing activated
6 05:18:46:183 pm 02/08/05 Mode tramition from STARTUP to AUN
7 05:18:46:178 pm 02/08/05 Request for autometic warm res.tart
8 05:18:46:090 pm 02/08/05 Mode transition from STOP to STARTUP
Details 6n Eve~ 3 of 100 Event lD: 161t 1381
R8Ql.lest for manual waim renlail
...
TOP due to. STOP ce,.ised by $l01> sw~eh being ~Weted
tartup infounalion ·
• Startup withed moafied syitem coriigur11tion
No difference betwe~n ~etpo!nt and actual config..alion
Time for lime staino at t~la$t ~eqiip oower on ~
SaYeAs..
I I Het>~Event I
Close
I Update j __P_lin_t._.._ _. Help
I
Figure 6-17. The CPU d iagnostic buffer screen.
II 1
ACTION
With the Simotic Manager open to project and station. from the menu select View ►
Online; or selecl PLC ► Display Accessible Nodes to go online w ithout lhe project.
2 From the online projec t w indow (or the accessib le nodes window), select the CPU
module whose diagnostic buffer you wish to open; then right click and select PLC ►
Module Information.
3 You con view b rief d iagnostic informa tion for the CPU, in the Status box of the
General properlies lob. For e xample . o boltery failure is Indicated: or a difference in
lhe config ured CPU order number and lhe inserted order number may be shown.
4 Open the d iagnostic bu ffer by selec ting the Diagnostic Buffer tab.
5 The events leading up lo the CPU stop ore listed in lhe Events box. starting with lhe
most recent event. As you step down through the list. o list of information details
about the specific even t ore shown below in the Detail on Event box.
~ To get further assistance on on event, and possib le ca uses and corrections for
eliminating the error. press the Help on Event butto n.
7 If you make any corrections, while still in lhe diagnostic buffer. you con press the
Update button to view changes in the CPUs ability to sta rtup.
3 41
STEP 7 in 7 Steps
Essential Elements
The &-stock (short tor block-slack), lists the o il of the blocks called in the program just prior lo
the STOP. bu t d id not comple te execution. The I-stac k [short for interrupt-slack), contains
important dala or statuses that were in e ffect o t the time the CPU stopped. For example.
accumula tor conten ts, numbers of the open data b locks and their length. status word
conte nts, number of the interrupted b toclc, and the block w here processing should resume.
The stock information can only be accessed when the CPU is in STOP mode.
342
Working with Monitoring a nd Diagnostic Tools
ItitH144·!GI§ii·is\14,itJGJ 4Mli46EtiJ❖11 ! •►
Point ol ln1e11uption RegisterValues el I~ Port ol Interruption
Priority Cless; 1, 081 Regiuer Value Display Formal
ACO.J 1: 0000 DODO IHex .::)
lnlen~ Block; FC l
ACOJ 2: 0000 0000 Hex
Open Block
ACOJ 3: 0000 0000 IHex .::I
Cont~on in Block· FC 1
ACQJ 4: 0000 0000
DBs Se'.ected1- - - - - - - - .
1st DB 2nd DB Addi. Reg.1 0.0 jAddiess
Close ] Pm.. I I
Figure 6-19. S7 CPU I-Staci< dialog. This d ialog can o nly be opened in lhe STOP mode.
ACTION
'
I Wi1h the Simatic Manager open lo project a nd station, from the menu select View ►
Online: or selecl PLC ► Display Accessible Nodes lo go online witho ut the project.
2 From the online projecl w indow (or lhe accessib le nodes window). select the CPU
module whose diagnostic buffer you wish to open; then righ l c lick and selecl PLC ,
M odule Informa tion .
3 Select the Stocks lab, and the Block Stock will be displayed. with a listing of lhe
complele b lock coll sequence leading up lo !he STOP. The lost execuling block
(e.g., F822), the b lock tho I was interrupted, will be at the top of the stock.
4 Click lhe I-Slack button, ot the bollom of the dialog. lo display lhe interrupt slack os
shown in Figure 6· 19. Note Iha! the dialog indicates the inlerrupled block as well as
the block in which execution will resume when the fault is corrected.
S Click lhe Open bulton. lo la unch the LAD/FBD/STL edilor ond open lhe interrupted
block.
6 Click the L-Stack b utton, ol the bottom o f the d ialog, lo d isplay the c urrent contents
or !he local dolo stock 0.e .. temporary local variables or !he inlerru p ted block].
343
STEP 7 in 7 Steps
Essential Elements
The cross-references report is lo list each address found in the program. the various locations
where used, and how used. The assignment 11st is an overview of how S7 memory areas
including timers. counters, bit memory, inputs, and outputs ore being used. Input (I), output
(Q), and bit memory (M) addresses are lis ted by byte. with individual b its. and shows whether
program usage Is by bi t [X). byte (B). word (W). or double word (D).
The program structure describes 1he coll path of all of the blocks in on S7 program. The
program structure is represented as o tree. showing the b locks called from each O B. starting
with 08 I . The structure shows the nesting depth of each call pa th as well as local memory
usage for each block a nd th e complete call path. The unused symbols report lists assigned
symbols tha t are not used anywhere in the program. Finally, the addresses without symbols
report list all addresses used in the p rogram, b ut do not have an assigned symbol address.
344
Working with Monitoring a nd Diagnostic Tools
-- --
!tJ C 2
@ C3
ltl cs
FCIOO
FCIOO
FCIO (Box_Ccuters)
P.
P.
P.
STL
.
STL
LAO
-
tit/
ti,/
ti,/
31
31
1
--
Sta
Sta
/A
10
25
/l
/L
11,1
e-
lt,I
11,1
31
31
1
Sta
-
Sta
/l
12
27
/ LC
/ LC-
0 Co FC IO (Box~Cotrle,s) i P. LAD t1,1 2 /A lfiJ 2 /l
EiJ C 7
fC I
FC!O (Box_Ccuten)
081
P.
P.
LAD
LAD
"ti
tit/
3
1
/A.
/CC "" 3 /L
■ ACTION
'
1 With lhe Simolic Manager open to the desired project and S7 program. select the
offline blocks folder for which you wish to genera te or display reference doto.
2 With the Blocks folder selected. from the menu select Options ► Reference Da ta ►
Generate; when prompted, to update or regenerate the reference data. Select the
Re-g enerated option lo delete existing reference doto and lo generate the
re ference doto os new; select the Updated option to ensure data is generated for
modified or new blocks, a nd tha t reference data for deleted blocks is removed.
3 lo display reference dalo onscreen or to print reports, first selecl the desired Blocks
folder, then right c lick and select Reference Data ► Dtsplay. If prompted by the
Customize dialog to select a report to open. you may choose o report and then
decide whether this dialog should always be opened when displaying reference
doto.
4 After the report you selected is displayed. from the menu select Reference Data ►
Print. to hove the report p ri nted. You may need to adjust the Print Setup first.
s Use the View menu or the appropria te toolbor icon to disptay other reports.
6 To filter the content data for any report tha t is currenNy open, select View ► FIiie r
from the menu, then use the appropria te tab (i.e., Cross References, Assignments,
Program Structure. or Unused Symbols) to select the elements you wish to have
filtered out or shown in the report.
345
STEP 7 in 7 Steps
346
Working with
SIMATIC NET Networks
STEP 7 in 7 Steps
PG/PC $7-400
O P Devices
1111 I II ITI
Figure 7-1. Typical MPI (Multi-Point Interface Subnet.
348
Working with Simalic NET Networks
PROFIBUS
PROFIBUS, a cronym for PROocess Field BUS, is a standard according lo European standards
IEC 6 1 158 and EN 50170 Vol.2. Comprised of three major protocol definitio ns. lhis sta nda rd
protoco l. serves networking of co mpliant devices at both the cell and device le11els of the
plant. Th e DP-component of this protocol supports high-speed d istributed 1/0 connections to
devices like ET-200, while the PA (Process Automation) component extends the DP protocol
lo Include a transmission system that meets intrinsic sa fety requirements. The FMS (Fleldbus
Message Sp ecifica tion) component of PROFIBUS ,upports client/server communications
between compliant partners (e.g., S7-to-S7, S7-to-S5) in a multi-vendor environment.
The PROFIBUS network uses shield ed twis ted pair. glos.s or p lastic fiber transmission media,
supports 126 nodes, an d transmission rotes of up to 12 Mboud. SIMATIC S7-300. S7-400. a nd
PC stolions require o communica tions processor to connect too PROFIBUS subne t. CPUs thot
hove on integrated PROFIBUS-DP interface (e.g., CPU 3 15-2 DP. CPU 416-2 DP), for
establishing o statio n as o DP-Moster or DP-Slave do not require additional modules.
PROFIBUS CPs and the communications seNices they support ore described later.
SIMATIC SS
PG/PC
OP Dev ices
Third Porty
Sl-2()0 Sl-300 S7-300 De\lioej
• ••
111111111 II
Figure 7-2. Typical PROFIBUS Subnet.
D
Industrial Ethernet
Industrial Elhernet ser11es the requirements of p lant areas and cells, where manufacturing
system s ore monitored and coordinated - , and perhaps tied into plant informa tion systems.
Supporting both the ISO and TCP/IP transport protocols. Industrial Etherne t supports
tronsmi;,sion of large d o to quantities 011er standardized local networks with access to
worldwide networks according to IEEE 802.3/802.3u.
The Industrial Ethern et network uses double shielded coaxial coble, industria l twis ted pair,
gloss. o r p lastic fiber transmission media, and supports 011er 1000 nodes o t transmission rotes
of 10 Mbit/s or 100 Mbil/s. SIMATIC 57-300. S7-400, and PC workstations require the
app ropriate communicatio ns processor to connect to on Ethernet subnet. Industrial Ethernet
CPs and lhe communications services they support ore discussed ta ler.
PG/PC
OP Oevkel
_, ON
OM
-••••••••a
OM
·-
OM
OM
lhi-d Paty
Device$ S7-300 S7-300
111(111'1
Figure 7-3. Typical Industrial Etherne t Subnet.
111111111
349
STEP 7 in 7 Steps
Note: S5 Compatible communication is poss[ble via PROFIBUS FMS and PROFIBUS FOL. and o n
lnduslriol Ethernet using the ISO transport. ISO-on-TCP. and TCP/IP lransport services.
350
Working with Simolic NET Networks
An un-configured connec tion. because of ils dynamic nature, might be used to make
e fflcient use of the ovoitable link resources of a CPU. At least one connection resource must
always be available in each partner, since the connectio n is established when the SFC is
coiled in the S7 program. Wilh this single link. a CPU moy exchange data, in o sequential
manner, wi th several partners. The following SFCs are used for non-configured connections.
Tobie 7-2. Sys tem Functions for Communication vio Un-Confiaured Connections
SfC NAME Bltef Description
•
SFC 65 X_SEND Send Data to External S7 Portner
SFC 66 X_RCV Receive Do to from External Portner
SFC 67 X_GET Read Dato from External S7 Portner
SFC 68 X_PUT Write- Dato to Exterhal S7 Portner
SFC 69 X...ABORT Abort Connection to External S7 Portner
SFC 72 I_GET Read Doto from Internal S7 Portner
SFC73
- I_PUT Write Data to Internal S7 Partner
,..
SFC74 I_A BORT Abotl Connection lo Internal S7 Portner
Note: lntemat partners shore the MPI bus in o station (e.g .. S7-400 Multi-CPU configurationl
Configured Connections
Configured connections support connections between S7 partners, and non-S7 partners
(e.g., computers, Simo tic S5, and other systems). Whereas an un-configured connection is
dynamic. configured connec tions ore static. In a sta tic connection. the properties !hot
establish the relationship between the partners is b uilt-up al the start-up o f the CPU and
remains even when the CPU is switched to STOP. To use configured connec tions. you must
define the connection in the CPU's connection table. using the NelPro configuration tool.
When defining configured connections. you may specify as many as required, within the
limits o r the a vailable connection resources of the CPU. The connection type you choose will
be based on the communications service you wish to imple ment (see Table 7-9). Multiple
configured connections are possible between different partners or between the some
partners. A Local ID is assigned in each partner for each connection you con Figure. This loc al
ID is required as a n input parameter to the communications b locks that you call in your
program. to communicate over configured connections. Configured connections ore
always required when the communications Involve communications processors (CPs).
Communications Services
Performance features ore wha t characterizes a specific communications service. For
example, o data service operates on o specific subne t (e.g., MPI, PROFIBUS, or Industrial
Ethernet), and is based o n a specific transmission procedure. User access lo a
communications service is via a particular interface. Access to a service in the S7 program.
for instance, may require system blocks (SFCs or SFBs) or loadable user blocks (e.g., FCs, or
FBs), available in the STEP 7 librory. Access lo a service in a PC sta tion might involve on OPC
Server. or C-functions. SIMATIC NET encompasses the following services. each o r which
requires that you configure o connection in the connection table of the partner sta tions.
351
STEP 7 in 7 Steps
S7 Functions
S7 Functions provides optimized services for communication among S7 systems (e.g., PLCs.
operator panels (OPs), and HMls). You must configure an S7 connection for the partner
slotions to use this service. The S7 services o re supported on MPI, PROFIBUS. and Industrial
Ethernet. With these service S7 PLCs may participate in send/receive. and direct memory
access communications with other S7 PLCs or with PC slotions.
In the S7 program, you may implement secure data transfers of up to 64 Kbytes per job. using
the integrated blocks B_SEND (SFB 12) and B_RCV (SFB 13). You may implement high-speed
unsecured data transfers (i.e .• without acknowledgement), of up to 440 bytes. using the
blocks U_SEND (SFB 8) and U_RCV (SFB 9). Using GET (SFB 14) and PUT (SFB 15) blocks. d irect
access to the memory in S7 PLCs is possible w ithout programming in the remo te partner. The
coll interlace for lhese system b locks a re Included in the STEP 7 slondord library of
communications block.s so that you may incorporate them in yo ur control program.
Ta b le 7-4. C ommun1ca tians bl ocks for services over C on f'1auredS7 C onnec rions.
57-400 S7-300 Name Brief Description
SFB8 FB8 USEND Uncoordinated Send - Mox. Length 440/ 160 bytes
SF69 FB9 URCV Uncoordinated Receive - Mox, Length 440/ 160 bytes
SFB 12 FB12 BSEND Send doto blocks • Mox. Length 64/32 Kbytes
SFB13 F813 BRCV Receive data b locks - Mox. Length 64/32 Kbyles
SFB14 FB 14 GET Read data in remote partner • Mox Length 400/ 160 bytes
SFB15 FB15 PUT Write doto in remote parlne, - Mox. Length 400/ 160 bytes
SFB19 NA START Execute a Worm Restart on remote partner
352
Working with Simolic NET Networks
PROFIBUS FMS
FMS services facilitate open communications with any p artner tha t supports the tra nsmission
of structured doto (FMS variables) in accordance with the Field bus Message Specification
services of PRORBUS. FMS supports the reading, writing. and reporting of named variables in
a client-server rela tio nship. In the c lient-server transaction, outside of defining variables. no
furt her programming is required in the server. FMS communica tions is possible between S7
Pl Cs. wilh SIMATIC S5 PLCs (via CP 543 I). and with PCs and o ther FMS sys I ems.
In the S7 program, data transfer or up to 240 bytes ore handled using the READ (FB 3) and
WRITE (FB 6) blocks, over a configured FMS connection. Yo u co n !ind these loadable user
blocks in the STEP 7 standard library of communication blocks. You need lo define the FMS
variables on the FMS server only for READ/WRITE services. and only on lhe clien l when using
th e REPORT service. Since these ore FBs, you must c reole on instance DB as memory for each
FB. FMS services in PC stations o re implemented as C functio ns and in the OPC server.
Ta b le 7.5. C o mmun1co tions bl oc ks for services over C on f1a ure d FMSC onnec fions.
Name 57.400 57-300 Brief Description
IDENTIFY FB2 FB2 Identify lhe remo le porlner ror lhe user
READ FB3 F83 Read on FMS variable from specified remote partner
REPORT FB4 FB4 Report on FMS variable to o remote partner
~TATUS FBS FBS Provide the status of a remote device on user request
WRITE FB6 FB6 Write on FMS variable to a remote device
Note: See these standard blocks in the SIMATIC NET CP Library folder in STEP 7.
PROFIBUS FDL
This service allows communication on PROFIBUS, between partners that suppar1 the SDA Send
Dalo with Acknowledge (SDAJ and Send Do to with no Acknowledge (SDNJ features of the
Field bus Dalo link Services of PROFIBUS. Wi lh FOL services, S7 PLC s may p a rtic ipate in
send/receive, broadcas t. and multicast communications with the SS I t SU/ 115H. S5
l 3SU/ l SSU (via the CP 5431 FMS/DP), o r lhe SS 9 SU DP.
Use of this service requires that you configure on FDL connec tion in the partner stations. In the
S7 program. FOL secure d o la transfers of up lo 240 bytes ore handled using the b locks
AG_SEND (FC 5) and AG_RECV [FC 6). This is lhe so-called Send/Receive user interfa ce. which
corresponds to the PLC/PLC connection in the StMATIC S5 PLCs. Doto receipt is
acknowledged by the remote partner. a nd con be confirmed in the sending station. These
blocks, listed in the table below, o re included in the STEP 7 standard library for
communications blocks.
Ta b le 7.6. C ommun co r,ons b loc ks Ior serv ces o ver C on rinured FDl C onnec rions.
Name 57.400 57-300 Brief Description
AG_SEND FC5 FC5 Send data up to 240 bytes on configured connectio n
353
STEP 7 in 7 Steps
PROFIBUS DP
PROFIBUS DP is a part o f the PROFIBUS protocol designed to facilitate o pe n distribu ted 1/0
communications between complion t PROFIBUS DP-master and DP-slave devices. These
compliant devices operate according to the European standard EN 50 170 Vol. 2. The DP
communicotions services operate o n PROFIBUS subnets, and support both Mono-Moster
(single masier) and Multi-Master /two or morel systems and their associated DP slaves.
As detailed in Chapter 3, you can configure the S7-300/S7-400 CPUs with integrated DP ports
as DP-master of modular and compac t slave devices (e.g., ET200 M , ET200 Bl. In these
configurations, you will address the DP slaves In the some manner as you would the t/0 in lhe
centra l, local, and remote 1/0 rocks. When the S7-300 is configured as on intelligent slave,
using the C P 343-5. then the communicotlon between a DP-master and DP-slaves involves
the use of standard function calls DP_SEND (FC l) and DP_RECV {FC 2) in the S7 programs of
both the master and slaves. PROFIBUS DP services for PC stations are provided as C functions.
Ta ble 7. 7. C ommun1c a tians bl oc ks for DP. Mas ter/DP-SIaves .1n In te II''1aen t SI ave con fi1aura I'10 n
Name FC Brief Descrlplfon
DP_SEND FC 1 In M aster. transfers data of a specified DP output area to the
PROFIBUS C P for output to lhe distributed 1/0.
In Sla ve. tra nsfers data of o specified OP doto o re-a on !he CPU lo
the send buffer of the PROFIBUS CP for transmission lo OP master.
..
DP_RECV FC 2 In Master, receives processed data of the d istributed 1/0 and sta tus
lnlormolion in o specified DP input area,
In Sla ve, la kes d ata transferred by the DP master from the receive
b uffer of t he PROFIBUS CP and enters ii in a data a rea on the CPU.
DP_DIAG FC 3 Queries d iagnostic dolo on the DP master and DP slaves.
DP _CTRL FC4 Executes control functions in tor the DP stove stations.
Nole: See these standard blocks in the SIMA TIC NET CP Library folder in STEP 7.
354
Working with Simolic NET Networks
In the S7 program, you may initiate secure data transfers o f up to 240 bytes. using AG_SEND
IFC 5) a nd AG_RECV (FC 6) functio ns; or up to 8 Kbytes, using AG_LSEND {FC 50) and
AG_LRECV (FC 60). In both coses. the remote partner acknowledges doto receipt. S5 PLCs
may use its FETCH/WRITE handling blocks to gain d irect access to S7 memory, Tobie 7-8 lists
the S7 communication b locks used for exchanging data over ISO transport connections.
ISO-on-TCP
This service allows communico1ion on Industria l Ethernet, between any partners that supports
the mopping of the ISO transport protocol on to the standard TCP/IP protocol. using t11e RFC
1006 extension. ISO-on-TCP services allow S7-to -S7 data transfer, bu t also allows S7 PLCs to
communico1e with S5 PLCs that use the CP 1430 TCP. In both coses, the remote partner
acknowledges data receipt. To use this service you must configure on ISO-on-TCP
connection in partner stations. using the NetPro Network Configuration Tool.
In the S7 progra m, you may initiate secure data transfers o f up to 240 bytes, using AG_SEND
IFC 5) a nd AG_RECV (FC 6) b locks; or up to 8 Kbytes, using AG_LSEND (FC 50) and AG_LRECV
IFC 60). SS PLCs may use ifs FETCH/WRITE blocks to gain d irect access lo S7 memory. Tobie 7-
8 lists the S7 communica tion b locks used for exchanging data on ISO-on-TCP connectio ns.
TCP/ IP
The TCP service corresponds to the widely used TCP/IP protocol. With this service S7 PLCs may
communicate with one another or with SS PLCs (CP 1430 TCP), PCs. or any partner that
supports the TCP/IP standard, Communication on TCP/IP networks uses data streaming
wi1hout blocking the data Into n1essoges, so o transmitting partner does not receive an
explicit acknowledgmen t for each job. Do to securi ty, however. is achieved by ou tomolic
re p etition and block checking (CRC) at Loyer 2. To use this service you musl configure o TCP
conneclion in the porlner stations. using lhe NetPro Network Configuration Tool.
In the S7 program, you may use the AG_SEND (FC 5) and AG_RECV (FC 6) blocks to handle
data exchange of up to 240 bytes; or the AG_LSEND (FC SO) and AG_LRECV (FC60) blocks. for
up to 2 Kbyles. The TCP transport services for PC communication ore provided as C functions
within the framework of the Socket interface. Tobie 7-8 lists lhe S7 communication b locks
used for exchanging data over TCP/IP connections.
Tobie 7-8. Communica tion blocks for ISO, ISO•on-TCP. TCP/IP, UDP, and E-Mon Connections.
Name S7-400 $7-300 Brief Descrf~ffon
AG_SEND FCS FCS Send data up to 240 bytes on configured connection
A G_RECV FC6 FC6 Receive data up to 240 byte.s on configured connection
AG_LSEND FCSO FCSO Send data up to 8 Kbytes on configured connection
A G_I.RECV FC60 FC60 Receive data up to 8 Kbyles on configured connectio n
AG_LOCK FC7 FC7 Lock doto access by Felch/Write from remote partner
AG_UNLOCK FC8 FC8 Unlock data access by means of Fetc h/ Write
Note : See these blocks in the SIMATIC NET CP Library folder in STEP 7.
UDP
This service allows communication on Industria l Ethernet, between any partners tha t supports
the standard UDP (User Datagram Protocol). The UDP pro tocol offers services for S7-to-S 7, a nd
S7-to-S5 communication for cross-network doto transmission to SIMA TIC SS 1I SU, I 35U, and
lSSU stations that use the CP 1430 TCP. Doto transfers using UDP is no t acknowledged by the
partner, and is therefore intended for simple data grams where acknowledgement is
o therwise implemented, or the guarantee of correc t dalo transfer is nol required. To use this
service you must configure o UDP connection in the partner statio ns, using the NetPro
Network Configuration Tool. The connection, will operate on on exclusively TCP/IP network.
355
STEP 7 in 7 Steps
In the S7 program the unsecured data transfer o f up to 240 bytes is handled. using the b locks
AG_SEND (FC 5) ond AG_RECV IFC 6} blocks; or up to 2 Kbytes. using the b loc ks AG_LSEND
(FC 50) and AG_LRECV (FC60}. The UDP transport services for PC communication are
provided as C functions within the framework or the Socke t Interface. Tobie 7-8 llsts the S7
communication b locks used for exchanging data over UDP connec tions.
356
Working with Simalic NET Networks
PROFIBUS CPs for the S7-300 include the CP 342-5. the CP 342-5 FO, and the CP 343-5: and for
the S7-400. the CP 443-5 Basic and the CP 443-5 Extended. Each short name listed in the CP
Module column actually represenls several CPs - each of whose full port number contains
the numeric part of the short name (e.g.• 342-51. These short names are used as CP folder
names in lhe catalog ol the Hardware Configuration Tool. The CPs found in o folder ore of
the some type a nd basic feature set. For example. the CPs in the CP 342-5 FO folder support
direct fiber attachment. and incorporate the some basic communications services. The
different part numbers in a CP folder may reflect the CP al d ifferent revisions. resulting from
different firmware. Feature enhancements are briefly described when you select 1he part in
lhe catalog.
Tobie 7-10. Overview of PROFlBUS Communicatio ns Processors ICPsl for S7-300/S7-400 PLCs.
CPModule Brief Application Description I Comm. Services
This CP may serve as OP-master or slave in the S7-300 • PG/OP Comm.
using copper or fiber attachments. As OP-master, lhe -S7 Comm.
CP 342-5
CP 342-5 supports connection of modular. compact. or -S5 Comm.
CP 342-5 FO
intelligent slaves such as the S7-300 with a DP-slave - PROFIBUS OP [M)
porl or via an installed CP342-5 serving as a OP-slave. - PROFIBUS DP IS)
This CP is required lo estoblish lhe S7-300 as o PROFlBUS • PG/OP Comm.
FMS master on PROFIBUS subnets. Communications • S7 Gomrn.
CP 343-5
services support communication with other PROFIBUS -S5Comm.
stations (e.g .• S7. S5. 505. C7, HMts, OPs, and PCs). - PROFISUS FMS
357
STEP 7 in 7 Steps
The CP 5613 and 5614 ore HARDNET CPs, and ore typically used where several CPs are
required in one PC. in high performance HMI systems. (e.g., WinCC), or in large
supervisory/data acquisition systems (e.g., more !hon five S7-PLCs) . SOFTNET CPs ore typically
used for STEP 7 programming systems. and in smoll supervisory/data acquisition systems (e.g ..
less !hon five S7-PLCs). In the catalog or the Hardware Configuration Tool. these modules ore
found under the SIMATIC PC Slot/on in the CP PROF/BUS folder. Software d rivers for operating
PCs on PROFIBUS ore described later in PROF/BUS Communications Services and Software.
This PC network cord is certified for use with all - PG/OP Comm.
PROFIBUS SOFTNET d rivers. The CP 5611 co n serve -S7 Comm.
CP 5611
(PCI)
s as both DP-master and DP-slave, and is Intended -S5 Comm.
for use In non-critical/ non-stringent applications • PROFIBUS DP (Ml
(e.g., PG/PC. small HMI system) . • PROFIBUS DP (SJ
•
This PC network cord is compa tible with oil CP - PG/OP Comm.
CP 5613
54 12 A2 software. The CP 5614/CP 561 4 FO con - S7 Comm.
CP 5613 FO
serve os DP-master. and is able to handle high- -S5 Comm.
(PCI) H speed PROFIBUS applications (e.g .. PC-Based • PROFIBUS DP (M)
Conlrot. HMI. or redundon l systems}. • PROFIBUS FMS
- PG/OP Comm.
This PC network cord is compatible with all CP
• S7 Comm.
CP 561 4 5412 A2.softwore. The CP 56 14/CP 5\$14 FO con
-S5 Comm.
CP 561 4 FO H serve as DP-master a nd DP-slave. and is able to
(PC!) • PROFIBUS DP (Ml
handle hlgh-speed PROFIBUSopp1icatlor'1S (e.g..
• PROFIBUS DP (S)
PC-Based Control. HMls. or redundant systems}.
• PROFIBUS FMS
Note: H = HARDNET PC odopler: S = SOFTNET PC adopter: PROFIBUS DP (M ) = DP-mosler; DP
(SJ = DP-slave. S5 Communication is v ia PROFIBUS FOL services, using Send/Receive tn lerface
(Doto exchange via standardized services provided os C-Functlons).
358
Working with Simolic NET Networks
Tobie 7- 12. PROFIBUS Communica tions Drivers for PC and Proa rammina IPG/PCI Stations.
Software Used with Description
DP-5613 CP 5613/5614 Software drivers for DP master/slave functionality. •
359
STEP 7 in 7 Steps
Ethernet C Ps ro r lhe S7-300 include the CP 343-1. and the CP 343- 1 IT; and for the 57-400. the
CP 4-43-1 and the CP 443-1 IT. Each short name liste d In the CP Module column actually
represents several CPs - each of whose full port number con ta ins the numeric port of the
short name (e.g .. 343- 1), These short names ore used os CP folder names in the catalog or
the Hardware Configuration Tool, The CPs found in a folder are of the san, e type and basic
feature set. For example . the CPs in the CP 343-1 ll folder all support internet capability and
incorporale the same basic communic a tions services. The different port numbers in a CP
folder may reflect the CP at different revisions, resulting from different firmware. Feature
enhancemen ts ore briefly described when you select the port in the catalog.
Tobie 7-13. Overview of Ethernet Communications Processors (CPs) for S7-300/S7-400 PLCs.
CP Module Brief Applcatlon Descrlpllon Comm. Services
This CP attaches the S7-300 to Industria l Ethernet, w ith - PG/OP Comm.
standard copobililies including remote programming - S7 Comm.
CP 343-1 between networks. Services or this CP a lso supports S7-300 - S5 Comm.
communication with other devices (e.g.. S7, S5, HMls. - ISO Transport
PCs), via ISO and TCP/IP transport connections. - TCP/IP Transport
HARDN ET CPs like the CP 1613, are recommended in cases where use of PC resources must
be minimized. Example uses include redundan t S7-H systems. where several CPs ore needed
in one PC. in high performance HMI applications (e.g., WlnCC). and large (more lhon five S7-
PLCs) supervisory/data acquisition systems. SOFTNET CPs. like the CP 1512 and the CP 1612.
ore typically used for STEP 7 programming systems, and in small supervisory/data acquisition
system s (e.g., less than live S7-PLCs) . These modules ore round under the SIMATIC PC Sta/ion
in lhe CP Industrial Ethernet folder of the hardware catalog. Software drivers for operating
PCs on Etherne t are described later in Ethernet Communications SeNices and Software.
360
Working with Simolic NET Networks
Tobie 7-14. Ethernet Communicatio ns Processors for PC and Proorammin< /PG/PC\ Sta tions.
CP Module H/S Brief Description Services
This PC network card is certified for use with all - PG/OP Comm.
Industria l Etherne t SOFTNET drivers. The CP 1512 - S7 Functions
CF' I 512
(PCMCIA)
s supports both ISO and TCP/IP protocols. and is - SS Comm.
intended for use fn non-criticol/non-stringen t - ISO and TCP/IP
applica tions (e.g., PG/PC, small HMI system).
This PC network cord is certified for use with 011 • PG/OP Comm.
Industrial Ethernet SOFTNET drivers. The CP 1612 - S7 Functions
CP 1612
{PCI)
s supports both ISO and TCP/ IP protocols, and is -S5 Comm.
intended for use in non-crilicol/non-sfringen1 • ISO and TCP /IP
opplicotlo ns (e.g., PG/PC, small HMI system).
PC drivers that support PG/OP services for programming sys tems on Industrial Ethernet o re
conta ined in each of the listed software drivers shown with on asterisk. The some is true for S5
compatible communications d rivers, required for S7-to-SS communica tion on ISO, ISO-on-
TCP. TCP, and UDP connecllons.
Tobie 7-15. Ethernet Communicatio ns Drivers for PC and Proarommina (PG/PC) Stations.
Software CPs Used With Desafpllon
S7-1613 CP 16 13 Software for S7 Functions.•
OPC Server All Ethernet CPs Interface to OPC capable Wind ows applications
Notes:• Drivers for PG/OP and SS compatible communication (i.e., ISO, ISO-on-TCP. TCP. and
UDP) ore contained In these software packages; corresponding OPC server Is also included.
361
STEP 7 in 7 Steps
The completed conriguration can be checked ror errors using a consistency check,
compiled and then saved. The configuration is saved to the System Doto object, which is
placed in the offline Blocks folder. The System Dato object may then be downloaded to the
CPU. !hereby providing the CPU wllh complete lnrormalion of the network configuration. The
CPU in turn transfers configuration parameters to the appropriate programmable modules.
362
Working with Simalic NET Networks
The major object containers of the ca talog, PROF/BUS DP, PROF/BUS PA, Stations, and
Subnets, ore presented in o tree struc ture. PROFIBUS-DP and PROFIBUS-PA containers include
objec ts for representrng DP or PA slave devices. The Station containers contain objects ror
StMATIC 300, SIMATIC 400, SIMA TIC PC. SIMATIC SS. SIMATIC S7-400-H statio ns. PG/PC, and
Other Stations {Non-Siemens stations). The Subnets lolder contains objec ts for MPt. PROFIBUS.
Industrial Ethernet, and Point-lo-Point Subnets. Once you place a subnet is in the
configuration, then compatible nodes may be placed in the w indow.
.~
PROFlBUS.PA
e D statio,,, ftJ PAOFlBUS DP
Other Station If PROFlBUS -PA
t ·§ PG/PC
Iii] SIMATIC 300
J-liil SIMATIC 400
j- g_ SIMATIC PC St&lion
8
I
0 Statioos
I ,....._! Othei Station
I ..,.,§
I
PG/PC
· !iii SIMATIC :m
Reedy Ready
Figure 7-4. (a) Network Catalog Left-Docking. (b) Network Catalog Un-Docked window.
363
STEP 7 in 7 Steps
During configuration. PLC station objects lor the S7-300, S7-400, S7-400 H. may be dragged lo
the window. If the station's hardware is not yet configured. you can open the station in the
hardware configuration tool by double clicking on the station name. You con return to the
network configura tion using the toolbar icon for Configuring Networks. PC workstolions,
PG/PC programming sta tions. and SIMATIC SS stations may also be dragged a nd dropped
into the station window. With these stations, you simply need to create and assign an
app ropriate network interface lo the station object in order to a ttach ii lo a subnet.
PROFIBUS DP slaves ore also shown as objec ts, based on the type ol drop (e.g., modular,
compact) . As the config uration is developed, you con either hide or d isplay the connection
between each DP master and its associated DP slaves, from the View menu.
1\1 Pli 1
Pl
.,_,ROfl0.1$, l
0 ROFIBLl5
ltrr'ffll lM
II
$ 74~0.Voew_l _O"
,.... ~ 153-1 mlii 153-1
•"'
'=
■~-,
•
-
m .' .•• ..
,.
11
e
:■
•
-•
57300_3_1ier_Exp•nsion
"'-.z:,. , :· '"''
,
g S740D_Mu~ lo_CPI.Js
.. ,.,
• )
.,,
■
\1
..
>,; ,,. . . .. .
4... ,..,_1 t i&.4 I+.: :
•••ll U
, .,.,
:
'r
. ... ..... 1; ,
•
•~
•
I -4~ ~ ~'! lilt ~-psruJ.:r1 ~a,J J1&..2 I Sl c ~ a~ 1vee FRa'DJS( l) (FRCf'BJS)
001AJ:00 cooiNtYJ S1»i., _Te1.bmn,ionl<ruJ1e,2 , ~ com-• • ·,1101"aJS<•i<!'AC11lOS)
Figure 7-5. Ne twork Configuration with stations shown connected to MPI. PROFIBUS. and
Industrial Ethernet. PROFIBUS DP Moster and associa ted modular DP Slaves highlighted.
364
Working with Simolic NET Networks
This final chapter considers building the network configuration graphically from the lop-
down. using the NetPro Configuration Tool. As you may hove already determined, lhe
network is b uilt from the bottom-up, as you install and configure the communications
processors using the Hardware Configuro1ion Tool. You may hove already token this
approach. In either case. the network configuration is completed in lhe Network
configuration tool, where you will need lo configure connecti ons be tween partners and
download the results.
As a whole. establishing stations on a network con be accomplished in jusl a few short tasks.
These tasks. some of which you may hove already performed. ore outlined below. Step-by-
step examples of con figuring MPI. PROFIBUS. and Industrial Eth ernet networks ore p rovided in
the following pages.
• Insert the subnets (e.g., MPI, PROFJBUS, or Industrial Elhemel} required in your
project. and configure the operating parameters- of each subnet.
■ If g lobal doto transfers ore required. then configure the Global Dolo table- for
/he participa ting CPUs, which reside on on MP/ s-ub ne/.
• Use the Setting the PG/PC Interface ut/rity. to select the appropriate ONLINE
interface In your programming sys/em (PG/PC),
365
STEP 7 in 7 Steps
Essential Elements
NelPro is similar to the Hardware Configura tion tool in that It provides o component object
catalog from which you may drag ond drop network objects Into the Network configuration
window. In this fa shion, you may b uild the framework of your network from the top, starting
with the subnets (I.e.. MPI. PROFISUS. and Industrial Ethernet). After you have inserted one or
more subne ts. you may then insert the required network stations. Network sta tions include the
S7-300. S7-400, S7-400 H. SIMA TI C ss, PG/PC. PROFISUS DP PA stations.
After you define the graphic layout of the network, you may then proceed to configure
each sta tion (i.e.. insert modules and define parameters). When you double-c lick on a
statio n. the statio n is opened in the Hardware configuratio n toot. where you moy configure
the cen tral rock with power supply. CPU. and the required communications processor (CP).
With the CP installed. you may then config ure its opera ting parameters. its address. and
finally attach the station lo the subnet. As you attach each CP, the next available address is
suggested.
Application Tips
As you insert and configure each communications processor. remember tha t eoch station
must have a unique address. In addition. you will also wan t to manage the assignment of a
unique MPI address to each CP installed in o rock a nd in the total subnet. Recall that in the
S7-300. STEP 7 automa tically assig ns on MPI address to each FM or CP. by incrementing each
a ddress by one starting with the a d d ress assigned to the CPU.
-----
1
• 3
■
5
■ ■
7
ElhernE<r(1)
lndustnal [ U1i>:ne1
•
Figure 7-6. Ne tPro Graphic connec tion o f S7-300 Stations o n MPI and Industrial Ethernet.
366
Working with Simolic NET Networks
ACTION
2 Wilh the project window open. from the right pone. double click on the MPI subnet
object o r press the Configure Network icon, lo open the NetPro configuration tool.
3 If th e network objec ts catalog is not open in the window. select View ► Catalog.
4 From the ca talog, expand the object folder for both the Stations and Subnets.
5 From the fist or Subnets, double click on the desired subne t type (e.g .. PROF/BUS.
MP/, or Indus/riot Elhemel) to inserl. Once the subnet objec t is inserted in the
window, you may drag the object up or down to o new position, as desired.
7 From lhe Station folder. you may inser1 stations in the configuration window wllh a
double click on the station type (e.g., SIMATIC 300, SIMATIC 400) or by dragging the
object on to the screen. You may insert as many stations as requ ired and may drag
a station to any new position you choose.
8 Double click on o station object (e.g.. on the Station name) to cause the station to
open in the Hardware ConFiguro tion tool. Then. creole a central rock. by inserting
the required Roel< . CPU, Power Supply, and the Communications Processor.
9 When you insert o CP /e.g .. PROF/BUS. Ethernet) . the p roper1ies dialog will appear:
attach lhe CP to the subnet. by selec ting the subnet name - the next available
address is ou tomoticolly entered in lhe field. You may accept or oller the address.
10 Save the central rack configuration in order to hove the results appear in the
network configuration when you return to Ne1Pro.
11 From the Network Configuration, you may al ter any network address. For MPL
double-click on the CPU object; for PROFIBUS or Industrial Ethernet stations, double
click on the a ssociated communications processor (CP) object.
12 You con configure each sta tion using the procedures o f Step 8 through Step 10.
13 When all of the stations ore completed, select Network ► Save and Compile to
perform a consistency check. and to save th e configuration to the System Doto.
367
STEP 7 in 7 Steps
Essential Elements
Yo u c on d ownload the network c o nfigura tion for a stolion. using the PLC ► Download
command. either from the Simotic Manager. or rrom the Hard ware Configuration toot when
c o nfiguring sta tion hardwore. By downloading the c o nfiguration from the Ne twork
Configura tion Toot. you may d ownlo ad the entire configuration s1alio n b y sta tion lo a ll
sta tio ns on o subnet. Yo u m ay also choose to download the network co nfiguration of
selec ted statio ns only. In add ition. you con selectively d ownloa d specific sta tions a long with
the associa ted connections a nd config urations for communicatio ns p artners.
Application Tips
As you p rep are lo download 1he network configuration. consider that white ii is possible lo
d ownload the configura tio n ove r o subnet. tha t a ll sta tions must hove been previously
a ssigned uniq ue station addre5,5es. In add ition. you will o lso wo nt lo ensure the assignm en t of
a uniq ue MPI a ddress lo eac h CPU, CP. a nd FM installe d in o rack and in the tota l subnet.
Recall that in the S7 -300. STEP 7 automatically assigns o n MPt address to each FM or CP. by
incrementing each a ddress by o ne starting wi th the address assigned to the CPU.
rvF'II 1)
l\1PI
• -·
liiiD ,,.
~
·• •
CP CPU CP CPU CP
liiiil 30)-1 liiiII :143-1
2
• • 6
368
Working with Simolic NET Networks
ACTION
1 When you ore done with configuring your network. you must ensure lhol you hove
assigned unique addresses lo each station (including sta tions whose addresses ore
set using switches.
2 Network connections must be completed for all stations tho! are communications
partners in configured connec tions (e.g .• S7. FDL, FMS, ISO. ISO-on-TCP. TCP/IP, etc.).
3 When all of the stations ore completed. select Network ► Save and Compile All lo
perform a consistency check, and to save 1he configuration to the System Doto.
4 When downloading for the first time. you must use a direct connection lo each
station's MPI port. Later a f1er each CPU is a ssigned o unique MPI address. the
configuration may be downloaded via lhe MPI subnet. Aller the initial download. ii
is also possible to download via PROFIBUS or Ethernet is subnets if they ore in place.
From the menu. select PLC ► Download ► Stallons on Subnet to transfer the network
configuration to all stations on the subnet - one-by-one. Connections. s1o tion
addresses, 1/0 addresses. subnet p roperties. and module porome1ers ore
downloaded.
From the menu. select PLC ► Download ► Selected Stations to transfer lhe network
configuration o f only the selec ted stations. Connections. 1/0 addresses. station
addresses. subnet properties. and module parameters ore all downloaded.
From the menu. select PLC ► Download ► Selected and Partner Stallons to transfer
the network configuration of only the selected stations and its configured
communications partners. Connections. 1/0 addresses. station addresses. subnet
p roperties. and module parameters ore all downloaded.
From the menu. selec t PLC ► Download ► Selected Connections to download the
selected connections of a station and to the partners involved in two-way
communica tion. Only the selected connections ore downloaded.
From the menu, select PLC ► Download ► Connections and Gateways to transfer
the configured connections to the selected module and its partner stations.
Connec tions and gatewa y inFormotion ore downloaded (in RUN -P or STOP modes).
369
STEP 7 in 7 Steps
Essential Elements
You may insert a new MPI subnet from the SIMATIC Manager or the network configuration
tool. Once you insert the subnel. you must configure ils General and Network Se/lings
properties (See figure below). The General properties inc lude a subnet Name and Subne t ID.
Modifying lhe subnel ID is unnecessary. slnce this automatically derived ID {STEP 7 derived
project number - subne t number) will always b€1 unique. The Network Settings allow you to
define the transm issio n ra te, and the highest statio n a ddress ( HSA). The standard tran smission
ra te for MPI subnels is 187 .5 Kbs. b ut this can be set to a maximum of I 2Mbs to support the
CPU 318-2 and the S7-400. The transmission ro le, however, musl be sel ror the slowest station.
Application Tips
The highest MPI address selling should be set to a value equal lo or greater than the highest
o c tuol station address. A hig hest station address of 3 I (HSA =31) is wha t is recommended in
order to optimize the polling of network stations during normal. diagnostic, programming. or
other network operations.
Properties - MPI 1
I
Generl!I J Netwoik Setting$
Name: jMP1(2)
S7 t\lb net ID: 10020 I • looss
Ptoject~ j\Waehouse_l\MP1(2)
Sl01age location
of the p,ojed: IC:\P...t,ick \57_Pro',ecu\\1/aehous
~ ,: fC.T.Jone~
Dote c,e.,ted- 21 09..200~ 14:58·39
Lau modfaed. 21.09.2004- 14:58:39
Colm'lert
OK
I Cancel I Help l
Figure 7-8. MPI Properties: General settings dialog.
370
Working with Simolic NET Networks
Prnrertie., - MPT _
OK
I Cancel j __H_elp_....,
Figure 7.9_ MPI Propenies: Network Se11ings dialog.
ACTION
I Open the SIMA TIC Manager and 1he project where the MPI subnet is to be added.
2 Select the project folder, and then from the menu. setecf Insert ► Subnet ;.. MPI. This
step is only required ir you ore adding on additional MPI subnel.
3 In the right pone of the project INindow, double c lick on any subnet object or press
the Configure Network toolbor bu tton to open the network configuration tool.
4 With the configuration tool open. setect the MPI subnet object. double click on the
subnet or right-click, and select Object Properties lo open the properties dialog.
5 From the General tab, you may choose to keep the default Name of the MPI subnet
[e.g., MPI (1 )). or you may modify the name to renecl 1he subnet' s func tion.
7 On the General tab. you may enter o deportment name in lhe Author field. or
perhaps your name ii you ore defining the subnet p roperties; you may enter or
modify the Comment tines to describe the subnet's function in the projec t.
8 From the Network Settings lob. oclivole the Change check box in order lo modify
the Highest MPI Address. For best performance set the ac tual highest address.
9 From the listed options. choose the Transmission Rate to use for the entire MP!
subnet. This setting must not be higher than what Is supported by the slowest stolion.
10 Select the OK b utton to accep t 1he seltings for 1he MPI subnet operoling properties.
371
STEP 7 in 7 Steps
l!IGJE'J
·": ' MPI_Prj (Network) •· D:\ S7_Pr ojert~\ Ml'l _rrj
· 1' I 1} 1 .
lf-'I
■
3
•4
• 5
◄ ~
Fig ure 7-11. NelPro config uro lio n tool. showing connection of S7-300/57-400 statio ns on MPI.
372
Working with Simolic NET Networks
Quick Steps: Building an MPI Network with Peer S7-300/ S7 -400 Stations
ACTION
1 Open lhe SIMA TI C Manager to an existing project or crea te o new projec t using the
New command.
2 With the project folder open in the SIMATIC Manager, from the menu select Insert ►
Station ► SIMATIC 300 Station. Insert ol leosl two additional S7-300 or S7-400 sta tions.
3 Wilh the project folder selected. note in lhe right pone that STEP 7 hos already
generated a n MPI subnet (created by default wiih each new p rojec t).
4 Double c rick on the subnet. or press the Configure Ne twork loolbor button to open
the Network Configura tion tool. Your MPI network should appear, along w ith objects
that represent the MPI subnet and the S7-300/S7-400 sta tions you crea ted.
5 Double cllck on the MPI subnel objec t. lo configure the subnet operoling properties
(e.g., Transmission Rate, Highest MPI Address) on the Network Settings tab. The
subnet Nome con be modified on the General tab (See the previous task, "Adding
and Configuring on MPI Subnet").
Double click on th e first station object (e.g., on the Slotion name) to open the
sta tion in th e Hardware Configuration tool. Configure a central rock. inserting the
required Rock. a Power Supply. and CPU.
7 Double click on the CPU object and when the dialog opens, press lhe properties
button in the MPI Interface box.
8 When the MPI parameters dialog appears; olloch /he CPU to the MP/ subnet, by
selecting lhe correc t subnet from lhe list; the next available address is ou tama tic olty
assigned when you selec t the subnet; you ma y also en ter any valid a ddress.
9 Save the central rock configura tion and press the Configure Network. icon on the
toolbor lo return to the network configura tion. The sta tion will appear connected to
the MPI subne t when you reh.1rn to the network configuration.
11 When you are done wi th all stations. select Network ► Save and Compile to perform
o consistency check for errors and to save the configuration to the System Doto.
373
STEP 7 in 7 Steps
Essential Elements
To establish a PC as a programming station on MPI, on MPl-compatib le network interface
cord (e.g., CP 5511/CP 5611. or CP54 12 A2)musl be installed in the PC. and configured in
Windows. If you hove a , PG programming d evice (e.g.. PG 720. PG 740). then it will alrea dy
be equipped with the MPI networ1<. The d river software for programming runclions (PG/OP)
over MPI is installed during the initia l installation of STEP 7. With the physical connection in
place, you only need to configure a logical interface connection for the PG/PC.
To configure your programming device. you must first insert a PG/ PC object in the Simatic
Manager or in lhe Network Configuration tool. and then configure and assign it o n interface.
An interface defines the subne t. and node address. When you assign the interface lo one ot
the ac tua l network cards on the PG/PC. then ii will be adap ted to the configured sellings of
the interface, including the operating properties of the subnet to which it is attached. If you
modiFy the configured settings (e.g.. the network tronsmi$Sion rate). the interface on your
PG/PC is automatically adapted to match the new settings.
Application Tips
Since o nly one configured p rogramming d evice (PG/PC) is allov,ed in a project, by c reating
several interfaces, w hich con be assigned lo the PG/PC. you con conveniently switch
interfaces. Severa l interfaces may be assigned lo a PG/PC. however only one can be
activated as the S70NLINE interface at a given time. Witho ut this function. you would have
to coll up the "Setting the PG/PC Interface" progra m and ma nually adopt the interface
settings of your PG/PC to the configured se ttings.
374
Working with Simolic NET Networks
rii1
}jMPI_PrJ (,etwork) -- C:\ Palrick\ S7 _ProJech \ MPI_Pr i - IOI XI
F ~ .,
ii
0 2
1¥1P!{ 1)
l,1PI
.
SIMATIC 300(1) SIMATIC 300(2) SIMATIC 400( 1)
liiill C PU
316
■
m CPU
)10
■
II CPU
.;10-1
■
3 4 5
• ~
Figure 7-13. Ne!Pro Graphic configuration of PG/PC assigned to a specific MPI interface.
II 1
ACTION
Open the SIMA TIC Manager, lo the project where you wish to establish the PG/PC as
a sta tion on on MPI Subnet.
2 If the PG/ PC object is not a lready installed. selec t l he project folder, rig ht click. and
select Insert New Object ► PG/ PC. Skip this step if lhe PG/PC is already installed.
3 With the project folder selected, from lhe right pane, double click on lhe MPI subnet
object to open the NetPro graphical network configura tion tool.
Wllh lhe network configuration open. selec t the PG/PC object. right-click and selec t
Objec t Properties; or double c iick on th e PG/ PC object lo open the properties dialog.
5 From the General lob, you may modify the defa ult name PG/PC {I ). too na me you
choose. You may also modify o r enter a new Author o f the interface parameters, ond
modify or enter o Comment describing the use of the programming system.
6 Select lhe Interface lob, lo display existing Interfaces or c reate a new MPI interfac e to
which you wish to assign lo the PG/PC.
7 Select lhe Assig nment lob, to d isplay the configured MPI interfaces a nd interface
parameter se ts (I.e .. physically insta lled interfaces) previously denned in lhe PG/ PC.
8 From the Not Assigned b lock, selec t the logica l MPI interfa ce you wish to assign lo the
physical interface in lhe PG/PC: the n from the Interface Parameter Assignm ent
window, selec t the physical interface or the PG/PC;
Press the Assign button. The "Assign" but1on will b e g rayed out unless the config ured
interface you choose is networked a nd the selected interface parameter assignment
matches the configured interface.
9 With a log ical interface assigned to a physical MPI Interface, you may then activate
the S70NLJNE check box if you wish to activa te !his interface a s the c urrent means for
establishing and the online connection to STEP 7.
375
STEP 7 in 7 Steps
Essential Elements
For GD communica tion. you must conFigure a global doto table. in the Ne/Pro Configuration
Tool. This table \viii define the CPUs Involved. the memory a reas sent. and the memory areas
in which dolo a re received. In the GD table, you may d efine up lo fifteen C PUs. where each
CPU is assigned to o column. As you define each CPU, the CPU and station identi fier appear
in the column header. In each row. in the cells beneath each CPU you will specify an
address for the CPU lo send or in w hich lo receive dolo. A CPU is identified os the sender if
the send address is preceded by the send character "► ". In a given row. a blank cell
indicates the CPU In this column is not par1icipaling in lhe data exchange.
Application Tips
You may use Input (I) addresses as global data receive a reas in the S7-300 and S7-400, If a
corresponding module is no t insta lled. In S7-400, you may handle g lobal data transfer from
you program, using SFCs. When the GD table is completed and compiled, each so-called
globa l d o ta row (GD row) receives a unique GO identifier (GD ID). You may use the GO ID as
o parameter inpul to sys1em functions (SFC). in th e S7-400, when exchanging global dolo
using SFC 60 (GO_SND) a nd SFC 61 (GD_RC V).
1 GD .l. l . l
2 CD .l. 1. 2
1----i '• M, ...
3 Gl> .l. l . 3
.
CD 2 .1. 3
'
1==---1·· ...
'1 r.n
l·· -... . _ .._
4
Figure 7-14. Globa l Da to Table, for configufing address for global data exchange.
376
Working with Simolic NET Ne tworks
ACTION
1 Open lhe SIMA TIC Manager and project w here you wish to creole a g lobal data
table.
2 From the menu select, Options ► Configure Network, or simply press the NetPra icon
to open the NetPro network configurolion tool.
3 When lhe networ1c configuration window opens, select lhe MPI subnet objec t.
4 Verify that all stations that will pa rti c ipa te in the g lo ba l data ta ble ore atta c hed to
lhe MPI subne t. Use the following step to o ltoch ony stolions not a lready a llached.
S Select the C PU o bject o f the station. right c lick. select Object Properties: press the
Properties button und er the Interface box lo open the MPI Interface d ialog. A tta c h
the station by selecling the subnet. sel the address if required. a nd confirm with OK.
6 Select the MPI subnel, right-click and select Define Global Data.
7 Select the first column. right o f the GD ID column, righ t-click a nd selec t CPU . .. to
define the first column ror o CPU that will porlicipole in the g lobal data excha nge.
When the project d ia log opens, d isplaying the project. expand the station objects
to display and select a CPU. Select a CPU a nd confirm the selection by pressing OK.
8 Repeat the procedure of defining a column for each CPU that will participate in the
g lo ba l d a ta exchange.
9 Starting with the first GD row and first CPU, specify o n address from which the CPU
will send d ata, or in w hich ii will receive dolo. To identify o send address, right-c lick
and select Sender: oil other addresses o re marked Receiver by default.
10 When done, from the menu select GD Table ► Save to save the GD table.
11 From the menu, select GD Table ;.. Compfle to generate a g lo ba l data Identifier (GD
ID) for each set of global data (GD Row) and to compile the d ownload data .
377
STEP 7 in 7 Steps
Essential Elements
You may insert a new PROFIBUS subnet from i he SIMATIC Manager or lhe network
conngurolion tool. Once you insert the subneL you must configure ils General and Network
Settings properties (See fig ure below}. The General p roperties include b asic d ocumentation
suc h os Nome and Subnet ID. Modifying the subnet ID is unnecessary. since this oulomotically
d erived ID (STEP 7 d erived project number - subnet number} will a lways be uniq ue. Tne
Network Settings a llow you lo define PROFIBUS operating characteristics, including !he
transmission role. the highest station address (HSA). and lhe bus parameters.
PROFIBUS bus parameters ore actually the timing values for the token bus. You may define
the bus parameters. but since these values must be consistent for the entire network ii is not
recommend ed. Instead. STEP 7 o ffers predefined "Profiles." ea c h o f whic h optimizes lhe
p arameters for the makeup of a typical network. You can select a p rofile bosed on the
makeup o f your specific network.
Application Tips
II possible. you should creole and configure nodes that you wont to connect in a network in
the same project. By placing fh e stations in lhe same project, STEP 7 is able lo c heck your
en tries (e.g .• oddres.ses. connections. etc.) for consistency. In o large p lan t with several
statio ns. ii may be necessary to creo le a number of subnets. While you may manage these
subnets in a single project, you may decide lo handle the subnets in multiple projects. If
stations in d ifferent projects need to be connected. you may assign the station to more than
one subne t [i.e .• in d ifferent projects).
Propertie~ - PROFlllUS
Name: IPROFlBUS(31
S7 soonel ID. Joo20 - loll'56 ·
Project ~lh, I\Werehouul_ 1\PAOFlBUSP)
Stor~ e loeecio,i
ol the.pr,oiect lc:\Patrick\S7J'rojeds\\liaehous
At.4hor. jc.~_.Jo~,= =
Date created :?1 .09.2004 15:10:42
IAst modiied 21.09.2004 15:10;42
Comment _;]
I .:.l
OK
I Help I
Figure 7-1 5. PROFIBUS subnet Properties: General settings dialog.
378
Working with Simalic NET Networks
Proli~
Univertal(DP/ FMSJ
Use,-Oerl'led
Bus Paameter& .. j
I Cancel j __He_~__,
Figure 7-16. PROFIBUS subnet Properties: Network Sellings dialog.
ACTION
1 With the SIMATIC Manager open to the project of the new PROFIBUS subnet. select
the project folder. and then from the menu. select Insert ► Subnet ► PROFIBUS.
2 In the righl pone of lhe project window. double c lick on any subnet object or press
the Configure Ne/work loolbar bu tto n lo open the Network Configuration tool.
3 In the network conliguro1ion view. double click on lhe PROFIBUS subnel objec t or
right-click o n the objecl and select Object Properties to open the properties d ialog.
4 From lhe General lob. you may keep or modify the deloull Name of fhe subnel.
and fhe S7 Subnet ID (this STEP 7 derived ID number will a lways be uniq ue).
5 Also on the General tab, you may enter a deportment name in the Author field, or
perhaps your name if you ore defining the subnet p roperties; you may enter or
modify the Comment lines to describe the subnet's fu nction in the p roject.
6 Select the Network Se/lings lob. and a c tivate the Change c hec k box to modify the
Highest PROFIBUS Address. For best performance se t the actual highest address.
7 Use the Options button, to specify further. the physical characteristics of the subnet;
this will allow STEP 7 lo determine the catculo ted bus parameters more accura te ly.
8 From listed options. choose the Transmission Rate for lhe en tire PROFtBUS subne t. This
setting must not be higher than what is supported by the slowest node.
9 From lhe listed options. selecl a Profile of lhe ne lwor1<: configuratio n to delermine
p redefined bus liming parameters based on network makeup. To set the bus-
passing parameters manually, select the User-Defined profile. then the press Bus
Parameters bulfon.
10 Select OK lo accept the settings for the PROFIBUS subnet operating p roperti es.
379
STEP 7 in 7 Steps
Essential Elements
PROFfBUS networking options for the S7·300 include CPs that support lhe DP pro tocol (CP 342·
5, CP 342-5 FOi, or Iha ! support the FMS protocol (CP 343-5). CPs that support PROFIBUS DP
may support both the DP-mosle< and DP-sla ve func tionality. This capability allows the S7-300
to act as a DP-master or as DP-slave. Newer PROFIBUS CPs may a lso support routing fea tures,
which allows communication between networks (e.g.• Ethemel-lo-PROFIBUS).
~lame·
Projed paltc
Stc.a,;,elocl!lion
ol the project lC:\Patrick\S7.Pioiecis\Prill.300
Aulho1 le.T.Jone~
D•!•cr....ted. 21.09,2004 16:20·55
LMI modirlf>d'. 21.09.2004 16·20.55
Convne~
.d
I'~ - - - - - - - - - - - .z.J
I OK I Cancel Jielp
i4t·l·IPIJl4W44·lii-lf~iffli9;diiiidlJi;t•Jt\lf -
Gene,al Pa,em!llelf I
Adoess: JG .:)
Highest addle..s-. 126
T,-miuion ,ate: 1.S t,tbl:,~
Slb\el:
New...
I
f'Joperties,..
I
Delete
I
I OK
I Canca Help
380
Working with Simalic NET Networks
-
SlMATIC 300(1) SIMAT!C 300(2) SIMATIC 300(3)
fiiiii1 CPU CPU CP CPU er
!MWJ ltfJ [iiil] 316 343,6 liml 318 W,S
• 3
••
5 5
•• 7 6
Figure 7- 19. PROFIBUS Station addresses 4. S. a nd 6, shown attracted to the subnet in Ne!Pro.
■ ACTION
I Open lhe SIMATIC Manager and project where the PROF!BUS CP will be inserted.
configured, and attached. If necessary, odd and configure a PROFIBUS subnet as
described in the p revious task, "Adding and Configuring a PROF/BUS Subne t."
2 With the project folder expanded, select the station where you will install the C P,
then From the right pone double click on the station hardware object lo open the
hardware configura tion tool.
3 Open the SIMATIC 300 catalog object to view the S7-300 component fo lders.
4 Open the CP-300 folder. then under the PROFIBUS sublolder open the appropriate
CP sublolder (CP-342-5. CP-342-5 FO, CP-343-5/. to selec t a DP. DP over fiber, or FMS
module. Select the desired CP and drag if to slot-4 or hig her in the S7-300 rock.
5 If th e interface properties dialog of the new CP does not open automatica lly, when
inserted. then selec t the CP, right-click and select Object Properties: lhen press the
Properties button to open the interface d ialog.
6 From the General tab, you may modify the default name o r the CP. You may a lso
enter a new Author of the CP configuration. and enter a Comment on the CPU use.
7 From the Parameters lob, set the Address tor this CP. as desired. or perform the next
step fo hove the next available PROFIBUS address (1 - 126) a utomatically assigned.
8 From the Subnet list box. select th e correc t subnet to which this communications
processor should be attached. Press the OK bu tton to confirm your selections.
10 From lhe menu bar. select Station ► Save to save the configuration. Use Save ►
Compile to generate the System Doto object that you will download lo the CPU.
381
STEP 7 in 7 Steps
Essential Elements
Selecting a nd installing t11e appropriate PROFtBUS communications processor (CP) is olt that is
required to establish o n S7--300 station os o nelwork sta tio n. In this task. o n of the slalions will
use the same communications processor; however. the exac t module optio n will depend on
whether a copper or fiber (FO) media is used, and what communica tions p ro tocols must be
supported in your application.
Application Tips
In coses where the cenlrol rock for lhe S7-300 stolions will be identical or very simflor, you
should complete one stolio n lo include the rock. power supply. interface modules (IMs). o nd
sig nal modules (SMs) that will be identical in o il stations. ond then use the Cut ond Pas te lo
duplicate the station. You migh t c hoose to d uplica te th e orig inal sta tion prior lo inserting the
communications processor. When you manually insert the CP in each station, STEP 7 will
assign a unique address lo each. Otherwise. you will hove to modify each station address.
.~ 11 < No Fi
',;J! Prof_300 -- 0:\ 57 _Projects\ Prof_300 l!!lliJ £i
Prof_300 SIMATIC 300{1)
SIMATIC 300{2)
SIMA TIC 300(3)
MPl(1)
J-lr-", PROFIBUS(l }
• 3
••
5 5
•• T 6
•
Figure 7-21. NetPro Graphic configuration of S7-300 Peer Stations o n PROFIBUS.
382
Working with Simolic NET Networks
ACTION
1 Start· the SIMATIC Manager and Cre a te o new Project using the New command.
2 When lhe New Project dialog oppeors, type in o p rojecl name in the Name field.
Verify that the Storage Location Pa th is where you wish the project to be stored.
3 With the project folder open in the SIMATIC Manager, from the menu select Insert ►
Station ► SIMATIC 300 Station. Insert at least two or more S7-300 stations.
4 Wi th the project folder selected. from the menu select Insert ► Subnet ► PROFIBUS.
The PROFIBUS subne t objecl will be inserled in lhe right pone of the project window.
S Double click on lhe subnet or on the toolbor p ress the Configure Network button lo
open the Network Configuration tool. The network configuration window will open
wilh objects Iha! represen l lhe PROFIBUS subnet. and lhe S7-300 stations you
creeled.
6 Double click on the PROFIBUS subnel object lo define the subnel operoling
properties (e.g .. Highest PROFIBUS, Address, Transmission Rote, and bus Profile) as
described in the p revious task "Adding and Configuring o PROF/BUS Subnet.")
7 Double click on the first station object (e.g., on the Station name) to open the
station in the Hardware Configuration lool. Configure a central rock by inserting the
required Rock. Power Supply. CPU. and PROFIBUS communications processor (See
Slep BJ.
8 When the CP is inserted. lhe properties dialog will open oulomotically; configure the
properties (including o unique address) and allach lhe C P lo the subnel as
described in lhe previous task " lnslol/ing, Configuring. and Al/aching a CP."
9 Save the central rock configuration and press the Configure Network. loolbar icon
to return to the network configuration. The slo tion will appear connected to the
PROFIBUS subnel when you return to the network configuro lion.
11 From lhe menu, select Network ~ Check Consistenc y to perform a check for errors.
12 From lhe menu bar. selecl Network ► Save .lo sove lhe network configuration. Use
Save and Compile to generate the System Doto lha l you will download to lhe CPU.
383
STEP 7 in 7 Steps
Essential Elements
PROFIBUS networking options for the S7·400 include CPs lhot support the DP prolocol (CP 443·
5 Ext.). or that support the FMS p rotocol (CP 443-5 Basic). Newer PROFtBUS CPs moy a lso
support routing features. which a llows communicatio n between networks (e.g .. Ethemet-to-
PROFIBUSJ. PROFIBUS CPs must be installed in a rock tho! hos the communications b us (C-
Bus) , (e.g .• central roc k [CR). or universal rock (UR)).
lkl·l1t§litil?;i•iil;t';itbf§ldiii;itfli·dhtlf,J•ttJ1J
G~n(lta\ I Pnrameteit l
Name;
P1oject p!Jlh:
StOfage looalion
of !he project
Aulhor le. T. J ones
Dai:e cieoteit 21 09-2004 16·40:«
Lail rnodfied 21 OS 2004 16·40:«
Comrnehl:
I OK I
Figure 7-22. Ge neral lob: CP 443-5 Basic PROFIBUS Interface.
iPi!litilitiil4;hlild!®J916idliilihii;60tli1ItMfl
Addreu : 13 .:]
Higl¥.>st addre:s: 126
l ron,mi:sionrots: l ,5 Mbp,:
Slbnel:
-- not nelworl,.ed - · N'ew...
I
P10pertiea ,
I
Delete
I
I OK
I
Figure 7-23. Parameters lob: CP 443·5 Basic PROFIBUS Interface.
384
Working with Simolic NET Networks
.iffi
~~P,·of_400 (Network) •· C:\ Patrick\57_Projccts\Prof_4
.U....,.t-:1--
tvlf'I
- 1
PPOF,BUS( ·1)
PROFlSUS
II • ■ ■
CPU CPU CP CPU CP
416-1 41 &- I 44:).., 4l&-1 44'.l·S
llailc Da>io
■ ■ ■ ■
3 5 5 7 1
• ~
Figure 7•24. PROFIBUS Stollon addresses 3. 5. and 7. shown o ttrocled to the subnet in NetPro.
ACTION
1 Open the SIMA TIC Manager and project where the PROFIBUS CP will be inserted,
configured, and anached . If necessary, a dd and configure a PROFIBUS subnet as
described in lhe previous task. "Adding and Configuring a PROF/BUS Subnet."
2 With the project !older expanded, selecl the station where you will install I he CP.
then from the right pone double click on the sla tion hardware objec t to open the
hardware configura tion tool.
3 Open the SIMATIC 400 catalog object lo view the S7-300 component folders.
4 Open the CP-400 folder. then under the PROFIBUS subfolder open the approp ria te
CP subfolder (CP-443•5 Basic. CP-443-5 Extended). to selec l from the FMS or DP
modules. Select the desired C P and drag i1 to slot-4 or higher in the S7-400 rock.
5 II th e interface properties dialog of lhe new CP does not open automalically, when
inserted, then selec t the CP, right-clic k and select Object Properties: then press the
Properties button to open the interface dialog.
6 From the General tab. you may modify the default name of the CP. You may also
enter a new Author of the CP configuration, and enter a Comment on the CPU use.
7 From the Parameters tab. set the Address for this CP. as desired. or perform the next
step to have lhe next available PROFIBUS address (l-126) automatically assigned.
8 From lhe Subnet list box. select the correct subnet to which this communications
p rocessor should be attached. Press the OK bul1on lo confirm your seleclions.
9 From the menu. select Station ► Consistency Check to check for errors.
10 From the menu bar. select Station ► Save to save the configuration. Use Save ►
Compile lo generate lhe Sys te m Dalo object lha l you will download to the CPU.
385
STEP 7 in 7 Steps
Essential Elements
Selecting and installing t11e appropriate PROFtBUS communications processor (CP) is olt that is
required to establish o n S7-400 station os o nelwork station. In this task. on of the slalions will
use the same communications processor; however. the exac t module optio n will depend on
whether a copper or fiber (FO) media is used, and what communica tions pro tocols must be
supported in your application.
Application Tips
In coses where the cenlrol rock for lhe S7-400 stolions will be identical or very simflor, you
should complete one stolio n lo include the rock. power supply. interface modules (IMs). ond
sig nal modules (SMs) that will be identical in o il stations. ond then use the Cut ond Pas te lo
duplicate the station. You migh t choose to duplicate th e original station prior lo inserting the
communications processor. When you manually insert the CP in each station, STEP 7 will
assign a unique address lo each. Otherwise. you will hove to modify each station address.
~ , 1< No Fi
HH
,!i Pror_ 400 {Ndwu,k) - C:\Pdtritk\ S7 _Projf!Ch\ Prr,I_4 LL
PROFIBUS( I)
PROFIBUS
3
••5 5 7
• 7
•
Figure 7-26. Net Pro Graphic configuration of S7-400 Peer Slotions on PROFIBUS.
386
Working with Simolic NET Networks
ACTION
1 Start· the SIMATIC Manager and Crea te o new Project using the New command.
2 When lhe New Project dialog oppeors, type in o p rojecl name in the Name field.
Verify that the Storage Location Pa th is w here you wish the project to be stored.
3 With the project folder open in the SIMATIC Manager, from the menu select Insert ►
Station ► SIMATIC 400 Station. Insert at least two or more S7-400 stations.
4 With the project folder selected. from the menu select Insert ► Subnet ► PROFIBUS.
The PROFIBUS subne t objecl will be inserled in lhe righl pone of the p rojecl window.
S Double click on lhe subnet or on the toolbor p ress the Configure Network b ulton lo
open the Network Configuration tool. The network configuration wind ow will open
wilh objects Iha! represen t lhe PROFIBUS subnel. and lhe S7-400 stations you
creeled.
7 Double click on the first station object (e.g., on the Slotion name) to open the
station in the Hardware Configuration. Configure a central rack by inserting the
required Rock. Power Supply. CPU. and PROFIBUS commvnicotfons p rocessor (See
Slep BJ.
8 When the CP is inserted. lhe properties dialog will open aulomatically; configure the
properties (including o unique address) and altach lhe CP lo the subnel a s
described in lhe p re vious ta sk "lnslol/ing, Configuring. and Al/aching a CP."
9 Save the central rock configuration and press the Configure Network. loolbar icon
to return lo the network configuration. The sla lion will appear connected lo lhe
PROFIBUS subnel when you return to the network configuro lion.
11 From lhe menu, select Network ~ Check Consistenc y lo perform a check for errors.
12 From lhe menu bar. setecl Network ► Save . lo save lhe network configuration. Use
Save and Compile to generate the System Doto lho l you will d ownload to lhe CPU.
387
STEP 7 in 7 Steps
Essential Elements
To establish a PC os o programming station on PROFIBUS, a PROFIBUS network cord (e.g., CP
5511 /CP 5611 or C P5412 A2) must be inslo lled and configured in Windows, and the
app ropriole SOFTNET or HARDNET driver must be inslalled. II you have a, PG programming
device (e.g., PG 720, PG 740). then ii will already be equipped with the MPI network. The
driver software for programming functions (PG/OP) over PROFIBUS is installed d uring the initial
installation of STEP 7. With the physical connection in place, you only need lo configure a
logical interface connec tion for the PG/PC.
To configure your programming device, you must first insert a PG/PC object in the Simatic
Manager or in the Network Configuration toot, and then configure and assign it an interface.
An Interlace defines lhe subne t. and node address. When you assign the interlace to one o f
the actual nelwork cards on the PG/PC. then ii will be adapled to the configured settings of
the interlace. including the operating properties of the subne t to which it is a ttached. If you
modify the configured setlings (e.g ., the network transmission rate). the interface on your
PG/PC is automatically adopted to match the new settings.
Application Tips
Since o nly one configured p rogramming device (PG/PC) Is allowed in a project. by c reating
several interfaces, w hich can be assigned to the PG/PC. you can conveniently switch
interfaces. Severa l interfaces may be assigned to a PG/P C, however only o ne con be
activated as the S70NLJNE interface at o given lime. Without this function. you would ha ve
to call up the "Setting the PG/PC Interface·• program and manually adapt the interface
settings of your PG/PC lo the configured settings.
Anigned:
S70NUNE Ac011n:
..!J r Acwi:,
OK I Cancel Help I
Figure 7-27. PROFIBUS Interface Properties: Interface Parame ters dialog.
388
Working with Simolic NET Networks
rid
.};P<of_300 (...,twork) -- C,\P•lrlck\57_Prot~ct.\PM>f_30 .• lc l_~J
PROFIBUS( I J
PROFIBIJ':
lo
IIIiD
---
) 10
'
SIMATIC 300( 1)
CPU CP
3Cl¢ liiIII CPU CP
310
'
SIMATIC 300(2)
343·6 m
'
SIMATIC 300(3)
CPU CP
) 18 ~-6
•3 • 4
•5 •5 • •6
7
•
Figure 7-28. NetPro Graphic configuration of PG/PC and Peer S7-300 Sta tions on PROFIBUS.
1 Open the SIMATIC Manager. to the p rojec t where you wish to establish lhe PG/PC as
o stolion on o PROFIBUS Subnel.
2 If th e PG/PC object is not already installed. selec t the project folder, right click, and
select Insert New Object ► PG/ PC. Skip this step if the PG/PC is already installed.
3 With the project folder selected. from the right pone. double click on the PROFIBUS
subnet object to open the NetPro graphical network configura tion tool.
4 With the network configuration open, select the PG/PC object. right-click and select
Object Properties: or double click on the PG/PC object to open the properties
dialog.
5 From the General lob. you moy modify the default nome PG/PC (I ). too nome you
choose. You may also modify or enter a new Author of the interlace porometers. and
modify or enter o Comment describing the use of the programming system.
6 Select the Interlace lob, to display existing interfaces or create a new MPI interface
to which you wish lo assign lo the PG/PC.
7 Select the Assignmen/ lob. to display the configured PROFIBUS interfaces ond
interface parameter sets [i.e.• physically installed interfaces) previously defined in the
PG/PC.
8 From the Not Assigned block. selec t the logical PROFIBUS interface you w ish to assign
to the physical interface In the PG/PC; then from the Interface Parameter Assignment
window, selecl lhe physical PRO FIBUS inlerfoce found in the PG/PC;
9 Press the Assign button. The "Assign" button will be grayed out unless the configured
interface you choose Is networxed and the selected interface parameter assignment
(i.e., PROFIBUS Network card) matches the configured interface.
With o logical interface assigned too physical PROFIBUS interface. you moy then
activa te the S70NLINE check box if you wish to activate this interface as the current
means for establishing and the online connection lo STEP 7.
389
STEP 7 in 7 Steps
Essential Elements
On PROFIBUS. you may configure connections that facilitate FDL. FMS. or S7 communicatio n
services. FOL communication is possible between S7 PLCs, S7 and SS PLCs. or between S7
PLCs and o ther FOL compatible devices (e.g.. PC stations). FMS communica tion is possible
between S7 PLCs. between S7 a nd SS PLCs, and between S7 and other FMS compatible
d evices je.g .. PC stations). Anally. S7 communica tion is possible between S7 PLCs. operator
statio ns. and PCs. tr you configure on S7 connec tion to a station in ano ther project. you will
ho ve to specify a connection name. The connectio n name is used to link partners across
project boundaries. Alier the connection Is rinked. you canno t edil the connection name.
Application Tips
To c reole connections for a station, you must hove connected the intended porln er sta tions
lo lhe subnet. using a communications processor !hat supports lhe connection types you
intend to creole. After defining the required connection table for the CPUs in your p roject,
you should print lhe connections report as a reference tool for writing the communications
functions in you program. Each S7 connection will genera te a connection ID, which for some
you will need as o block input parameter when programming the com m unication function.
~ n Partner - - - - - - - - - - - - - ~
EHo) In the c1Xrent project
i l:l l!!.D Prol_301l
I
'
1
; -§ PG/PC(1J
~-Wl SIM4TIC 30~ )
i -··-II CPU 316
I IB· !Iii SIMATIC30~ )
!· ·; - .. (U n$J!e cili111d)
,-, - .. , All broadcast statioos
- -- All flllllticast staliont
/!!D In Lilknown l)loje-i:t
f roiect: jProf_300
f tot.ion· jSIMATIC 300[2)
M~e: jCPU 316
Comecoon-· - - - - - - - - - - - - - - - ~
lYP6: I
Fl,tS connection 3
,-,, . E-mai comection
1'" Q,s~ PfO FOL conneolion
.FM S connect ,on
ISO tr1inl'l)01t connection
OK. I
1S0-oo-TCP connection
--- - - ·- Point~o- • connection
390
Working with Simalic NET Networks
r,I d
,
MFI
PROF'l3US{ I)
PROl=13US
--.- - -
SIMAnc 300( 1) SIMATIC 300(2) SIMATIC 300(3)
[EJ' PG/PC(1} c,v c.,
fiiii) c•
)4U 2\IJ l4J.cl m e,.u c,
310 3,C.1-cl
2 0
J
•4
• •
5 5
•
7
■
8
•
•
0001 0100 '0001 0 100 ISlM llC XO(:!) I Cl'U 3 16 r!AS eomococn l"ft0f8US(I) (l'R(\AlUS)
... - .
00020100
- -~· ·-
~0001 0 100
~
s;MllC300(3)/(PU~6 - n i i s ~
•
-• •fMftlUS(I) ~ )
OCOJ0100 PQ.l'C(1) FMS eomcdlon ~8US(I) (rR(IRlUS)
•
Figure 7-30. Network configuration tool. w ith connection table displayed for selec ted CPU.
ACTION
l Open the required projec t and double click on any subnet object to op en the
network conligurotion tool in order to create new communications connections.
2 With the network configuration in view, selec t the CPU module for which you wish lo
creole connections. When lhe CPU is selec ted. its connec tion table is displayed.
3 With !he desired CPU selec1ed. you may double click on on empty row. or simply
right click on on empty row and select Insert New Connection.
4 The New Connec tion dialog will d isplay a p roject tree listing the stations of the
p rojec t, other th an 1he sta tion you hove selected. that you may d efine as the
connection partner. You may click on o specific 57-300 or 57-400 partner. or in the
case of FDL. and FMS connections, you may also setec1 All Broadcas t Sia /ions. FDL
connections also suppor1 communication lo All Multicast Sta tions .
6 Then, from the Type drop list. choose lhe connection type you wish to creole (e.g.,
FOL. FMS, or S7 connection); and then press the OK button to enter the connection
and view the connection properties.
7 Although the connec lion properties will vary depending on th e connec1ion type.
you may gel assistance from the online help on modifying the defoull p arameters.
8 Confirm each connection entry w ith 1he OK button and STEP 7 will list the Local ID
and Partner ID for the connec tion. the connection type. and whether the local
station is Active or Passive in establishing !he connection.
9 From the menu bar. selec t Network ► Save. to save the network configuration. Use
Save ► Compile lo generate the System Doto that you will download to !he CPU.
391
STEP 7 in 7 Steps
Essential Elements
You may insert a new Ethernet subnet from the SIMA TIC Manager or the network
configuration tool. Once you insert lhe subnel. you may configure ils General properties (See
figure betowl. The General properties include basic documentation such as Name a nd
Subnet ID. STEP 7 derives the subne l name. but you change lhe name if necessary. STEP 7
also derives the subnet ID (p rojec t number - subne t number), which you may modify. This is
unnecessary since this ID w ill a lways be unique. You do not need lo set any opera ting
parameters for on Ethernet subnet.
Application Tips
If possible, you should crea te and configure nodes that you wont to connect in a network in
the some project. By p lacing the stations in the some project, STEP 7 is able lo check your
entries (e.g., addresses, connections, e tc.) for consistency. In a la rge p lant with several
statio ns, it may be necessary to creole o number of subnets. While you moy manage these
subnets in o single project, you may decide to handle the subnets in multiple projects. If
stations in d ifferent projects need to be connected, you moy assign the station to more than
one subne t (i.e .. in d ifferent projects).
I II
Genorol I
Name: 1Elhemet(2)_
Author le.T.Jones
Date created: 21.09.2004 15:28:46
Last modJied: 21.09.2004 15:28:46
Commeri:
.:::J
DK I Cancel
I
Figure 7-31. Industrial Ethern e t subnet Properties: General settings dialog.
392
Working with Simalic NET Networks
Iii
~- Ethr_400 (Network) -
c:r ru
In justn al Ethernet
•
C:\ Patrlck\ S7_Pro}ects\ Ethr_400
MPl(1)
MPI
Figure 7-32. Newly inserted Elhernet Subnet. graphically shown in the Net Pro.
ACTION
1 Start a nd open the SIMA TIC Manager to the project of the new Ethernet subnet.
select the project folder, and then from the menu. select Insert ► Subnet ► Industrial
Ethernet.
2 In the right pone of lhe project window, double c lick on any subnet object or press
the Configure Network !oolbar bu tton to open the Network Configuration tool.
3 In the nelwork configuration window, double c lick on the Ethemet subnet object or
right-click on the object and select Object Properties lo open the p roperties d ialog.
From the General tab, you may keep or modity the default Name of the subnet.
and the S7 Subnet ID (this STEP 7 derived ID number will a lways be uniq ue).
5 Also on the General tab. you may enter o department name in the Author field, or
perhaps your name if you ore defining the subnet p roperties; you may enter or
modify lhe Comment lines to describe lhe subnel's fu nction in the project.
393
STEP 7 in 7 Steps
Essential Elements
Ethernet networking options for the S7-300 include CPs tha t support ISO transport connections
only (CP 343-1 ISOJ; those that supp ort TCP transport connections only (CP 343- 1 TCP); CPs
lhot support both ISO and TCP (CP 343-1 ); and CPS that support inlernet capabilities (CP-343-
1 IT). o r these CP groups, newer CPs will atso support routing features. w hich allows
communication between networks (e.g., Ethemet-to-PROFIBUS).
IPi!UMlit4W4tHUIH41MiMiiiGl#llll;i•JLJJJ
G&'.ew4y
(: r,c n J ,~,~
j::ss2ss oo
(" J~c:e,
EU,omet[l )
j
OK I C4!lcs
IPl+tJlitMP,Bl,Bit,ii§IEBi•ilGIIID·tiiit
"' ijelewa,- - - - - - - - - - ,
IP oddress:
I" Do~ U1>el°"'el
Slbnel mask: 1255.ao,o
r Use 1owc
Addle~ i ,o O1
Propedie1..
C4ncel. I
Figure 7-34. CP 343-1 Ethern et Interface activated for IP protocol use.
394
Working with Simalic NET Ne tworks
ACTION
1 Open lhe SIMATIC Manager and project w here the Ethernet CP will be inserted,
configured, and o lloched. If necessary, odd and configure on Ethernel subnel os
described in the p revious task, "Adding and Configuring on Ethernet Subnet."
2 With lhe project folder expanded, select the station where you will install the CP.
then from the right pone doub le click on the sta tion hardware object to open the
hardware configuration tool.
3 Open the SIMATIC 300 catalog object lo view the S7-300 component folders.
4 Open the CP-300 folder, and then under the tndustrlal Ethernet subfolder open the
ap propriate CP sub folder {e.g.. CP-343-l , CP-343-1 ISO, C P-34 l · l TCP, C P-443-1 IT, or
C P-341-PN). Select the desired CP and drag ii lo slot-4 or higher in the S7-300 roc k.
5 If th e interface properties dialog of the new CP does not open oufomo ticolly, when
inserted. then selec l the CP. right-click and select Object Properties: lhen press the
Properties b utton to open the interface dialog.
From the General tab, you may modify the default name of the CP. You moy also
enter o new Author of the C P configuration, and enter o Comment on the CPU use.
7 From the Parameters fob, set the Ethernet MAC Address for this CP. or perform Step
8 lo hove the next available address outomoticolly assigned. If no other sta tions ore
already connected, the default MAC address of 08.00.06.01.00.00 is displayed.
8 From the Subnet list box, selec t the correc l subnet to w hich this communications
processor should be a ttached. Press the OK bu tton to confirm your selections.
9 If th e CP supports the IP Protocol and TCP/IP will be used in this application, then
activa te the c heckbox labeled IP Protocol ls being Used; in the IP Address and
Subnet Mask fields, enter the IP and subnet mo sk address provided for the CP. then
occepl your enlries wilh the OK bullon.
10 From the menu, select Statlon ► Consistency to perform o check for errors.
11 From the menu bar. select Station ► Save, to save the configuration. Use Save ►
Compile to generate the System Doto that will be downloaded to the CPU.
395
STEP 7 in 7 Steps
1,IP'( 1i
MPI
!iml 3!8
Sltv1ATIC 300( 1)
CPU CP
34:J.l !lill]
SIMATlC 300(2)
CPU CP
116 )"3. 1 11ml na
_,
SIMAllC 300(3)
CPU CP
•• 2
• •
4
••
6
-1 ~
Figure 7-36. Ne!Pro Graphic configuration of Peer S7-300 Stations on Industrial Ethern et.
396
Working with Simolic NET Ne tworks
ACTION
I
1 Start· the SIMATIC Manager and Crea te o new Project using the New command.
2 When lhe New Project dialog oppeors. type in o p rojecl name in the Name field.
Verify that the Storage Location Pa th is w here you wish the project to be stored.
3 With the project folder open in the SIMATIC Manager, from the menu select Insert ►
Station ► SIMATIC 300 Station. Insert at least two or more S7-300 stations.
4 With the project folder selected. from the menu select Insert ► Subnet ► Industrial
Ethernet. The subne l object will be inserted in the right pone of fhe p rojecl window.
S Double c lick on the subnet, or press the Configure Ne twork toolbor button to open
the Network Configura tion tool. The network configuratio n window will open with
objects that represent lhe Ethernet subnet. and the S7-300 slolfons you crea ted.
6 Double c lick on the first station o bject (e.g., on the Station name) to open the
slotion in lhe Hard ware Configuration tool. Configure a central rock b y inserting the
required Rack. Power Supply. CPU. and the Ethernet Communications Processor.
7 When lhe CP i.s inserted. lhe properties d ia log will open outomotically; configure lhe
properties (including o unique address) and attach the C P to the subnel as
described in the p revious task "Instolling, Configuring, a nd Altaching a C P."
8 Save the central rock configuration and press the Configure Nelworf< toolbor icon lo
relurn to lhe network configura tion. The sta tion will appear connected lo the
Industrial Ethernet subnet when you relurn to the network conflg uroHon.
10 From lhe menu, selec t Network ► Check Consistency to p erfo rm a check for errors.
11 From the menu bar. select Network ► Save. to save !he network configuration. Use
Save and Compile to generate the Syslem Da ta tha l you will download to lhe CPU.
397
STEP 7 in 7 Steps
Essential Elements
Ethernet networking options for the S7-400 Ethernet includes CPs that support ISO lronsport
connections /CP 443- 1 ISO); that support TCP transport connections (CP 443- 1 TCP); CPs that
support both ISO and TCP connections (CP 443- t ): and CPs that that support internet
capabilities (CP-443-1 IT). Of these CP groups. newer CPs will also support rou ting features,
which allows communication between networks /e.g .• Ethemet-to-PROFIBUS).
IPNII91i1Niltiil,i41Mli6tii,iiiiktUaMil
If aatlr'te! i,,celacled.
raaoo 06 0 100 00 the nol<t .W$l!ll>le ~ - ",uggeated.
r IP Pllllocd ls berg wed
Gae,;~
IPaddte~ 114 10 1
t:" Uo t,ul uic •OU1t'
Subnbi-1<. 1.£ :l5(l0
r u ~,,,,,.,,,
Ad(te,t, I141 IIJ (i I
New•.
OK I Coned I Help
iAl JHYti!¥iHINl,t§ifiii§idBl•iCiiiitllttit
1
- Ga!e,w,y•- - - - - - - - ~
1140.en o1 r- Do not u,e rout,c
)255255.0.0
r u•• ,oui.,
Adctcn: (1 ◄r 00 0 I
Subnet
- not netwaked •· tlow ..
OK J Canul I Help I
Figure 7-38. CP 443-1Ethernet Interface ac tivated for IP protocol use.
398
Working with Simalic NET Ne tworks
ACTION
I
1 Open lhe SIMATIC Manager and project w here the Ethernet CP will be inserted,
configured, and o lloched. If necessary, odd and configure on Ethernel subnel os
described in the p revious task, "Adding and Configuring on Ethernet Subnet."
2 With lhe project folder expanded, select the station where you will install the CP.
then from the right pone doub le click on the sta tion hardware object lo open the
hardware config uration tool.
3 Open the SIMATIC 400 catalog object lo view the S7-300 component fo lders.
4 Open the CP-400 folder, and then under the tndustrlal Ethernet subfolder open the
a p propriate CP sub folder (e.g.. CP-443-1 , CP-443-1 ISO, C P-443-1 TCP, C P-443-1 IT, or
C P-443· 1PN). Select the desired C P and d rag it to slot-4 or higher in the S7-400 rock.
5 If th e interface properties dialog of the new CP does not open outomo ticolly, when
inserted. then selec t the CP. right-click and select Object Properties: lhen press the
Properties b utton lo open the Interface d ia log.
From the General lob, you may modify the defa ult name of the CP. You may also
enter o new Author of the C P configuration, and enter o Comment on the CPU use.
7 From the Parameters lob, set the Ethernet MAC Address for this CP. or perform Step
8 to hove the next available address outomotically assigned. If no other sta tions ore
a lready connected, the default MAC address of 08.00.06.01.00.00 is displayed.
8 From the Subnet lisl box, selec t the correc l subnet to w hich this communications
processor should be a ttached. Press the OK bu tto n to confirm your selections.
9 If th e CP supports the IP Protocol and TCP/IP will be used in this application, then
activa te the c heckbox labeled IP Protocol ls being Used; in the IP Address and
Subnet Mask fields, enter the IP and subnet ma sk address provided for the CP. then
accepl your enlries wilh the OK button.
10 From the menu, select Statlon ► Consistency to perform o check for errors.
11 From the menu bar. select Station ► Save, to save the configuratio n. Use Save and
Compile lo generate the System Doto that you will download to the CPU.
399
STEP 7 in 7 Steps
Essential Elements
Selecting and installing the appropriale Ethernet communications processor (CPI is all that is
required to establish on S7-400 station as a network station. In this task. all of the slotions will
use the same communications processor; however. the exac t module option will depend on
whether o copper or fiber (FO) media is used. and what communicolions pro tocols must be
supported in your application.
Application Tips
In coses where the central rack for the S7-400 stations will be identical or very simflar, you
should complete one station to include the rack. power supply. interface modules (IMs). and
signal modules (SMs) that will be identical in all stations. and then use the Cut and Pas te lo
duplicate the station. You migh t choose to duplicate lhe original stafion prior lo inserting the
communications processor. When you manually insert the CP in each station, STEP 7 will
assign a unique address to each. Otherwise. you will hove to modify each station address .
• w -
SIMATIC 400(1)
SIMATIC 400(2)
SIMATIC 400(3)
MPl(1)
Ether nel(1)
Ethernet( 1)
Industrial Ethernet
''Pl( I)
Pl
_ t _ _I
SIMATlC 400(1) SIMA TIC 400(2) SIMATIC 400(3)
CPU CP
4 1~ 1 443- t
■ •
CPU CP
41~1 ~ I
■ •
II CPU
<10·1 ~-I
■
CP
•
3 5 1
Figure 7-40. NelPro Graphic configuration of Peer Sl-400 Stations on Industrial Ethernet.
400
Working with Simolic NET Ne tworks
ACTION
1 Start· the SIMATIC Manager and Crea te o new Project using the New command.
2 When lhe New Project dialog oppeors. type in o p rojecl name in the Name field.
Verify that the Storage Location Pa th is w here you wish the project to be stored.
3 With the project folder open in the SIMATIC Manager, from the menu select Insert ►
Station ► SIMATIC 400 Station. Insert at least two or more S7-400 stations.
4 With the project folder selected. from the menu select Insert ► Subnet ► Industrial
Ethernet. The subne l object will be inserted in the right pone of fhe p rojecl window.
S Double c lick on the subnet, or press the Configure Ne twork toolbor button to open
the Network Configura tion tool. The network configuratio n window will open with
objects that represent lhe Ethernet subnet. and the S7-300 slolfons you crea ted.
6 Double c lick on the first station o bject (e.g., on the Station name) to open the
slotion in lhe Hard ware Configuration tool. Configure a central rock b y inserting the
required Rack. Power Supply. CPU. and the Ethernet Communications Processor.
7 When lhe CP is inserted. lhe properties d ia log will open outomotically; configure lhe
properties (including o unique address) and attach the C P to the subnel as
described in the p revious task "Instolling, Configuring, a nd Altaching a C P."
8 Save the central rack configuration and press the Configure Nelworf< toolbar icon
to return lo the network conligura1ion. The slo tion will appear connected lo lhe
Industrial Ethernet subnet when you relurn to the network config uroHon.
10 From lhe menu, selec t Network ► Check Consistency to p erfo rm a check for errors.
11 From the menu bar. select Network ► Save. lo save the network configuration. Use
Save and Compile to generate the Syslem Da ta tha l you will download to lhe CPU.
401
STEP 7 in 7 Steps
Essential Elements
To establish o PG/PC as a programming station on Industrial Ethernet. on Elhernet-
cornpolible network interface card must be installed in the PC. the appropriate SOFTNET. or
HARDNET d river must be installed o n th e PC, a nd the network interface cord must be
configured in Windows. With the physical connectio n in p lace. you need only to complete
the logical connec tio n of the PG/PC programming statio n.
Application Tips
As o rule. you should insloll lhe required Eth ernet d river first. and Ihen physically insloll lhe
required Elhernel network interface cord in to your PC. In this way, lhe appropriate SOFTNET
or HARDNET driver is in place w he n you attempt to insta ll the network interface card in
Windows. Recall. lhol the software drivers. for th e programming services (PG/OP) over
Ethernet. ore installed as p ort of each Etherne t driver package.
----------------------~---_-_-_-_-_-_-_------
Press F1 to get Help. I
Fig ure 7-4 1. 57 Projec t with Peer S7-400 Statio ns, PG/PC stalian, M PI. and Ethernet subnets.
402
Working with Simalic NET Networks
PG/PC(1)
Ethernet( I) •
lndustn::;I Etherne:
f"1Pl( I)
t\llPI
■• • II II
CPU CP CPU CP CPU CP
410-1 443-1 410.1 440- 1 41~-I 443-1
3
■
5
• •• 7
.=.I
• 2..1
Figure 7-42. NelPro Graphic configura tion of PG/PC and Peer S7-400 Stations on Ethernet.
ACTION
I Open the SIMATIC Manager, lo the proj ec t where you wish to establish the PG/ PC as
a stolion on on Ethernet Subnet.
2 If th e PG/PC object is not already installed. selec l the project folder, right click. and
select Insert New Object ► PG/ PC. Skip this step if the PG/PC is already installed.
3 With the project folder selected. from the right pane, double click on the Ethernet
subnet object lo open the NetPro graphical network configura tion tool.
4 With the network configuration open. select the PG/PC object. right-click and selec t
Object Properties: or double click on the PG/PC object lo open the properties
dialog.
5 From the General tab. you may modify the default name PG/PC / t ). too name you
choose. You may also modify or enter a new Author of the interface parameters, and
modify or enter a Comment describing the use of the programming sys1em.
6 Select the Interface tab. to display existing interfaces or create a new Ethernet
interface lo which you wish to assign to the PG/PC.
7 Select the Assignmen t lob. lo display the configured Elhernel interroces and
interface parameter sets [i.e.. physically installed interfaces) previously defined in the
PG/PC.
8 From the Not Assigned block, selec t the logical Ethernet interface you wish to assign
to the physical interface In the PG/PC; then from the Interface Parameter Assignment
window, selecl !he physical Elhern el interface round in lhe PG/PC;
9 Press the Assign button. The "Assign" button will b e grayed out unless the configured
interface you choose Is networked and the selected interface parameter assignment
/i.e .. Ethernet cord) matches the configured interface.
403
STEP 7 in 7 Steps
ll,ti§il-44~13·1,i,i§iit·1, _ _ _______
•
,- Connection Pa,tner
0 In the cuuent proiecl
Il
El ·~ Eth1_ 400
sj PG/PC(1 ]
Hi (D SIMATIC 41:W)
$-Iii) SIMATIC 4~3)
; - iJ CPU 416-1
i - - [Unspecified)
- All b1oadc~ stations
- All multice1t ilali¢ns
~ In unknown project
Project: jEtl'ir.:_400
Station: ls1MAT1c 400131
Module: jcPU 416-1
Connec.tfon
T_ype: IISO tr<llnspo,t conneclion .:1
w Displa}' Pf ISO-on-TCP connection
- -•Point·to-point comection
, - - - - - - - 157 connection
DK J S7 connection faul-tolerant .,. elp
.__ _ _.._ TCP connection
404
Working with Simalic NET Networks
FIi I I
lrtJu,tn,:' ElhE>rm, I
'I'
• J
I I
SIMATIC 400(2)
.
l
SMA11C400(3)
PG/PC(4),
liiiiffl
u
■• •
ctu .,;p1 Ct'tJ t i'
4 U), l I 41~1 "'4).t
• 5 ]
•
i.o..t ID Por111er O Por1nm TYJ)C Aaflo oonr.odlon l""tr<r Sb><!
:i~6 t:l~--
0002
0001 A020
~
t~{~=::~~~:-
/
-~·•:~iZ.~tti<n1~*·
,IJl20 ~W.l ie ◄00(3) CPI).41 6-1 TCP comedlon , Yet
-~:}~~
e t ~) (II:)
..:J
Figure 7-44. Network configuration tool, w ith connection table displayed for selected CPU.
ACTION
1 Open the required projec t and double click on any subnet object to open the
network configuration tool in order to create new communications connections.
2 With the network configuration in view, select the C PU module for which you wish to
create connections. When the CPU is selected. its connec tion table is displayed.
3 With the desired CPU selec ted. you may double click on on empty row, or simply
right click on an empty row and select Insert New Connection.
4 The New Connec tion dialog will display o p rojec t tree listing the stations of the
projec t, other lhon the sta tion you hove selected. that you may define as lhe
connection partner. You may click on o specific S7 -300 or S7-400 partner, or in the
case of UDP connections. you may also selec t A ll Broadcas t Stations.
6 Then, from the Type drop list, choose the connec tion type you wish to create (e.g.,
ISO, ISO-on-TCP. TCP. UDP. E-Mail, or S7 Connec tion); and then press the OK button
to enter the connec tion and view the connection properties.
7 Although the connec tion properties will vary depending on the connec tion type,
you moy get assistance from the online help on modifying lhe d efault parameters.
8 Con firm each connection en try with the OK button ond STEP 7 will list the Local ID
and Partner ID for th e connec tion. the connection type. and whether the local
station is Active or Passive in establishing the connection.
9 From the menu bar. select Network ► Save, to save the network configuration. Use
Save ► Compile lo generate the Sys1em Data that you will download lo the CPU.
405
STEP 7 in 7 Steps
406
Appendices
Contents
ASCII Charts
Tobie A-1. Organization Blocks IOBsl list. Provided in STEP 7 Standard Librorv.
OB Default Priority Description
Cyclcal Processing
0B1 1 Main Program Block
OB 10 2 Time-ol-Doy Interrupt - 0
OB 11 2 Time-of-Doy Interrupt - 1
0B12 2 Time-of-Doy Interrupt • 2
...
OB 13 2 Time-of-Day Interrupt - 3
0814 2 Time-of-Doy Interrupt • 4
0B15 2 Time-of-Doy Interrupt• 5
.. 08 16 2 Time-of-Doy Interrupt • 6
. OB 17 2 Time-of-Doy Interrupt - 7
OB 21 4 Time-Deloy Interrupt - 1
0B22 5 Time-Delay Interrupt - 2
408
Appendices
OB 47 23 Hardware Interrupt 7
Start-up Processing
•
08 100 27 Worm Resta rt
OB IOI 27 Hot Restart [S7 400 only)
409
Appendices
Calling an SFB o r SFC in your p rogram is the some os it would be for user-c reated FB or FC.
Simply insert a new network or open on existing network and coll !he system b lock as
required. If the block requires that actual parameters be supplied. you will need p roper
documentation th a t defines each parameter and the correct operand requirements .
Remember. tho I SFBs ore slill FBs. and require on inslonce dole block as ils memory. You musl
c reole a nd download the required DB as port of the program.
410
Appendices
Drum Sequencer
•
SFB 32 DRUM Drum
Generaflng Block-Related Messages
•
SFB 33 ALARM Messages with Acknowledgement Display
H-System Operations
SFC 90 H_CTRL Control Operation in H Systems
4 11
Appendices
412
Appendices
4 13
Appendices
.
s·
Tobie A-7. ASCII Characters 0-63. wiH1 Decimal ' 1norv. 0 c t a I, ondHex E:O UIVO
. Ien ts.
CHAR DEC BINARY OCT HEX CHAR DEC BINARY I OCT HEX
NUL 0 00000000 000 00 space 32 00100000 040 20
SOH I 00000001 001 01 I 33 00100001 041 21
STX 2 000000 10 002 02 .. 34 00 100010 042 22
me 3 00000011 003 03 I 35 0010001 l 043 23
EOT 4 00000100 004 04 s 36 00 100100 044 24
ENQ s 00000101 005 OS % 37 00100101 045 25
•
ACK 6 000001 10 006 06 & 38 00100110 046 26
BEL 7 00000111 007 07 ' 39 0010011 1 047 27
BS 8 00001000 010 08 ( 40 001 01000 050 . 28 .
HT 9 00001001 011 09 ) 41
-00101001 '-
051
- 29
LF 10 000010 10 012 OA • 42 00 101010 052 2A
VT 11 0000101I 013 06 + 43 0010101 1 053 26
FF 12 00001100
.... 014 oc 44 00101100 054 2C
CR 13 00001101 015 OD
•
. 45
--
00101101 055 20
so 14 00001110 016 OE • 46 00 101110 056 2E
SI 15 ()0001111 017 Of I 47 0010111 1 057 2F
OLE 16 00010000 020 10 0 48 00 11 0000 060 30
DC1 17 00010001 021 11 1 49 00110001 061 31
DC2 18 000100 10 022 12 2 50 00 110010 062 32
OC3 19 000100 11 023 13 3 51 0011001 1 063 33
DC4 20 00010100 024 14 4 52 00 11 0100 064 34
NAK 21 00010101 025 IS 5 53 0011 0101 065 35
SYNC 22 000101 10 026 16 6 54 00 110110 066 36
ETB 23 000101 11 027 17 7 55 0011011 1 067 37
CAN 24 00011000 030 18 8 56 00111000 070 38
EM 25 0001 1001 031 19 9 57 00111001 071 39
SUB 26 000110 10 032 IA •• 58 00 11 1010 072 3A
ESC 27 0001 1011 033 16 .• 59 0011101 1 073 38
FS 28 00011100 034 IC < 60 00 111100 074 3C
GS 29 0001 1101 035 10 .. 61 00111101 075 30
RS 30 00011110 036 IE > 62 0011 1110 076 3E
us 31 00011111 037 IF ? 63 0011111 1 077 3F
414
Appendices
4 15
Appendices
IW3 21100001 111000011 11 WORD variable as binary cons1ant with b inary Identifier
-
MW42 w# l 6#ABYN WORD variable os hex constant with hex identifier
4 16
Appendices
ID4 000110001 1100 10101 11010111010 111 DWORD 11orioble os binary con11on1 without
blnory ldenJilier
-Addreu
T 10
Force/Modly Value
0
Desc:t1pffon
Conversion lo mUnseconds jmsl
T11 20 Conversion lo ms
T13 SSTIME/1 1Om30s Timer votue with SSTIME (or SST) identifier
4 17
Appendices
418
Appendices
- + 27,649
+ 27,648
+500.02
+ 500.00 mV
+ 1.0004
1.0000 V
+ 2.5001
+2.5000 I/
+ 5.0002
5.000 V
10.0004
+ 10.00 V
20.0007
+20.00 mA
S-51111.91
- 1.1750
s-1.116
-2.9398
S •2.935
-5.8796
S -5.IIIIO
-1 1.7590
S-11.76
-23.5160
S•:13.517
-
UNDERFLOW
419
Appendices
Al Analog Input
AO Analog Outpu t
CFC Continuous Function Chart
~-
-- CP
CPU
DB
-➔·
Communications Processor Module
Central Processing Unit Module
Doto Block
DI Digitol lnpul
DO Digital Output
DP Distributed Periphery (or Distributed 1/0)
EN Enable Input Line
ENO Enable Output line
EPROM Erasable Pragrarnmable Read Only Memor,
FB Function Block
FBD Function Block Diagram language
1---
FC Functio n
FEPROM Flash Erasable Programmable Read Only Memory
FM Function Module
IM Interface Module
LAD Ladder Diogrom Language
MPI Multi-Po int Interface
OB Organization Block
OP Opera tor Panel
1---
PG/ PC Programming Device/PC Programming Device
PII Process Image or Inputs
PIQ Process Image of Ou1puts
RAM Random Access Memory
RLO Result of Logic Opera tion
SCL Structured Control Language
SOB System Da lo Block
SFB
1---
SFC
---- System Function Block
System Function
.SM Signal Module
STL Statement List Language
UDT User Defined Type
VAT Variable Tobie
420
address: 1) A reference number tho I
identi fies a unique memory b it, byte,
word, or double word location. 2) An
identi fying number designating a unique
system entity or object.
block stack (8 -stack): See B-s fac l< charts container: A fold er or container
used to store CFC "Cha rts" beneath the S7
block parameters: Re fers to the named
program. See CFC charts.
input/output c hannels tha t allow data to
be passed into (input parameters) or clock memory: A system me mory area
ou lp ut from (oulput parameters ) a block comprised o f individual bits that generate
function. clock p ulses that a rc usable in the control
program by simply refere ncing the bit
address. E1ght clock memory bits a re
available, each representing a unique
-C- frequency from 0.5 hertz to l O hertz.
422
Glossary
code block: S7 program resource that conslstency check: A utility that checks
allows program construction in modular lo see if the hardware configuration
sections of code. These sections ore (Hordwore Configura tion) or if the
referred to as blocks. Logic block: types network configuration (Ne/Pro) is free of
include Organiza tion blocks (OBs), errors.
Function b locks (FBsJ. ond Functions fFCs).
controt loglc: I) The combination of
System Functions (SFCs) ond System
conditions that must be satisfied to
Function Blocks fSFBs). ore code blocks
control a particular device or perform a
tha t ore port of the CPU operating
particular function. 2) Refers to the en tire
system.
program logic or relay logic that will
cold restart: An S7 start-up mode in which control a given machine or process.
the orgonlzolion block: OB I02 is
controller rack (CR): A main S7 300 or 57
processed if loaded; the process image
400 system component used lo install !he
(Pit. PIQ), oil timers. counters. and bit
C PU. The controller rock may also
memory are all reset. Furthermore. Doto
contain signal modules, function
Blocks generated by system functions ore
modules, and communications
deleted from work memory.
processors.
communication bus (C-bus): See C-bus.
counter memory (C): The area or lhe
communications processor (CP): A class system memory containing locations
of 57 communications modules that used for software counters. Each counter
include both those that provide network word, when set, contains the user-defined
interfacing and point-to-point serial links preset value as a BCD value. The Jetter
between S7 PLCs or to o th er devices. 'C' precedes each 57 counter address
(e.g .. CO, CI , C2, and C3 each is a
communications, bllateral: See bi/oteroJ
unique coun ter.
communicolion.
counter. down: An S7 software counter
communication, unnateral: See unilolerol
instruction tha t decrements its count
communication.
value by one for each off.to-on transition
compressing memory: See memory of its count-down input.
compression.
counter, up: S7 software counter
configuration tables: The oulput or the instruction tha t increments its count value
STEP 7 hardware configuration tool. which by one for ea ch off-to-on transition o f its
hos each 1/0 rail of on S7 300 or rock of count-up input.
an S7 400, and the modules installed in
counter, up-down: An 57 software
each slo t. represented in the form of a
counter instruction that combines the
table. The table includes rows for the
actions of both the up-counter and
module contained in each slot. and
down-counter.
information associated with each module
in columns. cyclic Interrupt: S7 300 and 57 400 system.s
provide cyclic interrupt OBs lo support
configured connection: A
periodic processing of certain portions of
communication link be tween S7 partners.
the user program. independent of the
in which the connection properties
normal cyclic processing time of the CPU.
between 1Wo partners ore preconfigured
Cyclic interrupt ore available at inteNols
and fixed in o connection table.
of 10 milliseconds to 5 seconds.
Connection types include: FOL. FMS, ISO,
ISO-on-TCP. point-to-point. 57, and UDP. cycfic Interrupt OBs: OB 30 to OB 38 ore
provided for servicing cyclic interrupts.
connection table: A STEP 7 object that
Cyclic interrupt OSs ovoiloble to a
contains the preconfigured connections
program. is CPU dependent.
between the communications partners of
a projec t.
423
diagnostic buffer: A memory area of the
-D- CPU in which all diagnostic events are
stored the order o f occurrence. STEP 7 is
Doto Block (DB): A STEP 7 b lock that used to view the contents of the buffer.
allows users to store data associated wilh diagnostic entry: A single event entered
the program and the process. There ore into the S7 CPUs diagnostic b uffer.
lwa lypes of data b locks: the shored
doto block whose data is accessib le by diagnostic Interrupt: An interrupt used by
oil logic code b locks. and the instance o module .,.,;th diagnostic copobilily. to
data block, whose data is associated report occurrence of o module fault lo
with a specific function b lock {FB). the CPU.
Dalo Block, Instance: See data bloc!<. diagnostic message: A message lhot
consists of a processed diagnostic event,
Doto Block, shored: See data block.
which is then sent from the CPU to the
data type: Stipulates the characteristics of display unit.
program data. with respect lo ils direct addressing: A method of
representation and the permissible range addressing in which the memory location
of values. Some example data types lo be accessed or operated upon, is the
include BOOL INTeger. REAL SS_TIME, address referenced by the ins1ruction. The
ARRAY. and STRING. In STEP 7. lhere ore address can be absolute {e.g .. 14.71 or
two categories of doto - elemen tary. or symbolic (e.g .. E·STOP).
complex.
direct 1/ 0 read: An instruc !ion operation
data type. complex: Category of data
that uses th e peripheral input (Pl) address
types lho1 reserve memory for variables area to access on input module's data
that ore comprised of two or more doto directly from the module or 1/0 bus, as
element of elementary data lype. opposed to normal reading from the
Complex data types include DATE-AND- process image of inputs (PU).
TIME. STRING, ARRAY. STRUCT. and UDT.
direct 1/ 0 write: An instruction operation
data type, elementary: Category of data that uses th e peripheral output (PQ)
types that reserve o single bit. by!e. word. address area lo access on output
or double word of memory. Elementary module' s data directly via the module or
data types Include 800L, BYTE. WORD. 1/0 bus. as opposed lo normal writing to
DWORD, INT. DINT. REAL. DATE, TIME, the process image of outpu ts (PIQ).
SSTIME, TIME-OF-DAY. and CHAR.
distributed 1/ 0 : Slave d evices that ore
data ty pe, user defined: A user-defined
connected via a PROFIBUS-DP master.
structure of any combination of Also referred to as distrib uted perip hery.
elen1entary or complex data types. to be
used as o template for creating data DP- ma ster: An Intelligent device that
blocks of the some data structure or for behaves in accordance to the Profibus
decla ri ng o frequently used struclure as a DP standard EN 50170. A DP-master is
data type. able to send data lo and request data
from its slave devices.
declaration section: The area of a STEP 7
code b lock or data b lack. in whic h DP-slave: A device tha t behoves in
variables may be defined. accordance to the Profibus DP standard
EN 50170. A DP-master is able to send
diagnostic address: An address that is data lo and requesl data from its slave
assigned lo a module's configuration in devices.
order to receive diagnostic informa tion
data. The diagnostic data con be dynamic connection: A connection that
checked from the user program using or ls set up a t runtime when the octJVe
from the STEP 7 monitor/modify data partner initiates th e connec tion by calling
utility. lhe appropriate communications system
function (SFCJ.
424
Glossary
-G -
- F-
GD circle: The CPUs that participate in on
exchange of global data pockets form a
FBD: Abbreviation for Function Block
Diagram. one of the three language circle. If there ore other CPUs exchanging
representations of the basic STEP 7 global data pockets in a mul1ipoin!
programming package. Control logic interface network. these CPUs lorm a
can be created using box instructions second circle. A c ircle may be two-sided
involving two CPUs. each of which con
represented in Boolean goto logic
format. The opera tions AND, OR, and bolh send ond receive o GD pocket: it
NOT ore combined with other box may be one-sided in which a single CPU
sends a GD pocket to several o ther CPUs.
operations to construct simple and
See GD pocke ts.
complex control logic. Also. see LAD: srr..
425
GD communication: See gfobol doto hardware configuration: Definition of rock
communication. arrangement. modules, module slo ts.
addressing. a nd initial operating
GD packets: In global data
parame ters of the hardware componenrs
c ommunication. th e small blocks of dolo
of o project. See hord ware configuration
transferred in global dolo
utilily.
communication: dolo !hot have the
some receiver and sender ore combined hardware configuration utility: A STEP 7
in a global data packet. The global data software configuration ulitity used to
pocke t is sent in a frame. A global d ata define rack arrangement. modules.
pocket is identified by a global data module slots. addressing, and initial
pocke t number. If the maximum leng th of operating parame ters o f the hardware
o send global data pocket is exceeded. components of a project. This tool atso
o new global data circle is used. provides online hardware diagnostic
capability of the ac tual componen ts.
global data: Information, such a s input
ou tp ut. bit memory. and data block hardware interrupt: A signal ability of
memory areas. which may be some S7 modules lo trigger and alert to
exchanged be tween C PUs porlicipoting the CPU when some process or module
in global dolo cammunicotion. event occurs.
426
Glossary
instance: An '1nstance" is the coll of a LAO: Abbreviation for Ladder, one of the
funcllon block. If o Function is coiled four three language representa tions of the
limes in o STEP 7 program, then there ore basic STEP 7 programming package.
four instances. An ins1once data block is Control logic con be created using reloy-
assigned to each call. See do/a block. tike instructions may be combined with
box Instructions to perform simple to
instance Data Block: See dofo block.
complex con trol operations. Also, see
intelligent DP-slave: A DP-slave involving FBD: STL.
on intelligent device such os on S7-300
ladder logic (LAO): See LAD
connected as o slave via its integrated
DP port, or via a communications ladder network: See ladder rung.
processor (CP). installed in on $7-300.
which con serve os o DP-slave.
427
ladder rung: A single Ladder d iagram local stock: Temporary memory loca tions
network, p ort of o complete program or made available by the CPU to each
block, that performs the desired control code b lock a s it is coiled. The so-coiled
logic in po11 01 in whole ror o single L-stock, is released when o b lock
device or function. terminates, and is ovoiloble for use by the
next called bloc k. The block header
library: A STEP 7 object used for storing
reserves the L-stack length however the
reusable p rograms or program
maximum length is CPU dependent.
components {i.e., block lo lde1, source
folder. C FC c horl [o lder. symbol table). local symbol: A name assigned too
Users may create libraries from the b lock variable and known only to the
Simotic Manager. a nd certain slondard b lock in which it is defined. as opposed to
libraries ore supplied with STEP 7 basic global symbols assigned in the Symbol
and optiona l packages editor, and that ore known to the entire
user program (i.e.. o ll blocks). See
library, standard: A STEP 7 library that is
symbolic address.
provided with !he basic package.
428
Glossary
module parame ter: A value that con be NETPRO: A STEP 7 u lility used to configure
set on on S7 module, which will a ffect the networks or paint-to-point links for S7
module's behavior. Some modules hove projects. using graphic objects. The tool
several parame ters. some or which con allows for adding o f new subnels or point-
be set via the control program. to-point links, attachment of new stations
(SS. S7. PG/PC, Ops. e tc.). network and
module catalog: See hardware catalog.
module p roperties to be set. and for
MPI address: In on MPI network. every configuration of communications
programmable module (e.g.. CPUs. CPs. connections.
and FMs) must hove its own unique MPI
network: 1) A number of nodes linked
address assigned.
together by connecting cables ror the
MPI network: A Multi-Point lnlerfoce purpose o f communication. 2) Divides
nelwork or up lo 3 1 nodes, vsed 10 Ladder Logic (LAD) and Function Block
provide a programm ing network for S7 Diogrom (FBD) blocks into logic rungs or
300 and S7 400 CPUs, function modules Statement List code into smaller
(FMsJ. communications processors (CPS), segments.
!ext d isplays and opera tor panels. The
network configuration: Creation or
network also focilita tes global dato
modification of point-lo-point links or
communications among CPUs.
networks. for S7 projects. Slotions may be
multi-computtng: An S7 400 feo lure thal added to the nelwork configuration alter
supports up to four CPUs Installed in one or before they ore created in the STEP 7
rock. The total control task con be project. See NETPRO.
divided among the C PUs, each or which
has its own program, govern its own 1/0
and con communicate with th e o th er
CPUs.
-0 -
mulll-computtng intenupt: An S7 400
fealure that allows any of four possible OB 1: Organization Block 1: the main
CPUs operating in o multiple processor cod e block ol o STEP 7 program. Once
configuration, to generate an interrupt to downloaded to the CPU. O B1 p rocesses
a ll of the other porticlpanls such that o cyclically. All other blocks ore called
synchronized response is possible. See directly or indlrec I ly from OB 1 or from
mu/Ii-computing interrupt OB: m ulli- another organization b lock.
computing. object: Refers lo on item in o STEP 7
multl-compuffng Interrupt OB: OB 60 is folder. which con b e opened and edited.
provided in S7 400, for servicing user- automalicolly s1orting the appropria te
configured multiprocessing. see application in the software. for example.
multiprocessing interrupt; multiprocessing. b lock.. source me. or station.
429
on-delay timer (S_ODT}: A timer that storls parameter: I ) A variable input to or
liming when the enable signal goes TRUE output from on S7 code block. 2) A
ond continues to time unless the enable variable tho! con be set on on S7 module
goes false or the limer is reset. The output lo determine one or mo,e aspec ts of the
is oclivoled o tter the preset lime hos module's b ehavior. Also see dynamic
elapsed. ond stays energized until the poromeler: stofic parameter.
enable signal goes FALSE or the lirner is
partitioned program: A STEP 7 user
rese t.
program that in essence is o linear
on-llne blocks: Sloclc:s contained in the program. however the program is
CPU; th e blocks listed in !he ontine b locks subdivided info blocks of code. The
folder. Also. see off/ine blocks. blocks are then called in sequence. See
linear program: structured program.
operating mode: The various continuous
or tronsilionot states of opera tion of on S7 Peripheral bus (P-bus}: See P-bus.
CPU. Operating modes may be selec ted
Peripheral inputs (Pl}: An address area
from the PG/PC or lrom !he mode
that allows direc t rea d a ccess lo the
selec tor switch on the CPU front plate
dolo of on input module via the 1/0 b us.
(e.g .. RUN, RUN-P. STOP, HOLD, ond
In o th er words, addressing a module
STARTUP).
using Its Pl address allows a direct or
Organization Block (OB}: A special immediate input read. See direc t t/0
category o f STEP 7 code b lock tho! read.
provides the user program with on
peripheral outputs (PQ): An address oreo
interface to the CPU's operating system.
lhot allows direct w ri te access lo lhe
Organization blocks allow p rocessing of
data oreo of on output module 11io the
the main user program as well as
1/0 bus. In other words. addressing o
organized p rogram response lo various
module using its PQ address allows a
categories of system related conditions.
direct or immediate output write. See
Whal 08s ore ovoiloble is CPU
direct 1/0 write.
dependent.
PG: A Simotic designation for
output image table: See output memory.
programming device. The SIMATIC PG is a
Output (Q) memory: System memory personal computer with a rugged
oreo for storing the status of connected compact design. suitable for industrial
digital outputs. Each connected output conditions. The Simatic PG is completely
hos o b it in the output memory tho! equipped for programming the SIMA TIC
corresponds exac tly to the terminal to programmable logic controllers.
which the outpu t is connected. Toe letter
PG/ PC: An abbreviation thot refers to
'Q' p recedes eoch output memory
Simolic programming system (PG) or o PC
address. w hen used in the program (e.g ..
(personal computer) programming
QIO.O is obit. QB 10 is a byte. Q'N 10 is o
system.
word, ond OD 10 o double word. Also.
see process image outputs. point-to-point link: Refers to the type of
communication link used lo connec t
devices with a serial interface. such as
b or codo roo dors, printers, or onothor
-p- controller, to on S7 300 or S7 400. The S7
300 uses the CP 340 ror this type of link. S7
P-bus: Abbreviation for Peripheral Bus: the 400 uses the CP 441- 1 or -2.
S7 1/0 doto bus. Also. see C-bus.
430
Glossary
priority: A melhod of assigning the order pulse timer (S_PULSE): A timer lhat starts to
in which p ortions of code ore execu te d lime when the trigger input (RLOJ goes
based on level of importance. A from low to high, and continues to time
program o f higher priority c on lnterrupl ror the programmed duroHon. or until lhe
one of lower p riority. Since oil b locks ore trigger signal goes from high lo low. Th e
called either directty or indirectly from on timer is reset when the reset inpu t goes
OB, priority is assigned to S7 OBs. high while the timer is liming.
priority class: A p rogram hierarchy level pulse timer exiended (S_PEXT): An S7
into which o STEP 7 orgo nizolion b lock limer tho t starts to lime when lhe trigger
c on b e placed. There ore 28 groupings inpuf transitions from low lo high, and
or p riority c la sses lo which OBs are continues to time until lhe programmed
assigned. Priority c lasses determine how duration exp[res: regardless o f any
OBs may interrup t o ther OBs. OBs change a t the trigger input before the
assigned the same priorlly class do no t timer times oul.
interrup t one another but ore processed
in sequence. See p riority.
43 1
retentive on-delay timer (ODTS): A timer SCL: An optional STEP 7 programming
tha t starts timing when the e nable signal package called "Structured Control
goes TRUE and continues to time even if Language." SCL is a text-based
the enable goes false. If the enable signot language. w hose definition conforms
c hanges bock lo ' I' before the timer generally to the IEC 1131 ·3 standard.
expires, the timer -wilt restart. The output is PASCAL-like. SCL simplifies programming
activated after the preset lime hos of loops and conditional branches.
elapsed. and remains activated until the making it quite sui1oble for formula
timer is reset. calculations. complex algorithms. and
extensive data monagement. Also. see
rewiring function: A STEP 7 u tility tha t
HiGroph: CFC; Graph.
allows the replacement of the addresses
used In one or more b locks or o f the segmented rack: A feature o f the $7 400
en tire program. w ith another set of a llowing two CPUs with o shared power
addresses. For example. the inputs I 10.0 supply to be lndependenl of one
to I 10.7 may be replaced by I 20.0 lo I another. The two CPUs may interchange
20.7. Addresses of inpuis. o utputs, timers. data via the C- bus yet each hos tts own
counters. b it memory, os well os Functions P-buss for 1/0 data.
(FC) and Function blocks (FBs) may be
signal module (SM): Any of the digital o r
re-wired.
analog 1/0 modules used to interface
rising edge: The rising edge ol a signal d igital and analog signals to S7 300 or S7
(i.e., the OFF-to-ON or 0-to- ltransition). 400 systems.
432
Glossary
start Information: Every organization block status bits: Binary indicator flogs used by
reserves 20-byfes o f local dola tha f the the CPU during b inary op erations {e.g ..
operating system supplies as start AND/OR logic ), ond set by the CPU
inlormotion when the OB is slorted. The during digita l operations (e.g .. compare.
start information specifies the start event arithmetic). Status bits are available as bit
o r the OB. the dote and time the 06 instructions !hot may be combined with
starts. errors tho! ho ve occurred. and o ther logic op erations.
diagnoslic events. For example, 0 B40. a
STL: Abbrev ia tion for Statement Lisi. one
hardware interrupt OB. contains the
of three language representa tions o f the
address of the module thal generated
basic STEP 7 programming software, is o
the interrupt in il5 start information.
line oriented language with assembler-
Start-up Mode: A CPU operational mode like Instruc tions. Also, see LAD: FBD.
just p rior to starting cyclical program
STOP M ode: A CPU operolionol mode in
execution. S7 slortups ore triggered by: 1)
which the user p rogram is not scanned
switching ON the main p ower supply. 2)
and the modules ore set to the default
switching the CPU mode selector from
ini1ial stales specified in the CPU. The
STOP to RUN or RUN-P. or 3) o
STOP mode is caused by: I) switching the
communication START request issued from
CPU mode selec tor lo STOP: 21 executing
the PG/PC or from another CPU.
SFC 46 STP function; 3) on unrecoverab le
Start-up 08s: Organization Blocks that ore error during p rogram execu1ion: or 4} o
called on one of the three types of S7 communication STP request from the
start-up modes: worm restart (OB 100); programming unit or another CPU.
hot restart (OB l 01 ): and cold restart (OB
struc ture: A composite grouping of
102). Start-up OBs ore called during just
variables with different data typ es. An
prior to starting the cyclical program
example where a structure may be
(OB l I.
required is o recipe. using data types
Statement list (STL}: See STL. (e.g .. REAL. INT. TIME. and DATE) . It could
also contain on array.
static conne<:lion: A connection in whic h
the properties tha t establish the logical structured program: Refers 1o o STEP 7
relationship between the partners is user program designed to toke
configured in a CPU connection table. odvontoge or STEP 7 resources that allow
and is b uilt-up at the start-up o f the CPU programming of modular b lock functions
and remains even w hen lhe CPU is lhot con be reuse d lhroughou l the
switched to STOP. p rogram to minimize code writing and
redundant code development.
static parameter: An S7 module
parameter that can only be set or subnet: A subnet comprises all nod es in a
modilied using the STEP 7 software, network. which ore connected togelher
contrasted to dynamic parameters th at without g a teways. A repea ler ma y be
may be set via the STEP 7 user program. inc luded within o subnet.
An example static Is the inpul delay on a
symbol: See symbolic a ddress. Also. see
digital inp ut mo dule.
global symbol. local symbol.
static variable: One ol lhe variable typ es
symbolic address: A substitu1o reference
tha t con be d efined in an S7 function
to on absolute address or memory
block (FB). Static variables are variables
location. represented by o name. The
thol must be moin1olned from one coll or
term "STOP_PB'' could be a symbolic
the FB to the next. These variables are
address for lhe absolute address I 6.7".
saved in the associated instance doto
See absolute address.
block w hen 1he FB is terminated.
433
symbolic addressing: Use of substitute or
name references like "STOP _PB" to
- T-
reference memory locations. instead of
absolute addresses. like I 6.7''. See temporary local data: Variables defined
absolute address. using the (temp) designation in 1he
symbols table: A STEP 7 program
declaration table of o block. Variables
component that allows users to define designated os such ore only available lo
symbols l o represent absolute addresses. the local b lock and only while lhe block is
Symbol definition involves specifying lhe being processed. See local stack.
name (symbol). absolu te address, data time base: A unit of time generated by
lype, and on associated comment. the system clock and used by software
Symbols defined here are considered timer instructions. Normal time bases are
global. See global symbol. 0.01, 0. 1, and 1.0 second.
synchronous error OBs: Th e group of lime-delay Interrupt. An S7 Interrupt
organization blocks c alled when one of capability that causes on interrupt to the
the synchronous errors occur. CPU o fter a specific amount of time hos
synchronous errors: Run-time errors lhot e)(pired (e.g .. every 100 ms.) S7 300 and
ore associated wrth or resultant from a S7 400 systems provide time-deloy-
particular aspect of the user program interrupt OBs to allow crea tion of service
(e.g., addressing error, error accessing 1/0 routines to respond to user-configured
module). See synchronous error OBs. time-delay interrupts. See time delay
interrupt 08s.
system blocks: S7 blocks that ore actually
time-delay Interrupt 08s: OB 20 to OB 23
components of the operating system.
Such blocks include system functions ore provided for servicing time-delay
(SFCs). syslem function blocks {SFBs), and interrupts configured by the user. The
system data b locks (SDBs). code blocks called lrom these OBs will
support timed regulated processing of
system data object: The compiled certain portions of the user program.
configuration doto that is loaded to the lime-delay interrupt OBs available to o
CPU. The data con1oins configured program, is CPU dependent. See Ume-
hardware and network configuration and deloy interrupt.
connection informa tion.
time-of-day Interrupt: S7 300 and S7 400
System Function (SFC): An S7 Function, systems provide time-of-day interrupts to
integrated in the operating system of on support processing of certain portions of
S7 CPU. SFCs ore called from the user the user program a t o specific time of
program just as any o ther Function. What day either once only or periodically (e.g.,
SFCs are usable, is CPU-dependent. hourly. doily, weekly. monthly. yearly. or
every minute). See lime-of-doy interrupt
System Function Block (SFB): An S7
OBS.
Function Block. integrated in the
operating system of on S7 CPU. SFBs ore time-of-day Interrupt OBs: OB 10 to OB 17
called from the user program just as any ore provided for servicing user-configured
o ther Function Block. What SFBs are time-of-day interrupts. Time-of-day
usable. is CPU-dependent. interrupt OBs ovollobte to a program. is
CPU dependent. See lime-of-day
in terrupt.
434
Glossary
timer memory (T): The area of the system un-conllgured connection: A togicot
memory containing locations used for communication link between S7 p artners.
software timers. Each timer word. when in which the connec tion is established
se t, contains the timer preset value in dynamically al runtime when the active
BCD, and the user-defined time-base of partner in the link initiates the service.
the time,. The le tter 'T' precedes each S7 instead of being defined expliciHy os w ith
timer address (e.g .. TO. Tl, T2. and T3 each configured connections.
is a unique timer.).
unilateral communication: Refers to S7
timer preset value: A programmed value communication between partners, in
that determines the number of time-base whic h there is o communica tions system
intervals to be counted in a software function b lock (SFBJ only on the local
timer and. subsequently. the partner (e.g .. "GET" SFBJ. See bilateror
programmed time duration. communication.
tralllng edge: The falling edge of a signal User Defined Type (UOT): See UDT.
(i.e .. the ON-to-OFF or t -to-0 transition).
User Memory: S7 memory tho! holds the
tree structure: A graphical report showing control program and dota. In S7 300/S7
how blocks are called in a given 400 systems, the user program is in two
program. areas. load memory and work memory.
See lood memory; work memory.
trigger frequency: When using the
Monitor/Modify variable utlllty. setting the
trigger freque ncy enables you to
determine whether selected variables are -V-
monitored or modified once or every
time the trigger point is reached.
variable: A factor thot can be altered.
trigger point: A setting in the measured. or controlled: quantity tho!
Monitor/Modify variable utility, that con c honge in value.
defines o point in th e active user program
(e.g .• start o f cycle. end of cycle. on RUN· variable declaration: The ac t of defining
to-STOP transition). that will determine a variable for use in the user program.
when selected variables ore to be Declorotion requires noming the vorioble,
monitored or modified. defining its data type (e.g., BOOL INT,
etc.).
435
-W -
436
'
Archiving a project
library SQ
projec t SD.
Array, data type 206,2Ql..23Q
Asynchronous error OBs ill, 1..6.L
Asynchronous errors 12.4.
Authorization l 2-15
AuthorsW 11, 1.1. 1.6
- B-
Index
BRCV 352,:i.5.6
BSEND 352,:i.5.6
B-stock 326,327.342
Binary result 213. 222
Bit logic inslrvctions 212
-A- programming 252..2.58. 260
Bil memory l.Q6. l..'22. 1.26.. l2Z
AG_LRECV .3.i3.3.5.i.356 Blocks 36
AG_LSEND m 3.55..356 documenting
downloading 296, 3 14-315
23.8
Configuring
Compact DP Slaves 88
Elhemet Connections 4Qf
- D-
Profibus Connections 320.
GD Communication 3Z6 Doto Block l filh I 22
Hardware Stations zo accessing dolo elements ] ~?BB
Intelligent DP Slaves 90-99 creeling 228
Modular DP Slaves 86 editing 230
Modules for Multi-computing l.82 instance 1.22
Multi-compu ling Operation 1..38. shored 1.22
S7-300 OS DP-Mosler 8.4.
S7-300 Cenlral Rock 78 Dote lype 200
S7-300 Local Expansion an complex 2Q6
438
Index
Digital input
addressing 126, 122
- F-
module properties l.2Q, 1..66
-G-
- E-
GD communication 354.
ET-200 86 GD table lli
ET-200 B 88 Global d a ta communication 354.
ET-200 M configuring lli
439
Index
HiGraph l.Q
- L-
Hot restart 1Q2.. 118.. 305
LAD 5.
LAD/FBD/STL Editor 20£
- I- Navigating 23!1
Library 33
IM 360/IM 361 SZ.80..82 archiving SQ
440
Index
Network configuration J62. 364, 36.6 Perip heral inpu t byte l.£Z
New Project Wizard AA Peripheral inpu t word ~ 1.00.. ill
Peripheral memory 180, ill
Peripheral outpu t 196, ill
-0 -
Peripheral output byte Lil
Organiza tion Blocks 146, L6Q. !!ill. 1/rl, 1..2.!1 Pulse timer 215
44 1
Index
57-Progrom 33 Subnet ~
S7-SCL
Industrial Ethern et 3.42..322
2
MPI 348 ,3ZQ
SFB 188 Profibvs 3.42. 3.28
SFC 188 Subnet ID 3ZQ-3Z I . 378-379. 392-393
Sample projects 42-43 5J Symbol 226. 215.
Segmented rack 51 Symbolic addresses !96.226
assigning to 1/0 modules Z6
Set-Reset operations 2.1.3 viewing and editing 226
programming 258-252
442
Index
- T- -V -
UDP service
443
Notes
Notes:
444
Notes
Notes:
445
Notes
Notes:
446
Notes
Notes:
447
Notes
Notes:
448
-
I I I
P-roclicol
• task-oriented
P.resented in a steP.·by-steP. t .. .
...
Started
Actual
P.resented
ISBN 1-889101-03-6
90000>
9 781889 101033