written authority.
Offenders wi ll b e li able for dama ges. Al l ri ghts , in clud ing righ ts c reat ed b y pa tent grant or regi stra tion of a
utility mod el or de sign, ar e reserv ed.
Disclaimer of liability
We have chec ked th e conten ts of this manual for agree ment wit h the hard ware an d softwar e descri bed.
Since dev iation s cann ot be prec luded en tirely , we cann ot guara ntee ful l agreem ent. How ever, the data in
this manual are reviewed regularly and any necessary corrections included in subsequent editions. Suggestions for improvement are welcomed.
Technica l da ta s ubje ct t o ch ange.
Safety-relate d guidelines
This manu al c onta ins noti ces whi ch y ou s houl d obse rve to e nsur e yo ur ow n pers on al s afet y, as wel l
as to protec t the prod uct and co nnec ted equi pment. Th ese noti ces ar e highli ghted in the manu al by
a warning tri angle and ar e marked as follow s accord ing to the level of da nger:
Warning
indicat es that de ath, sev ere pers onal injury or substan tial pro perty da mage ca n result
if proper precautions are not taken.
!
Caution
indicat es t hat m inor p erso nal inju ry o r prop erty dama ge c an r esul t if p rope r
precautions are not taken.
!
Only qualif ied pers onne l should be allo wed to in stall an d work on this equi pment. Q ualifi ed perso ns
are defined as persons who are authorized to commission, to ground and to tag equipment, systems
and circui ts in ac cordan ce with establi shed s afety pr actice s and st andard s.
Siemens Aktiengesellschaft
6ES5 998-3PR21
EWK Elektronikwerk Karlsruhe
Printed in the Federal Republic of Germany
How to Use this Manual
Scope
This programming guide describes the following versions of the
CPU 948 and its system software:
Versions of the CPU 948
•• CPU 948-1 with 640 Kbytes of user memory,
Order no . 6ES5 948-3UA11, from vers ion A03
•• CPU 948-2 with 1 664 Kbytes of user memory,
Order no . 6ES5 948-3UA21, from version A03
CPU 948 Programming Guide
C79000-H8576-C848-03
0 - 1
How to Use this Manual
Overview of the Chapters
Chapter 1
Chapter 2
Chapter 3
This informs you about the area s of app lica tion of the S5-1 55U
programmable controller with the CPU 948 and its device structur e.
It explains the typical mode of operation of the CPU and illustrates
how a CPU program i s str uc tured.
The chapter also conta ins sugge stions a bout ho w to tackle
programming an d whic h ch ar ac teristics of the CPU 948 are impor tan t
for programming.
If you have already worke d with the CPU 946/94 7 an d want to know
the differences betwe en these CPUs and the CPU 948 you will find
this information in this chapter.
This explains the components of a STE P 5 user pr ogra m an d how the
program can be structured.
This is intended for readers who do not yet have muc h expe rie nc e of
using the STEP 5 programm ing la ngua ge . It therefore deal s with the
basics of STEP 5 programming and ex pla ins the STEP 5 operations in
detail (with examples).
Experience d re ad er s who may find that the information about specific
operations in the pocke t guid e i s inade qu ate , ca n use Sec tion 3.5 as a
reference section.
Chapter 4
Chapter 5
0 - 2C79000-H8576-C848-03
This provides an overvie w of the mod es and progr am exe cu tion levels
of the CPU 948. It provides you with detailed information about
various start-up modes and the associated organization blocks in
which you can program your routines for differrent start-up situations.
The chapter also explains th e dif fe re nc es betwe en the pr ogram
execution levels "cyc lic proc essing" , "tim e-controlled processing" and
"interrupt-driven processing" and whic h blo cks are available for your
user program.
This informs you about errors to be avo ide d whe n pla nning and
writing your STEP 5 programs.
The chapter tells you about the help you can obta in fr om the syste m
program for diagnosing errors and which reactions can be expected
and informs you ab ou t the blocks in which you can prog ram reactions
to certain errors.
The chapter also explains the CPU 948 self-test.
CPU 948 Programming Guide
How to Use this Manual
Chapter 6
Chapter 7
Chapter 8
Chapter 9
This covers the special functions integrated in the system program. It
tells you how to use the special functions and how to call and assign
parameters to the special func tion OBs. The chapte r also ex pla ins how
to recognize and deal with er ro rs in the pr ocessin g of a specia l
function.
This describes the use of data blo ck DX 0 and its structur e. The
chapter infor ms you of the significance of the variou s DX 0
parameters. Based on examples, you will lear n how to create data
block DX 0 or how to assign the parameters in a screen form.
This is a reference section for experienced system users. It provides
information about the me mo ry organ ization of the CPU 948 and
certain system data words whic h conta in information that can be
called up by the user.
This is also for experienced system user s. The cha pte r ex pla ins how to
address data in certain memory areas using absolute addresses.
Chapter 10
Chapter 11
Chapter 12
This explains when the multipro ce ssor mode ca n be used an d how
data can be exchanged between the CPUs and CPs. The chapter
provides information ab out pro gram ming for multiprocessor operatio n.
The remainder of the ch ap ter provid es detailed information and
application examples for exchanging larger amounts of data in the
multiprocessor mode (multiprocessor communication).
This tells you how to connect your CPU to a PG and the functions
provided by the PG software to test your STEP 5 prog ra m.
This contains the Appendix with tec hn ica l data (e. g. typical operation
execution times, system runtimes, memory capacity) of the CPU 948.
CPU 948 Programming Guide
C79000-H8576-C848-03
0 - 3
How to Use this Manual
Chapter 13
Chapter 14
This lists documentation for further reading.
This is intended to help you find themes quickly and contains a list of
abbreviations and a list of keywords as well as lists of all the
numbered tables and figu re s.
CPU 948 Programming Guide
0 - 4C79000-H8576-C848-03
Conventions used in the text
To provide you with an over vie w of the con ten t s of the pages, the
manual uses the following conventions in addition to a 2nd and 3rd
order of titles:
How to Use this Manual
Entries in the margin
Fourth order entries
Notes
Instructions
Entries in the margin are ke ywords printed in italics on the left-h an d
edge of a page. They provide inform atio n ab out the co nte nts of on e or
more paragraphs on the page.
Fourth order entrie s ar e no t numbe red but appear in the margin in bold
face and identify a lon ge r se ctio n of text.
The following conventions are also used.
Note
Important information is indicated in this format.
Instructions (often a seque nc e of operations to be performed) ar e
represented in tables, e.g.
StepActionResult
CPU 948 Programming Guide
C79000-H8576-C848-03
1Switch the mode selector
from RUN to STOP.
2Hold the reset switch in t he
OVERALL RESET position;
at the same time, switch the
mode selector from STOP to
RUN and back to STOP.
The CPU is in the stop
mode. The STOP LED is lit
continuously.
An OVERALL RESET is
requested. The STOP LED
flashes quickly.
0 - 5
How to Use this Manual
Reference tables
Specific informatio n you ma y requ ire at any time is contained in
numbered tables as shown in the fo llowin g ex am ple and can be foun d
in the list of tables (refer to Chapter 14).
Table 3-2Binary logic operations
OperationOperandFunction
A
O
I0.0 to 12 7.7
......
Examples
AND logic operation with scan for signal state "1"
OR logic operation with scan for signal sta te "1 "
of an input in the PII
........
Examples, some of which cover several pages, are highlighted by a gray
frame. When the examples cover more than one page this is clearly
indicated.
Example 1:Call ing a n d ass i gning par a meters to a fun c tion b lock i n the
methods of representation STL and LAD/CSF in a program block
1.9Converting User Programs of the C PU 928B for the CPU 948 . . . . . . . . . . . . . . . . . . 1 - 24
CPU 948 Programming Guide
C79000-D8576-C848-03
1 - 1
1
1Introduction
Aims of the manual
Contents of Chapter 1
This manual is intended to provide spec ialized information about
programming the CPU 948 for users who alrea dy have ba sic
knowledge of programm ing PLCs an d want to use the CPU 948 in the
S5-155U programmable controller. If you do not yet have this basic
knowledge, we strongly ad vise you rea d the docum entation
introducing the progr am min g lan gu ag e STE P 5 /3/ or take part in a
course at our training center. SIEMENS provides comprehensive
training for SIMATIC S5. For more detailed information, contact your
local SIEMENS office.
Chapter 1 explains how to use the manua l and dea ls with the ar ea s of
application of the S5-155U programmable controller with the
CPU 948 and its structure.
The chapter explains the typical mode of operation of a CPU and the
structure of the CPU program.
You will also find a few suggestions abou t how to tac kle
programming and will learn som e of the fe atu re s of the CPU 948
which are important for programming.
If you have already worke d with the CPU 946/94 7 an d would like to
know the differences betwee n the se modules an d the CPU 948, refer
to Section 1.8.
Chapter 1 also informs you about dif ferences between versio ns A01
and A02 of the CPU 948 and explains points you should rem em be r
when convertin g "928B" p rogr am s f or the CPU 94 8.
CPU 948 Programming Guide
C79000-D8576-C848-03
1 - 3
Area of Application for the S5-155U with the CPU 948
1.1Area of Application for the S5-155U with the CPU 948
SIMATIC S5 family
Suitability
The S5-155U programmable controller belongs to the family of
SIMATIC S5 programmable co ntr olle rs. With the CPU 948, it is the
most powerful multiprocessor unit for process automation (open and
closed loop control, signalling, monitoring, logging).
Owing to its modularity and high perfo rm an ce , it can be used for
medium to extremely larg e co ntr ol syste ms as well as fo r comp lex
automation tasks at the plant and process supervision level.
The S5-155U with the CPU 948 is particular ly suita ble for the
following:
•• Tasks requiring fast bit and word-oriented processing and fast reaction
times, i.e. with extremely fast open and closed loop controls.
Examples of this are fast processes in mechanical engineering
(bottling plant, packing machines or similar systems) and in the
automobile industry.
•• Tasks requiring an extremely hig h storag e capacity and fast acces s
times, e.g. in the automob ile ind ustr y, proce ss a nd plan t
engineerin g.
•• Tasks requiring fast commun ica tion with othe r CPUs installed in
the PLC and operating in the multip rocessor mode and with CP
modules (e.g. when connec ted to bus systems, host computers, for
visualization, operation and monitoring).
•• Complex tasks which can be handled efficiently and clearly using
the high level languages C and SCL.
CPU 948 Programming Guide
1 - 4C79000-D8576-C848-03
Area of Application for the S5-155U with the CPU 948
Example of application
PG 770
System managementData base/
Service system
Control room
Fig. 1-1 illustrates the use of the S5-155 U progr am ma ble controller in
a cement w orks.
PG 770
logging
PG 770PG 770
Quarry,
Raw meal silo,
Crusher,
Raw mill
Coal mill,
Kiln
PG 770
Cement
mills,
Dispatch
SINEC H1 bus
1
Process data control
Operation and monitoring (COROS)
S5-155U
Crusher,
Test station,
Limestone
store
S5-155U
Raw mill
Raw meal
silos
S5-155US5-155US5-155US5-155U
Coal mill
Dryer
Heat
exchanger
Rotary
kiln
Clinker cooler
Clinker transport
Dust collector
Telephone
system
Central
control room
Fig. 1-1Example of application of the S5-155U with the CPU 948
S5-155U
Cement mills
Distribution
PG 770
Process
data
editing
CPU 948 Programming Guide
C79000-D8576-C848-03
1 - 5
.1
Typical Mode of Operation of a CPU
1.2Typical Mode of Operation of a CPU
Mode of operation of a CPU
The following modes of operation are possib le in a CPU:
1.2.3.
Cyclic processing
Cyclic processing
This is the main part of all activities in the CPU. As the name alre ad y
says, the same operatio ns are re pe ate d in an endless cy cle .
Time-controlled processing
Interrupt-driven processing
PhaseSequence
All the input modules assigned to the
1
CPU are scanned by the system
program and the values read in are
stored in the proce ss imag e of the
inputs (PII).
The values contained in the PII are
2
processed by the user program and the
values to be output are entered in the
process image of the outpu ts ( PIQ) .
The values containe d in the proce s s
3
image of the outputs are output by the
system program to the output modules
assigned to the CPU.
Cyclic processing can be divided into thr ee main phases, as follows:
CPU
Read in process image
of the inputs
Evaluate input signals,
set output signals
&
I1.5
I1.6
I1.4
I1.3
Output process image
of the outputs
1
=
&
Q3.1
Process
Input I 1.3
Input I 1.4
Input I 1.5
Output Q 2.0
Output Q 3
Output Q 4.7
CPU 948 Programming Guide
1 - 6C79000-D8576-C848-03
Typical Mode of Operation of a CPU
Time-controlled processing
Interrupt-driven processing
Processing according to
priority
In addition to the cyclic processing, time- co ntr olle d processing is also
available for processes requiring control signals at constant intervals,
e.g. non-time critical mo nito rin g func tion s per fo rm ed every seco nd.
1
If the reaction to a particular process signal must be particularly fast, this
should be handled with interrupt-driven processing. With, for example,
a system interrupt, triggered via an interrupt generating module, you
can activate a special processing section within your program.
The types of processing listed above are handle d by the CPU
according to the ir prio rit y.
Since a fast reaction is required to a time or interrupt event, the CPU
interrupts cyclic processing to handle a time or interru pt ev ent. Cy clic
processing theref or e ha s the lowe st prio rity.
Whether or not the time-co ntr olle d proc essin g is mor e imp or tan t than
the interrupt controlled processing depends, among other things, on
the particular task . For this rea son, the priority of time and
interrupt-drive n proc essing on the CPU 948 can be selected.
CPU 948 Programming Guide
C79000-D8576-C848-03
1 - 7
g
The Programs in a CPU
1.3The Programs in a CPU
The program existing on every CPU is divided into the fo llowin g:
•• the system program
and
•• the user program.
System program
Update process image
of the inputs
Output process image
of the outputs
Manage memory
The system program organizes all the functions and sequences of the
CPU which do not involve a specific control task (refer to Fig. 1-2).
System
program
Communication with
the PG
Execute start-up
Call
user
processin
(interfaces)
Handle errors
Fig. 1-2Tasks of the system program
1 - 8C79000-D8576-C848-03
CPU 948 Programming Guide
The Programs in a CPU
Tasks
User interfaces
The tasks include the follo wing :
1)
•• cold and warm restart,
•• updating the process image of the inp uts an d outpu tting the
process image of the outputs,
•• calling the cyclic, time- co ntr olle d an d inte rrup t-d riv en progr am s,
•• detection and handling of erro rs,
•• memory management,
•• communication with the programme r (PG) .
As the user, you can influenc e the rea ctio n of the CPU to partic ula r
situations and errors via spec ial inte rf ac es to the system progr am .
1
Storing the system program
System program defaults
Modifying the defaults
After switching on the power supp ly to the PLC (POWER UP) the
system program is read fro m the EP ROM to the internal operating
system RAM.
The following chapters, except for Chapter 7, describe the defaultsystem reaction to process events or errors. Depending on the
defaults, the CPU changes to the stop mode if an oper atio n code err or
occurs and the error or ga niz atio n blo ck is not loaded .
You can modify the system resp onse by assign ing par am ete rs fo r the
data block DX 0.
Chapter 7 describes the system response following modification.
1)
When operating with several CPUs (multiprocessing) further tasks are involved.
CPU 948 Programming Guide
C79000-D8576-C848-03
1 - 9
The Programs in a CPU
User program
Tasks
The user program contains all the functions required for processing a
specific control task . In gen er al ter ms, these functions can be
assigned to the interfac e pr ovided by the system program for the
various types of processing, as follows:
Type of processingTask
Cold and warm restartTo provide the conditio ns un de r whic h
the other processing functions can start
from a defined status following a cold or
warm restart of the contro l system (e. g.
assigning specific values to signa ls).
Cyclic processingConstantly repeated signal processing
(e.g. logic operatio ns on binary signa ls,
reading in and analyzing analog values,
specifying binar y sign als fo r output,
outputting analog values).
Time-controlled proc essin g Special, time-dependent processing with
the following time conditions:
- faster than the average cycle,
- at a time interval greater than the
average cycle time,
- at a specified point in time.
Interrupt-driven proc essin g Special, fast reactions to certain proc ess
signals.
Error reactionHandling pr oblem s within the normal
After programming the user program, you must load it in the user
memory of the CPU 948 (directly fro m the PG) or via a memor y ca rd
whose contents are copied to the user memory by an OVERALL
RESET of the CPU.
Organization blocks are ava ilab le as inte rf ac es to the system program
for the special types of processin g.
CPU 948 Programming Guide
C79000-D8576-C848-03
1 - 11
Which Operands are available to the User Program?
1.4Which Operands are available to the User Program?
The CPU 948 provides the follo wing ope ra nd are as fo r pr ogramming:
•• process image and I/Os
•• flags (F flags and S flags)
•• timers/counters
•• data blocks
Process image of the inputs
and outputs PII/PIQ
CharacteristicsSize
I/O area (P area)
Extended I/O area (O area)
The user program can ac ce ss the fo llowin g da ta typ es
in the process image ex tre mely quickly:
-single bits,
-bytes,
-words,
-double words
CharacteristicsSize
The user program can ac ce ss the I/O mo dules dir ectly
via the S5 bus.
The following data types are po ssible :
-bytes,
-words.
CharacteristicsSize
128 bytes
each for
inputs and
outputs
256 bytes
each for
inputs and
outputs
The user program can ac ce ss the I/O mo dules dir ectly
via the S5 bus.
The following data types are po ssible :
-bytes,
-words.
CPU 948 Programming Guide
1 - 12C79000-D8576-C848-03
256 bytes
each for
inputs and
outputs
F flags
Which Operands are available to the User Program?
CharacteristicsSize
The flag area is a memory area which the user
program can access extremely quickly with certa in
operations.
The flag area should be used ideally for working data
required often.
The following data types can be accessed:
-single bits,
-bytes,
-words,
-double words.
Single flag bytes can be used as interpr ocesso rcommunication flags (IPC flags) to exchange data
between the CPUs in the multiproce ssor mode (refer
to Chapter 10). IPC flags ar e up dated by the system
program at the end of the cycle via a buffer in the
coordinator or CP/IP.
2048 bits
1
S flags (extended flag area)
CharacteristicsSize
The CPU 948 also contains an addition al fla g ar ea , the
S flag area. The user program ca n also acc ess this ar ea
extremely quickly as with the F flags.
S flags cannot however by used as actual operands
with function block calls nor as IPC flags for data
exchange between the CPUs. The bit test oper atio ns of
the CPU 948 can also not be used with the S flags.
These flags can only be used with the PG system
software "S5-DOS" from version 3.0 upwards or
"S5-DOS/MT" from version 1.0 upwar ds.
32 768 bits
CPU 948 Programming Guide
C79000-D8576-C848-03
1 - 13
Which Operands are available to the User Program?
Timers (T)
CharacteristicsSize
Counters (C)
Data words in the current data
block
The user program loads timer cells with a time value
between 10 ms and 9990 s and by means of a start
operation, decrements the timer from this value at the
preselected intervals until it reaches the value zero.
CharacteristicsSize
The user program loads co unter cells with a start value
(max. 999) and then increm en t s o r de crements th em.
CharacteristicsSize
256 timer
cells
256
counters
A data block contains constants and/or variables in the
byte, word or double word format. With STEP 5
operations, you can always access the "current" data
block (refer to Section 2.4.2).
The following data types can be accessed:
-single bits,
-bytes,
-words,
-double words.
1)
In data blocks with a length greater than 256 words, you can only access data
words with the numbers > 255 with operations for absolute memory access
(refer to Chapter 9).
256
words
1)
CPU 948 Programming Guide
1 - 14C79000-D8576-C848-03
How much Memory is available for the User Program?
1.5How much Memory is available for the User Program?
For storing logic and data bloc ks, the CPU 948 only ha s the use r
memory in the internal RAM.
The CPU 948 is available with two versions of the user memory:
•• Version 1: with 640 Kbytes,
•• Version 2: with 1,664 Kbytes.
1
CPU 948 Programming Guide
C79000-D8576-C848-03
1 - 15
How to Tackle Programming
1.6How to Tackle Programming
If you are an experienced user, you have probably found the most
suitable method fo r cr ea ting programs for yourse lf an d you ca n skip
this section.
Less experienced reade rs will find tips for desig ning, program min g,
testing and starting up your STEP 5 program.
Implementation stages
Recursive procedure
Stage 1
The implementa tion of the STEP 5 co ntr ol pr og ra m can be divided
into three stages:
StageActivity
1Determining the tec hn olo gic al task
2Designing the program
3Creating, testing and starting the program
In practice, you will recognize that certain steps must be repeate d
(recursive proced ur e) , e. g. when you rea lize that more signals are
required to improve the handling of the task.
Determining the tec hn olo gic al task :
StageActivity
1Create a general block diagram outlining the co ntr ol
tasks of your process.
2Create a list of the input and output sign als re quired
for the task.
3Improve the block diagram by assigning the signals
and any particular time conditio ns an d/or counter
statuses to the individual blocks.
CPU 948 Programming Guide
1 - 16C79000-D8576-C848-03
Loading...
+ 532 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.