Siemens s5 CP 580
SIEMENS
Documentation Supplement
CP 580
6ES5 998-1AT21, Release 02
Dated 11191
This supplement contains information and corrections for the CP 580 manual, release 02, which we received after the manual had been printed. This supplement is
therefore newer and must be treated as having priority over the information in the
manual.
SETUP
The SETUP can only be called with the key combination
(=]
and
(E)
and
(S)
Setting the message texts
When delivered the message texts of the CP 580 are set to the German language
version. The German message texts are contained in the file 'CP580.MSG1 and
stored in the directory 'CP580'. If you wish to change over to the English language
version, you must alter the line
'SET CP580=C:\CP580\CP580.MSG' in the AUTOEXEC.BAT file as follows:
SET CP580=C:\CP580\CP580E.MSG
O Siemens AG 1991 C79000-QB576-Cm-02
CP 580 Documentation Supplement
Caution
If the directory in which the file is present contains a large number of
files (several hundred),the access times to a file increase greatly under
MS-DOS. Remember this with regard to the CP functions CPRECORD
and CPMASS.
Status bits from job management
Note
You cannot transmit any jobs to the CP 580 for the respective job nurnber if bits 1 and 2 are set simultaneously in the status word. This also
applies when running-up your S5 program.
lnterprocessor communication flags
In the current delivery stage the interprocessor communication flags are not
enabled for use!
S5 program examples
The S5 program examples in the chapters 4, 5 and 6 merely represent examples for
assigning parameters to the data handling blocks for the functions CPRECORD,
CPMASS and CPSHELL. Programs which are executable and autonomous can be
found in Chapter 8.
O Siemens AG
1991 C79W-Q8576-C294-02
CP 580 Documentation Supplement
Supplement to the operation of the CP 580 in the programmable
controllers
Section 3.1
Note
The CP 580 is not intended for use with the S5-150U programmable
controller.
Supplement to the CPRECORD function
Section 4.3.2.4
The accuracy of the acquisition cycle depends on the user applications running parallel.
If the set time grid is exceeded by more than 10°h, a message is entered in the logbook
file:
-
Warning: cycle overflow > 10% date time
However, data recording is continued.
Organization of the S5 data areas
[email protected]'i$
[email protected]
i&@ga,#[ag
$
~
i
i
c
'
g
i
f
#
~
; g g mgtm
:ijiijj;jiiijjiiijjjijljjjjji;;jijijjj jjijj jjjiijijjj~iijjjj~jljijijijljljljjijljijjji~jiji~~jiji~~jijijjjjjjjjjjjjjjjijjjijijj
iijijjjijjiijijjii'jijjjjjijijijj:ljljjji;j:jl.jijijijjjjjjjjjiji;
,.,.,.,.,................................
............,...,.,..,.,,,..,.,..,.. , . , , . . . . . . ..................... ............... ....... ..........
,.
AS
Absolute address *
OxFFFFFF
4096
Word-oriented
CA
Counter cells **
255
256
Word-oriented
DB
Data word
4090
4091
Word-oriented
DX
Data word
4090
4091
Word-oriented
FA
Flag byte
255
256
Byte-oriented
IA
Input byte
127
128
Byte-oriented
PY
I10 byte
255
256
Byte-oriented
Q Siemens AG 1991 C79909-Q8576-C204-92
3+
CP 580 Documentation Supplement
QA
Output byte
127
128
Byte-oriented
RS
RS word **
511
512
Word-oriented
TA
Timer cells '*
255
256
Word-oriented
++
Please note in the AS data area:
The 32767 words mentioned in the descriptions of the data handling blocks
cannot be used, as the CP only provides buffers of 8 Kbytes for this area.
Offset and length are dependent on the CPU used.
Section 4.3.3.2
Supplement to the parameter BLGR
KY0,O describes that the standard value which is dependent on the CPU is used for
blocking:
Section 4.3.4.1
Caution
If the CPMASS and CPRECORD functions are used simultaneously
CPMASS must be started before CPRECORD.
CPRECORD outputs an acknowledgeable message if the storage space required for
creating ASCll files exceeds the actual space present on the hard disk drive or the
floppy disk.
4+
C
3 Siemens AG 1991 C79000-(18576-C204-02
CP 580 Documentation Supplement
Nevertheless, data recording can be started by pressing the key
n
If you press a different key, the CPRECORD program aborts data recording.
If the CPU which has been addressed is not synchronous when starting the CPRECORD function, the message
"[CPDHB] CPU is not synchronized"
is displayed on the screen and stored in the logbook file. In the time grid of the acquisition cycle (parameter 12 in the configuration file) the program CPRECORD then scans
the interface to the CPU until
- the parameterized interface is synchronized by the CPU,
- data recording is stopped by the key combination
(E]
(left) and [F)
and
0
- or the program CPRECORD is uninstalled from the memory by entering
CPRECORDIU
Section 4.6
Before deinstalling the program CPRECORD using the command CPRECORDIU the
running data recording must be stopped by pressing the keys
(E
(left)
)and (F)
and
O Siemens AG 1991 C79€CO-Q8576-CX)4-02
0
CP 580 Documentation Supplement
Supplement to the CPMASS function
Assigning parameters using joker lengths
Depending on the type of data and independent of the data length which has actually
been transmitted, files with the following set lengths are always created on the hard
disk drive:
Counter cells
Timer cells
CA
TA
CAaaa.S5F
512 bytes
TAaaa.S5F
512 bytes
1) nnn = DB-IDX number, aaa = job number
When reading back the data with joker lengths you must make sure that the areas on
the S5 side are large enough.
Section 5.3.3.2
Supplement to the parameter BLGR
KY0,O describes that the standard value which is dependent on the CPU is used for
blocking
Q Siemens AG 1991 C79000-Q8576-C2W-02
CP 580 Documentation Supplement
Section 5.3.4
A
Caution
CPMASS must only be installed once.
If the CPMASS and CPRECORD functions are used simultaneously,
CPMASS must be started before CPRECORD.
Supplement to the CPSHELL function
A
Caution
The CP 580 functions CPMASS and CPRECORD must not be started
via the command interpreter CPSHELL.
The bit "job completed without error" is only relevant for the communication between
the CP and the CPU. It does not give any information whether the triggered job (e.g.
COPY command, starting a program) was actually executed by the CP.
Section 6.3.4.3
Supplement to the parameter BLGR
KY0,O describes that the standard value which is dependent on the CPU is used for
blocking:
O Siemens AG 1991 C79000-Q8576-CX)4-92
CP 580 Documentation S u ~ ~ l e m e n t
Section 6.4.2
The bits in the status word are only used to monitor data transfer between the CPU
and the CP 580. It is not confirmed whether the command given has been executed.
Supplement to the function "free programming of the CP 580"
Section 7.4.6
If the call parameter Timeout (register CX) equals zero the driver will, in any case,
immediately respond without errors. It can be scanned with the driver function "scan
status".
Section 7.4.2
Before calling the driver for the first time the system area of the transfer
control block (TCB) must be preset with zero.
Section 7.4.2.1
The numbers 100-199 are intended to be the job numbers for user programs. All other
job numbers are reserved.
O Siemens AG 1991 C79000-Q8576-CZW-02
CP 580 Documentation S u ~ ~ l e m e n t
Supplement to the application examples
Section 8.1.4
The configuration file is only searched for in the directory which is currently valid, i.e.
the directory from which CPRECORD is started. When calling, any deviations must be
stated explicitly as parameters.
Restart data recording
When using the "non permanent recording" parameter assignment, data recording is
aborted after the set amount of files has been reached.
All old files must be deleted from the directory D:\EXAMPLE before you can restart
data recording with the key combination
0
[G)
(left) and [X]
and
Section 8.4
The listing of the application program CPSHELL in the directory C:\CP580\SRC is an
example for free programming. However, no changes may be made to the software,
as otherwise we cannot be liable for this product.
The following files in the directory C:\CP580\SRC will serve you as further application
examples for free programming:
GETD6.C
PUTD8.C
SH0WDB.C.
O Siemens AG 1991 C79999-O857&C994-02
CP 580 Documentation Supplement
Supplement to the reference section of the software
Section 9.5.2 Error messages from the program CPSHELL
The bits in the status word are only used to monitor data transfer between the CPU
and the CP 580. It is not confirmed whether the command given has been executed.
Supplement to the reference section of the hardware
Example of a single null modem cable for connecting a PT10 to the COM 1 V.24 interface of the CP 580.
PT 10 laser printer
Connector
Computer
Socket
Chassis ground
1
1 Chassis ground
RD
3
2 TD
TD
2
3 RD
Signal ground
7
7 Signal ground
5 Ready to send
DTR
2o
i
6 Data record ready
(Contacts which are not listed are not being used)
O Siemens AG 1991 C79909-Q8576-CZCd-02
SIEMENS
Manual
Order No. 6ES5 998-1AT21
Release 02
We have chedted the contents of this manual for agreement with the
hardware and software desabed. Since deviatiorm cannd be p r e
cluded entirely, we cannd guarantee full agreement. However, the
wrecdata in this manual are reviewed regularly and any n-wy
lions included in subsequent editions. Suggestions lor inprowment
are welmrned.
The reprodudrion, transmksion or use of this document or its CO*
tents is n d permitted without express written authorily.
Offenders will be liable for damages. All rights, including rights
created by patent grant or registration of a utility model or design, are
rese~ed.
Technical data sub'pct to change
Q Copyright Siemens A G 1991 All Rights Reserved
Siemens Aktiengesellschaft
Order No. 6ES5 998-1AT21
Order from: Elektronikwerk Karlsruhe
Printed in the Federal Replblic of Germany
Contents
lnforma jon
Suggest~ons/Corrections
Instructions
~79000-~8!576-~204
Contents, Page Overview
How to Use this Manual
Introduction to Working with the CP 580
Installation and Commissioning of the CP 580
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
I
Mass Storage Functions
Command Interpreter
Free Programming of the CP 580
Application Examples
Reference Section for System Software
9
Reference Section for Hardware
Technical Data
Reference Literature
Abbreviations
Index
Ordering Information
MS-DOS Pocket Guide
included in this manual
6ES5 998-I A T21 Release 02
13
14
C79000-M85764648-03
Warning
Risks involved in the use of so-called SIMATIC-compatible modules of
non-Siemens manufacture
"The manufacturer of a product (SIMATIC in this case) is under the general
obligation to give warning of possible risks attached to his product. This obligation
has been extended in recent court rulings to include parts supplied by other
vendors. Accordingly, the manufacturer is obliged to observe and recognize such
hazards as may arise when a product is combined with products of other
manufacture.
For this reason, we feel obliged to warn our customers who use SlMATlC
products not t o install socalled SlMATlCcompatible modules of other
manufacture in the form of replacement or add-on modules in SlMATlC
systems.
Our products undergo a strict quality assurance procedure. We have no knowledge
as to whether outside manufacturers of so-called SIMATIC-compatible modules
have any quality assurance at all or one that is nearly equivalent to ours. These socalled SIMATIC- compatible modules are not marketed in agreement with Siemens;
we have never recommended the use of so-called SIMATIC-compatible modules of
other manufacture. The advertising of these other manufacturers for so-called
SIMATIC-compatible modules wrongly creates the impression that the subject
advertised in periodicals, catalogues or at exhibitions had been agreed with us.
Where so-called SIMATIC-compatible modules of non-Siemens manufacture are
combined with our SlMATlC automation systems, we have a case of our product
being used contrary to recommendations. Because of the variety of applications of
our SlMATlC automation systems and the large number of these products marketed
worldwide, we cannot give a concrete description specifically analyzing the hazards
created by these so-called SIMATIC-compatible modules.
It is beyond the manufacturer's capabilities to have all these so-called SIMATICcompatible modules checked for their effect on our SlMATlC products. If the use of
so-called SIMATIC-compatible modules leads to defects in a SlMATlC automation
system, no warranty for such systems will be given by Siemens.
In the event of product liability damages due to the use of so-called SIMATICcompatible modules, Siemens are not liable since we took timely action in warning
users of the potential hazards involved in so-called SIMATIC-compatible modules."
Guidelines for Handling
Electrostatically Sensitive Devices (ESD)
1 What is ESD?
VSLl chips (MOS technology) are used in practically all SlMATlC S5 and
TELEPERM M modules. These VLSl components are, by their nature, very
sensit~veto overvoltages and thus to electrostatic discharge:
They are therefore def~nedas
"Electrostat~callySensitive Devices"
"ESD" is the abbreviation used internationally
The follow~ngwarn~nglabel on the cab~nets,subracks and packing indicates
that electrostatically sensitive components have been used and that the
modules concerned are susceptible to touch:
ESDs can be destroyed by voltage and energy levels which are far below the
level perceptible to human be~ngs.Such voltages already occur when a
component or a module IS touched by a person who has not been
electrostat~callydischarged. Components wh~chhave been subjected to such
overvoltages cannot. In most cases. be ~mmediatelydetected as faulty; the
fault occurs only after a long perlod In operation.
An electrostatic discharge
- of 3500 V can be felt
- of 4500 V can be heard
- must take place at a minimum of 5000 V to be seen.
But just a fract~on of t h ~ s voltage can already damage or destroy an
electron~ccomponent.
ESD Guidel~nes
The typlcal data of a component can suffer due to damage, overstresslng or
weakening caused by electrostat~cd~scharge;thls can result In temporary
fault behawor, e.g. ~nthe case of
-
-
temperature var~atlons.
mechanical shocks,
vlbrat~ons,
change of load.
Only the consequent use of protectwe equipment and careful observance of
the precautions for handling such components can effectively prevent
functional disturbances and fallures of ESD modules.
2
When is a Static Charge Formed?
One can never be sure that the human body or the mater~aland tools whlch
one IS u s ~ n gare not electrostatically charged.
Small charges of 100 V are very common; these can, however, very qu~ckly
rise up to 35 000 V.
Examples of statlc charge:
-
Walklng on a carpet
Walk~ngon a PVC flooring
up to 35 000 V
up to 12 000 V
Slttlng on a cushioned charr
up to 18 000 V
Plast~cdesolderlng u n ~ t
up to
-
Plast~ccoffee cup
Plast~cbags
up to
up to
-
Books, etc. w ~ t ha plastlc blnd~ng
up to
-
3
8
5
5
8
000 V
000 V
000 V
000 V
Important Protective Measures against Static Charge
Most plastic materials are highly suscept~bleto static charge and must
therefore be kept as far away as possible from ESDs.
Personnel who handle ESDs, the work table and the packing must all be
carefully grounded.
ESD Gu~del~nes
Handling of ESD Modules
4
One bas~crule to be observed IS that electronic modules should be
touched by hand only ~f th~sIS necessary for any work to be done
on them. Do not touch the component pins or the conductors.
Touch components only
-
if
the person 1s grounded at all times by means of a wrlst strap
0r
-
the person IS wearing special anti-static shoes or shoes wlth a
grounding strip.
Before touchlng an electronic module, the person concerned must
ensure that (s)he is not carrylng any static charge. The simplest
way IS to touch a conductive, grounded Item of equlpment (e g a
blank metallic cabinet part, water pipe, etc.) before touchlng the
module.
l
Modules should not be brought Into contact with insulat~ng
materials or materials wh~chtake up a static charge, e.g. plastic
foil, insulating table tops, synthet~cclothing, etc.
Modules should only be placed on conduct~vesurfaces (table with
anti-static table top, conductive foam material, anti-static plastic
bag, anti-stat~ctransport container).
Modules should not be placed In the vlc~mtyof mon~tors,TV sets
(minimum distance from screen > 10 cm).
The diagram on the next page shows the required protective measures
against electrostatic discharge.
5
Measurements and Modification to ESD Modules
Measurements on modules may only be carried out under the following
conditions:
-
the measuring equipment is grounded (e.g. via the PE conductor of
the power supply system) or
when electrically isolated measuring equipment IS used, the probe
must be discharged (e.g. by touching the metallic casing of the
equlpment) before beginning measurements.
Only grounded soldering irons may be used.
ESD Gu~delines
Sitting position
Standing position
a
b
c
d
e
f
6
Conduct~vefloor~ng
Anti-static table
Anti-stat~c shoes
Anti-stat~ccoat
Ground~ngwrist strap
Grounding connection of
the cablnets
Shipping of ESD Modules
Anti-statlc packing mater~al must always be used for modules and
components, e.g. metalized plastic boxes, metal boxes, etc. for storing and
dispatch of modules and components.
If the container itself is not conductlve, the modules must be wrapped in a
conductlve materlal such as conductive foam, anti-static plastic bag,
aluminium foil or paper. Normal plastic bags or foils should not be used under
any circumstances.
For modules with built-in batteries ensure that the conductive packing does
not touch or short-c~rcuitthe battery connections: if necessary cover the
connections with insulating tape or material.
4
Siemens AG C79000.08076-C339.01
Contents
Contents
......................................... 1-3
1
Introduction to Working with the CP 580
1.1
What is a CP 580 and What Facilities
Does it Provide You With?
1.2
What Applications are Possible for the CP 5801
1.3
What Tasks can the CP 580 Handle In an
Automation Network?
................................................................
1-3
........................... 1-4
........................................................................1-6
.......................................................2-3
Unpacking and Checking the Delivered Components....................2-3
Installation and Commisslonlng
Standard Scope of Delivery..................................................................
2-3
Environmental Conditions for the CP 580 ........................................... 2-5
Connectable Peripheral Devices..........................................................2-6
Installation and Commissioning of Hardware .................................2-7
Check List for Installation and Commissioning...................
.
............ 2-7
Switch and Jumper Settings on the CP 580 .........................................2-8
Setting of the Base Interface Number (Module Address) .....................2-9
Checking the Coding Switch and
Jumper Settings on the Basic Board..................................................2-12
Checking the Switch Settings on the Expansion Board ..................... 2-14
Fixed Jumpers ..................................................................................2-14
Installation of CP 580 into Subrack ...................................................
2-15
Interference-freeHardware Configuration........................................ 2-15
Usable Slots for the CP 580 in the Programmable Controller............ 2-18
Switching Off the Power Supply of the PLC Rack ...................
......
2-21
Installation of CP 580 into PLC Rack .................................................2-21
C3 Siemens AG 1991 C79000-0857&C204-01
0-1
Contents
Connection of Keyboard. Monitor. Printer and Mouse .......................2-22
Connection of PG 750 Keyboard.....................................................
2-24
Connection of Monitor ........................................................................
2-24
Connection of Logging Printer.........................
. . . .............................2-27
Connection of a Mouse ..................................................................
2-28
Maximum Cable Lengths for Connection
of Operation Devices and Peripheral Devices....................................2-28
Setting the RUNISTOP Switch ...........................................................
2-29
Check List Before Switching On the Power Supply ...........................2-29
Switching On Peripheral Devices.......................................................2-29
Switching On the Power Supply to the PLC Rack.............................. 2-29
Software Commissioning
................................................................ 2-30
Procedure when Switching On for the First Time ............................... 2-30
Start-up with Defautt SETUP for the CP 580 Basic Version .............. 2-30
Normal Restart of CP 580 ..................................................................2-31
Making Back-up Diskettes................................................................ 2-31
Setting the Hardware Clock of the CP 580 ........................................2-32
Possible Faults and Their Elimination
...........................................2-32
The RUN LED does not go to RUN ................................................... 2-32
The STOP and FAULT LEDs do not go off ........................................ 2-33
Displays on Diagnostic Panel (DIAG)................................................ 2-33
3.1
...................3-3
Programmable Controllers for CP 580 .............................................
3-3
3.1.1
Single Processor and Multi-processor Operation.................................3-4
3.2
Operatlonal Components
3.2.1
3.2.2
S5 Backplane Bus and Pages.............................................................. 3-5
Data Handling Blocks ...........................................................................3-6
3
0 .2
Operation of CP 580 in S5 Programmable Controllers
.........................
.
..................................3-5
O Siemens AG
1991 C79999-B8576-CX)4-01
Contents
3.2.3
CPIDHB Driver ..............................................................................3-6
3.3
Principle interaction Between CPU and CP 580 ..............................3-7
3.3.1
3.3.2
3.3.3
Synchronize CP 580 with CPU.............................................................
3-7
Call CPIDHB Driver for Special Application .........................................3-7
Carry Out Data Transfer......................................................................3-8
3.4
Simultaneous Operation of CP 580 Applications
.....................
3-10
..................................................................4-3
Application ..........................................................................................
4-3
Principal Sequences Between CPU and CP ....................................4-4
Process Data Acquisition
Process Data Acquisition Operations
..............................................4-5
Related Procedures.........................................................................4-5
Measures on the CP........................................................................4-6
Setting the Base Interface Number ......................................................4-6
Defining Parameters for Data Acquisition ............................................4-7
Definition of Conversion Procedure......................................................4-7
Editing the Configuration File ............................................................4-11
Programming of CPU .........................................................................
4-18
Principle............
.
.
.........................................................................
4-18
Calling and Parameterizingthe Data Handling Blocks....................... 4-19
Example .............................................................................................
4-24
Activation and Testing of Process Data Acquisition ...........................4-26
Activation..........
.
.............................................................................4-26
Testing................................................................................................
4-27
Evaluation of Acquired Process Data
..........................................
4-32
Storage of Process Data on the CP 580 .........................................
4-32
Structure of Process Data in the ASCll Files .....................................4-34
8 Siemens AG 1991 C7900QB6576.CX)4.01
0-3
Contents
4.4.3
4.4.4
Converting the Individual Data ...........................................................4-35
4-39
Example of "Individual" Conversion ..................................................
4.5
Status Messages
4.6
.............................................................................4-40
Handling with Various Operating Conditions ................................ 4-44
Mass Storage Functions................................................................... 5-3
Application ....................................................................................
5-3
....................................5-4
Mass Storage Function Operations .......................
.
.......................5-8
Principle Sequences Between CPU and CP
Related Procedures.............................................................................5-8
.
.....................................................
5-9
Measures on the CP ................. .
Programming the CPU ..................................................................... 5-10
Principle..............................................................................................
5-10
Synchronization of the CPU .....................
... ..................................
5-12
5-14
Transmission of Data from CPU to CP 580........................................
Transmission of Data from CP 580 to CPU.....................................
5-17
Preselection of Directory on CP 580 or Delete S5F Files ..................5-22
Indirect Parameterization "RW" ..........................................................
5-25
Example of DHB Parameterization for Mass Storage Functions........5-27
Activation and Testing of the Mass Storage Functions ......................5-30
File Names for CPU Data on the CP ..............................................5-30
5-31
Testing................................................................................................
Error Bits ..........................................................................................5-33
Parameter Error Bits...........................................................................
5-33
5-35
Job Status Bits ...................................................................................
Q Siemens AG 1991 C79990-08576-C904-01
Contents
Command Interpreter.......................................................................
6-3
..........................................................................................6-3
6-4
Principle Sequences Between CPU and CP ....................................
.
.................................. 6-5
Command Interpreter Operations .............
Application
Related Procedures.............................................................................
6-5
Measures on the CP .............................................................................
6-6
Defining the Command Output .............................................................
6-7
Programming the CPU .................................... .................................6-9
Storing Commands in Data Block .................................................
6-9
................. 6-10
STEP 5 Operations for the Command Interpreter.........
.
Calling and Parameterizingthe Data Handling Blocks.......................6-11
Example .............................................................................................
6-17
Activation and Testing of the Command Interpreter.......................... 6-21
Activation.......................... .. ..............................................................6-21
Testing...............................................................................................6-22
Error Bits
...........................................................................................
6-23
Parameter Error Bits..........................
.
..............................................6-23
Job Status Bits ...................................................................................
6-25
Special Features During Command Interpretation .......................6-27
7
7-3
Free Programming of the CP 580......................................................
7.2
...........
.
......................................................................... 7-3
Procedure............................................................................................7-4
7.2.1
7.2.2
Summary ..............................................................................................
7-4
Analysis of Task ...................................................................................
7-5
7.1
Application
Q Siemens AG 1991 C79999-B8576-CX)4-01
Contents
Programming of DHB Calls
..........................
.
.
.............................7-7
General Information..............................................................................
7-7
Available Data Handling Blocks ......................................................
7-8
Parameters of the Data Handling Blocks .............................................
7-9
Parameter Description...............
...
.........................................7-10
Direct and Indirect Parameterization..................................................7-16
Indirect Parameterization of SSNR, A-NR, ANZW and BLGR ...........7-16
Examples of Indirect Parameterization............................................7-17
lndirect Parameterization of QTYPIZTYP, DBNR, QANFIZANF
7-20
and QLAEJZLAE .................................................................................
Format and Meaning of the Status Word ......................................... 7-22
Meaning of Status Bits (Bit Nos. 0 to 7).............................................
7-23
Meaning of Error Numbers .................................................................
7-25
Length Word .......................................................................................
7-26
Status Word "Parameter Assignment Error (PAFE)"..........................7-27
SEND Block........................................................................................
7-28
Description of the SEND-ALL Mode ...................................................
7-29
Description of the SEND-DIRECT Mode........................
.
. . . . . . . . . . 7-30
RECEIVE Block..................................................................................
7-31
Description of the RECEIVE-ALL Mode .............................................
7-32
Description of the RECEIVE-DIRECT Mode ......................................7-33
FETCH Block......................................................................................
7-34
Description of the FETCH Function...................................................
7-35
CONTROL Block ................................................................................
7-36
RESET Block......................................................................................
7-37
SYNCHRON Block ........................................................................... 7-38
Programming the CP 580 User Program........................................ 7-39
CP/DHB Driver ...................................................................................
7-39
Installation and Calling .......................................................................
7-40
Parameterizing the CPIDHB Driver .................................................. 7-41
Transfer Control Block (TCB) ........................................................
7-43
DHB Description.................................................................................
7-44
Q Siemens AG 1991 C79000-88576.CX)4-01
Contents
Transmission Parameters .................................................................
7-45
Extended Transmission Parameters .................................................. 7-49
7-49
Parameters for the Buff er Area ..........................................................
Summary of Driver Functions .......................................................... 7-50
7-52
Example of Call of CPIDHB Driver .....................................................
7-54
Direct Transfer with Direct Jobs .........................................................
Direct Job Sequence ..........................................................................
7-54
7-60
...................................
TCB for Transfer Functions with Direct Jobs
Parameterizationof Driver Functions for Direct Jobs .........................7-61
7-70
Status Codes for Direct Jobs ..............................................................
Data Transfer Without Direct Jobs ................................................... 7-72
Other Driver Functions .......................................................................
7-76
MS-DOS Multiplexer Interrupt (INT 2FH) of the CPIDHB Driver ........ 7-77
Testing the Application
....................................................................7-79
Procedure ...........................................................................................
7-79
Testing the S5 Program .................................................................. 7-80
Testing the CP 580 Program..............................................................
7-80
Representationof the S5 Data in the CP 580 Memory ......................7-81
Error Bits of the CPIDHB Driver .................................................... 7-83
......................................................................
Process Data Acquisition ..............................................................
Application Examples
8-3
8-3
TaskIProblem .....................
.
......................................................8-3
Starting to Solve the Problem.................. .
.
.................................8-4
Structure of Solution.............................................................................
8-5
Individual Working Steps ................................................................
8-7
Mass Storage Functions...............................................................
O Siemens AG 1991 C79999-B8576-C294-01
8-20
Contents
Starting to Solve the Problem.............
.
..........................................
8-20
Structure of Solution .......................................................................... 8-21
Individual Working Steps ................................................................
8-23
Command Interpreter.......................................................................8-32
TaskJProblern...........................
.
.
.
.................................................
8-32
Starting to Solve the Problem.......................................................8-32
8-33
Structure of Solution...........................................................................
Individual Working Steps ....................................................................
8-34
Free Programming ...........................................................................
8-41
Reference Section for System Software ..........................................
9-3
SETUP (Setting of Device Configuration in the Software) .............9-3
Restart with Preset Device Configuration for the
CP 580 Basic Version ..........................................................................9-3
CP 580 Restart with Modified Device Configuration ............................9-4
Setting the Date and Time ..........................
.
.
..............................9-8
Data Handling Blocks ......................................................................9-9
Summary of DHBs with the CP 580 ..................................................... 9-9
9-11
DHB SYNCHRON ..............................................................................
DHB SEND ......................................................................................... 9-12
DHB SEND-DIRECT .........................................................................
9-12
9-13
DHB SEND-ALL .................................................................................
DHB FETCH.......................................................................................
9-14
9-15
DHB RECEIVE ...................................................................................
.................................. 9-15
DHB RECEIVE-DIRECT......................
.
.
9-16
DHB RECEIVE-ALL ...........................................................................
DHB CONTROL .................................................................................
9-17
DHB RESET .......................................................................................
9-18
.
.
.
........................................................
9-18
Status Word .....................
Q Siemens AG 1991 C79000-B8576-C2(-01
Contents
Parameter Assignment Error Bits ....................................................... 9-20
Process Data Acquisition ................................................................ 9-22
Parameters for the Configuration File (Process Data Acquisition) ..... 9-22
Error Messages of the CPIDHB Driver and the
CPRECORD Program........................................................................
9-26
.
.
........... 9-26
Error Messages of the CPIDHB Driver .........................
Error Messages of the CPRECORD Program................................... 9-27
Hotkeys for CPRECORD.................................................................
9-30
Mass Storage Functions
................................................................ 9-32
Data Handling Blocks for the Mass Storage Functions ......................9-32
9-33
Error Bits of CPMASS Program .........................................................
Command Interpreter
..................................................................... 9-35
Data Handling Blocks for the Command Interpreter...........................9-35
9-36
Error Bits of CPSHELL Program .....................................................
...................................................10-3
.
.
............10-4
Mechanical Construction of CP 580 ..............................
Reference Section for Hardware
Mechanical Construction of Basic Board.......................................... 10-6
Mechanical Construction of Expansion Board....................................10-8
Pin Assignments of Backplane Connectors ................................... 10-10
Controls and Displays .....................................................................
10-13
Switch and Jumper Settings on the Basic and Expansion Boards... 10-18
Switch and Jumper Settings on the Basic Board .............................10-18
.............................................................
Fixed Jumpers .............
.
.
10-22
Switch Settings on the Expansion Board .........................................10-23
O Siemens AG 1991 C79999-B8576-C2O4-01
Contents
CP 580 Drives ..................................................................................
10-25
Floppy Disk Drive ...........................
.
.
............................................
10-26
Hard Disk Drive .............................................................................. 10-26
Extension Using Device Options .............................................. 10-26
..............
.
................................................ 10-27
Connection of Devices
Connection of a Keyboard................................................................ 10-27
Connection of a Monitor ...................................................................
10-27
Connection of PT88NJPT89N. PT88SlPT89S Printers ....................10-28
Setting the Coding Switches on the Central Controller ....................10-28
Setting the Coding Switches on the Interface Adapter .....................10-29
Connection of PT10 Laser Printer ................................................... 10-34
Selection of Cable Connectors for the Printer Connection ............... 10-34
Connection of a Mouse ...................................................................10-37
Connector Interfaces of the CP 580
............................................. 10-38
Serial Interface COM 1 .....................................................................
10-39
Serial Interface COM 2 .....................................................................
10-40
Keyboard Interface KBD...................................................................
10-41
10-42
Serial Interface IF1 (COM 3) ........................................................
Serial Interface IF2 (COM 4) ...........................................................
10-43
Video Outputs........................
.
.....................................................
10-44
Memory Division and Hardware Interrupts of the CP 580
.......... 10-45
Memory Division .............................................................................
10-45
.
..........................................................
10-48
Hardware Interrupts..........
Conversion and Repairs
11
11.1
0 - 10
................................................................10-49
.........................
.
................................... 11-3
Devicespecific Data ........................................................................ 11-3
Technical Data of CP 580
O Siemens
AG 1991 C79000.08576.CM4.01
Contents
.................................................................................. 11-3
11.2
Power Supply
11.3
Current Consumption ....................................................................
11.4
Safety
11.5
11.6
11.7
11.8
11-3
................................................................................................. 11-4
Electromagnetic Compatibility (EMC) ............................................ 11-4
Climatic Conditions.......................................................................... 11-4
Mechanical Environmental Conditions ......................................... 11-5
Logic Parameters .............................................................................
11-5
Reference Literature
........................................................................
12-1
...........................
.
...................................................
13-1
..................................................................................................
13-3
Abbreviations
Index
Ordering Information
Q Siemens AG 1991 C79000-B8576-CX)4-01
....................................................................... 14-1
HOWto Use this Manual
How to Use this Manual
Safety information and ESD guidelines
This information on using the manual is preceded by the "Safety information" and
the "ESD (electrostatically sensitive devices) guidelines". These must be exactly
observed and followed whenever working with the CP 580.
README file
You can find information produced at a later date than the printing of this manual in
the README.TXT file in directory C:\CP580 on the hard disk of the CP 580. You
can read andfor print this file using any word processing program.
Scope and design of the Manual
The Manual describes the following versions of the CP 580 communications
processor:
6ES5 580-4UA11
6ES5 580-5UA11
6ES5 580-OUA11
6ES5 580-1UA11
6ES5 580-2UA11
6ES5 580-3UA11
2-Mbyte main memory, without coprocessor
2-Mbyte main memory, with coprocessor
4-Mbyte main memory, without coprocessor
4-Mbyte main memory, with coprocessor
8-Mbyte main memory, without coprocessor
8-Mbyte main memory, with coprocessor
How to
Use this Manual
The Manual is divided into two main parts:
Parts 1 to 8 describe in sequential order the work which you must carry out as
the user.
Parts 9 to 14 provide system information in compressed form and can be used
as a reference work by users with all stages of knowledge,
The Manual is thus suitable for first-time users and also as a reference work for
experienced users. You can ignore parts of the Manual depending on your
knowledge and the application, and concentrate on the relevant parts.
The contents of the individual parts are summarized below to help you to become
acquainted with the Manual:
Part 1
Part 2
Part 3
Part 4
Part 5
Part 6
The Introduction t o Application of the CP 580 describes the
facilities provided by the CP 580 and describes ranges of
application.
describes the scope of delivery of the CP 580. You are also
informed on all details of lnstallatlon and Commlssionlng of the
hardware and software and on the elimination of faults.
describes Operation of the CP 580 In the S5 Programmable
Controllers and informs you of the programmable controllers in
which you can use the CP 580 and with which applications
multi-processor operation is possible. You will learn how the S5
CPU and the CP 580 coordinate, and which CP 580 applications
can be executed simultaneously.
describes how you can transmit process data from the S5 CPU to
the CP 580 using the Process Data Acquisition function and
how to evaluate the data on the CP 580 using standard MS-DOS
programs.
describes how you can use the CP 580 as a storage medium for
S5 CPUs using the Mass Storage Functions.
describes how you can activate any MS-DOS commands on the
CP 580 from an S5 CPU using the Command Interpreter function.
O
Siemens AG 1991 C79000-68576-C2W-01
How to Use this Manual
Part 7
The Free Programming section describes how to use the system
functions of the CP 580 and the functions of the data handling
blocks and how to optimally adapt your programmable controller
system to the demands.
Part 8
describes use of the CP 580 by means of Application Examples
for the four following system functions: process data acquisition,
mass storage functions, command interpreter and free
programming.
Part 9
The Reference Section for System Software contains all
important information on the system software in a compressed
and tabular form. The SETUP routines for the CP 580, the design
and parameterization of the data handling blocks used for the CP
and the error bits of the system functions are described.
Part 10
The Reference Section for Hardware (device description)
contains all important information on the hardware components of
the CP 580. The function and meaning of the controls and
displays of the CP 580 are explained, and the switch and jumper
settings are described. The chapter also contains information on
the connection of peripheral devices and on the various interfaces.
lists the Technical Data of the CP 580. You will find data on e.g.
the current consumption, electromagnetic compatibility and the
climatic and mechanical environmental conditions.
contains a list of Reference Literature.
Part 11
Part 12
Part 13
Part 14
contains a List of Abbreviations and an Index.
contains Ordering Information for accessories and peripheral
devices
(state at time of printing of Manual).
Q Siemens AG 1991 C79009-98576-CX)4-01
Contents
Instructions
Contents, Page Overview
How to Use this Manual
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
7
Application Examples
8
Reference Section for System Software
9
Reference Section for Hardware
--
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
Contents
Contents
1
.
11
Introduction to Working with the CP 580
.........................................1-3
What is a CP 580 and What Facilities
Does it Provide You With?
..............................................................
1.2
What Applications are Possible for the CP 5801
1.3
What Tasks can the CP 580 Handle in an
Automation Network?
O Siemens AG 1991 C79000-88576-C2C4-01
1-3
............................ 1-4
........................................................................1-6
Contents
C3 Siemens AG 1991 C79990-B8576-C204-01
What is a CP 580 and What Facilities Does it Provide You With?
Introduction to Working with the CP 580
This section provides you with an initial overview of the CP 580 communications
processor. You will learn:
what a CP 580 is, and what facilities it provides you with,
what applications are possible for the CP 580,
what tasks the CP 580 handles in an automation network.
1.l
What is a CP 580 and What Facilities Does it Provide You
With?
The CP 580 communications processor is an AT computer compatible with the
industrial standard. It is fitted in your programmable controller subrack. It provides
you with additional computing performance in conjunction with the S5 CPU in order
to solve your automation task. Direct communication with the S5 CPU via the
internal S5 backplane bus enables effective data transfer between the S5 CPU and
the CP 580. To enable a meaningful distribution of tasks between the components
of the programmable controlier, the S5 CPU is assigned execution of the control
tasks, whereas the CP 580 handles the aquisition, storage, management and
conditioning of larger quantities of data. Standard MS-DOS user programs can be
used for these functions of the communications processor. The installed software
comprises the MS-DOS 3.3 operating system and a number of utilities specific to
the CP 580 for communication between the MS-DOS and S5 environments.
Q Siemens AG 1991 C79900-BB576-C204-01
What Applications are Possible for the CP 580?
1.2
What Applications are Possible for the CP 580?
The possible applications of the CP 580 can be divided into the four system
functions:
Process data aquisition
Mass storage functions
Command interpreter
Free programming.
Examples of applications of the process data aquisition function:
Recording of process data and subsequent processing using standard MS-DOS
programs
- to evaluate and analyze the process
- for central management of process data
- for long-term quality monitoring
- for statistics (data compression, short-term storage, quality assurance,
optimization)
m
Evaluation of measured data in conjunction with a modular message printing
system:
- for continuous monitoring of binary process signals
- for monitoring of process operations
- to unload the CPU of the programmable controller system in the case of
comprehensive logging operations
Handling of data management for all programmable controllers in networked
systems:
- to unload the user memory on the S5 CPU
O Siemens AG 1991 C79900-B8576-C204-01
What Applications are Possible for the CP 580?
haass storage functions
Examples of applications of the mass storage functions:
Transfer of larger quantities of process data
to unload the user memory on the S5 CPU
-
Buffering of process data should the next higher computer level fail
- to prevent data losses
Recipe management in weighing and dosing systems (quantity control)
to transfer recipes which are not currently required to the memory of the CP
580
-
Command Interpreter
Examples of applications of the command interpreter function:
Calling of MS-DOS commands from the S5 CPU
- to activate programs for execution on the CP 580
Printing of S5 CPU messages on a message printer
- for storage of status and error messages
Free programming
Examples of applications of the free programming function:
Use of self-generated applications
for optimum adaptation of your programmable controller system to the tasks
for adaptation of existing programs to communication via the S5 backplane
bus
- to implement the cell level of a manufacturing system according to Fig. 1. l .
-
Q Siemens AG 1991 C79000-B8576-C294-01
What Tasks can the CP 580 Handle in an Automation Network?
1.3
What Tasks can the CP 580 Handle in an Automation Network?
The CP 580 as a computer local to the process can establish connections between
the process, i.e. the manufacturing operations, on the one hand and the computers
of the coordinating and planning levels, i.e. the management, on the other.
Fig. 1.l shows a possible task of the CP 580 in the automation pyramid.
Planning level
Plan jobs
Generation of production guidelines
Monitoring of information from
production sequence
----
Coordinating level
Decisions on production
Coordination of function groups
Analysis of resources
Distribution of jobs to manufacturing station
Monitoring of execution
Transfer of processing status
to coordinating level
Formulation of tasks for manufacturing
Coordination and monitoring
of activities
Fig. 1.1
The CP 580 communications processor in the automation pyramid
O Siemens AG 1991 C79000-B8576-C204-01
Contents
Instructions
Contents, Pa e Overview
How to Use t is Manual
i:
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
Application Examples
8
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
Reference Literature
12
Abbreviations
index
Ordering Information
14
Contents
Contents
.
.
.....................................2-3
2
Installation and Commissioning.................
2.1
Unpacking and Checking the Delivered Components ....................... 2-3
2.1 .1
2.1.2
2.1.3
Standard Scope of Delivery .....................................................................
2-3
2-5
Environmental Conditions for the CP 580 ...........................................
2-6
Connectable Peripheral Devices ..............................................................
2.2
Installation and Commissioning of Hardware
..................
.................2-7
Check List for Installation and Commissioning........................................2-7
2-8
Switch and Jumper Settings on the CP 580 ...........................................
Setting of the Base Interface Number (Module Address) ........................2-9
Checking the Coding Switch and
Jumper Settings on the Basic Board ....................................................
2-12
Checking the Switch Settings on the Expansion Board ........................2-14
Fixed Jumpers ........................................................................................
2-14
Installation of CP 580 into Subrack .....................................................
2-15
Interference-free Hardware Configuration...........................................
2-15
Usable Slots for the CP 580 in the Programmable Controller .............. 2-18
Switching Off the Power Supply of the PLC Rack ................................2-21
Installation of CP 580 into PLC Rack .....................
.
.................... 2-21
Connection of Keyboard. Monitor. Printer and Mouse ..........................2-22
2-24
Connection of PG 750 Keyboard...........................................................
2-24
Connection of Monitor ............................................................................
Connection of Logging Printer ............................................................
2-27
Connection of a Mouse ..........................................................................
2-28
Maximum Cable Lengths for Connection
of Operation Devices and Peripheral Devices....................................
2-28
Setting the RUNISTOP Switch ............................................................2-29
Check List Before Switching On the Power Supply ..............................2-29
Switching On Peripheral Devices .....................................
..................2-29
2-29
Switching On the Power Supply to the PLC Rack ................................
O Siemens AG 1991 C79099-08576-C292-01
Contents
Software Commissioning
...................................................................
2-30
Procedure when Switching On for the First Time ..................................2-30
Start-up with Default SETUP for the CP 580 Basic Version .................2-30
.................................................. 2-31
Normal Restart of CP 580 ..................
......
...............................2-31
Making Back-up Diskettes ........................
Setting the Hardware Clock of the CP 580 ........................................ 2-32
Possible Faults and Their Elimination
............................................. 2-32
The RUN LED does not go to RUN ...................................................... 2-32
The STOP and FAULT LEDs do not go Off .......................................... 2-33
Displays on Diagnostic Panel (DIAG) .................................................... 2-33
O Siemens AG 1991 C79000-B6576.CX)4-01
Unpacking and Checking the Delivered Components
Installation and Commissioning
2
This chapter describes the installation and commissioning of the CP 580.
Please also observe the installation guidelines described in this chapter.
2.1
Unpacking and Checking the Delivered Components
l . Unpack the CP 580.
2. Retain the original packing material for subsequent transport.
+
The CP 580 is equipped with a disk drive which is sensitive to shock
and vibration. Please remember this when handling the system.
Only transport the CP 580 in its original packing material!
Standard Scope of Dellvery
2.1 .1
Check the scope of delivery!
On delivery the CP 580 includes:
- CP 580: hardwarelsoftware (you can only check the installed software if
-
you connect a keyboard and monitor)
Pocket Guide for MS-DOS
Manual (please refer to the language-specific Order Nos., see also Chapter 14, Ordering Information).
Check that the Order No. printed on your CP 580 agrees with the configuration you
ordered.
O Siemens AG 1991 C79000-08576-Cm-01
Unpacking and Checking the Delivered Components
CP 580 configurations:
6ES5 580-4UA11
6ES5 580-5UA11
6ES5 580-OUA11
6ES5 580-1UA11
6ES5 580-2UA11
6ES5 580-3UA11
2-Mbyte DRAM, without coprocessor
2-Mbyte DRAM, with coprocessor
4-Mbyte DRAM, without coprocessor
4-Mbyte DRAM, with coprocessor
8-Mbyte DRAM, without coprocessor
8-Mbyte DRAM, with coprocessor
To run up the CP 580 you also need:
A monitor with
-
Cable connector for the monitor
lnstructions for the monitor
A PG 750 keyboard or a PC keyboard with equivalent functions with
+
-
Instructions for the keyboard
You do not require a keyboard or monitor for operation if you only wish
to carry out the mass storage functions with the CP 580.
Note, however, that a keyboard and monitor are useful for
commissioning of the mass storage functions.
Unpacking and Checking the Delivered Components
--
2.1.2
Environmental Conditions for the CP 580
The environmental conditions and technical data applicable to the CP 580 are listed
in Chapter 11, Technical Data.
c3
It is essential to observe the current consumption of the CP 580 in
Chapter 11. This must be observed when equipping the
programmable controller!
"Ot'
1
O Siemens AG 1991 C79009-BB576-C204-01
Unpacking and Checking the Delivered Components
Connectable Peripheral Devices
2.1.3
Fig. 2.1 shows an example of the designs possible with the CP 580 and peripheral
devices.
Programmable controller
/
Monitor
\
H
PT88lS printer
PG 750 keyboard
Fig. 2.1
2-6
PG 750 mouse
Design with PG 750 keyboard, monitor, printer and mouse
Q Siemens AG 1991 C79000-B8576-C204-01
Installation and Commissionina of Hardware
2.2
Installation and Commissioning of Hardware
2.2.1
Check List for lnstallation and Comrnissionlng
This section explains the procedure for installing and setting up the CP 580
step-by-step. Please proceed as described below.
The check list provides a summary of the individual steps.
1.
Is the power supply unit in your subrack correctly dimensioned?
2.
Check the jumper assignments and switch settings on the basic board
and expansion board.
3.
Switch off the power supply to your programmable controller rack and
insert the board into the provided slot.
4.
Check the position of the mode switch. The switch must be in the RUN
position if you want to exchange data with the programmable controller.
5.
Connect the required operation devices and peripheral devices
6.
Switch the peripheral devices on.
7.
Switch the power supply to your programmable controller rack on again.
8.
Startup the software.
O
Siemens AG 1991 C79000-B8576-C204-01
Installation and Commissioning of Hardware
2.2.2
Switch and Jumper Settings on the CP 580
Before switching on for the first time, you must set or check the switch and jumper
settings described below according to the requirements in order to ensure correct
operation with the CP 580. You must carry out the following two steps:
1.
Set the base interface number on the basic board
2.
Check the other coding switches and plug-in jumpers on the basic and
expansion boards
Position of switches
Basic board
Expans~onboard
Fig. 2.2
Arrangement of basic and expansion boards and position of switches and jumpers on the
CP 580
O Siemens AG 1991 C79000-B8576-C2W-01
installation and Commissioning of Hardware
The coding switches and plug-in jumpers are located along the top edge of the basic
board. Fig. 2.3 can be used to set the base interface number and to check the other
coding switches and jumpers.
,
Base window
Interface number (0 set here)
(
Used Internally (must be
U110 *OFFt)
Jumper always inserted
Interprocessor
communication Rags
l
Top edge of PC6
Front panel
Page addressing
OFF means away from the PCB.
88
OFF ON
Fig. 2.3
Position of coding switches and jumpers on the basic module
2.2.2.1
Setting of the Base Interface Number (Module Address)
You must assign a base interface number to the CP 580. This corresponds to the
setting of the module address with other S5 modules.
Q Siemens AG 1991 C79999-B857&C294-01
Installation and Commissioning of Hardware
Meaning of base interface number:
Data transfer for the CP 580 takes place via the page area of the dual-port RAM. The
CP 580 has 4 pages, each with a l-kbyte memory. The 4 pages are assigned 4
successive interface numbers, where the first number is the base interface number.
The base interface number can be from 0 to 252.
A differentiation is always possible between single processor and multi-processor
operation.
Single processor operation:
-
Only one page is available to you in single processor operation.
Multi-processor operation:
-
Up to 4 CPUs can be plugged into the programmable controller in multiprocessor operation of the S5-135U and S5-155U programmable controllers. Each CPU is assigned a page for data transfer with the CP 580.
There is a fixed assignment between the CPU number and the interface number.
CPU number
CPU 1
CPU 2
CPU 3
CPU 4
I
CP interface number
Base interface number
Base interface number +l
Base interface number +2
Base interface number +3
O Siemens AG 1991 C79000-B8576-C294-01
lnstallation and Commissioning of Hardware
Setting the base interface number:
You define the base interface number by setting a number from 0 to 252 using coding
switch assembly 1 (see Fig. 2.3). The next three interface numbers are assigned
automatically. You must define the base interface number both for multi-processor
and single processor operation. Only one page can be assigned to each CPU.
The interface number must be dividable by 4 and set as a binary value. The
arrrangement of the switches on assembly 1 makes it impossible, however, for you to
set a non-permissible base interface number.
To enable the CPU to address the CP 580 correctly, you must define the same
interface number (parameter SSNR) when parameterizing the data handling blocks
as that set on the CP 580.
When using several CP 580 modules in one programmable controller, ensure that the
interface numbers are not assigned more than once.
Significance of the individual coding switches:
Switch set to OFF means valid (significance 1)
Switch set to ON means not valid (significance 0)
Switches 7 and 8 have no significance with respect to setting of the interface number.
Q Siemens AG 1991 C79999-B8576-C294-01
Installation and Commissioning of Hardware
Example: setting of the base interface number:
Used internally (must be set to OFF)
Significance:
7 6 5 4 3 2
2 2 2 2 2 2
OFF means away from the PCB.
Switch assembly 1
OFF = significance 1
OFF
Equation:
SSNR=n
X
Example:
SSNR=O
x 2 +O
7
2 +n
5
6
X
2 +n
X
2 +O
7
4
ON
2
3
X
2 +n
X
2 + O x 2 + lX 2 + lX 2 = l 2
5
6
X
2 +n
4
X
2 +n
3
X
2
2
Base interface number = 12; interface numbers (SSNR) 12,13,14,15 are assigned
Switches 7 and 8 of assembly 1 are used internally and must
always be set to OFF!
Fig. 2.4
Example of base interface number 12
2.2.2.2
Checking the Coding Switch and Jumper Settings on the Basic
Board
In the case of the other coding switches and jumpers on the basic board, you need
only check the factory-set switch and jumper settings.
Enabling or disabling of the interprocessor communication flags
A!I interprocessor communication flags are disabled in the factory setting
since the supplied software of the CP 580 does not currently use
communication flags. Check that all coding switches are set to OFF (see
Fig. 2.3, switch assembly 3).
Q Siemens AG 1991
C79999-B8576-C294-01
Installation and Commissioning of Hardware
Note
3
The interprocessor communication flag area comprises 256
communication flag bytes (= 2048 communication flags). The
communication flags are transferred cyclically between the CPU and
the communications processors (CP) and c a n be used for
coordination.
If you w i s h to address c o m m u n i c a t i o n f l a g s u s i n g " F r e e
programming", please read Section 10.151.3.
This section informs you on division of the communication flag areas
using switch assembly 3.
Checking the base window address
The data handling blocks supplied by Siemens are matched to the
specified delivery state. The factory settings must not be changed.
Check the settings of the coding switches as shown in Fig. 2.3 (switch
assembly 2).
Switching between page addressing and linear addressing
This jumper must always be inserted (see Fig. 2.3) when using the data
handling blocks since these blocks do not support linear addressing.
Q Siemens AG 1991 C79000-08576-C204-01
Installation and Cornmissionina of Hardware
2.2.2.3
Checking the Switch Settings on the Expansion Board
The coding switches are already factory-set for normal operation and must not be
changed.
Check the setting of the coding switch as shown in Fig. 2.5.
Must be set
Backplane connector 1
OFF means away from the PCB.
The switches are factory-set as shown above.
Fig. 2.5
Position of coding switch on the expansion board
2.2.2.4
Fixed Jumpers
OFF ON
All plug-in jumpers are Inserted when the CP 580 is delivered and must not be
changed.
The basic and expansion boards contain a number of plug-in jumpers
which are only used for diagnostic purposes in a test bay.
O Siemens AG 1991 C79000-B8576-C204-01
lnstallation and Commissioning of Hardware
2.2.3
lnstallation of CP 580 into Subrack
A
Caution
If you work on the system with the cabinet open, observe the
guidelines for the protection of electrostatically sensitive devices
(ESD)!
Note that the CP 580 is inserted into different slots in the various programmable
controllers (see Section 2.2.3.2).
2.2.3.1
Interferencefree Hardware Configuration
Note
To ensure interference-free operation, observe the shielding
measures and installation guidelines included in the respective CPU
manuals (see Reference Literature).
Keep any interfering signals resulting from the process as far away as possible from
the installation.
The following cases can be considered:
-
New installation of an S5 cabinet with a CP 580
- Extension of an already existing S5 cabinet by a CP 580.
In both cases we assume you have observed the installation guidelines. The following
pages summarize some of the important points of the "Installation guidelines for
SlMATlC S5".
O Siemens AG 1991 C79000.B8576-C2W-01
Installation and Commissionina of Hardware
Metal cabinet
CP 580
All cables routed along
Outer cable screen
1
I
Screen connected
l
Grounding rail
Printer
l
L
Legend:
Fig. 2.6
:
1 /
3
/
1
\
Outer cable screen
connected
Large-area ground connection (S5 rack, Cu strip)
Cabinet design
Q
Siemens
AG 1991 C79000-06576-Cm-01
lnstallation and Commissioning of Hardware
The following can be seen in Fig. 2.6:
Devices which could carry noise signals from outside into the cabinet assembly
should be fitted as near to the bottom of the cabinet as possible.
Fit the grounding rails directly at the cabinet inlet so that cables carrying noise
signals (e.g. monitor cables and the power supply cable for the printer) are
connected directly before they bring noise signals into the cabinet. Connect all
cables screened to this point (except coaxial cables with one screen). Only
connect the outer screen in the case of signal cables with two screens. (In the
case of a "free design" connect the cable screens close to the subrack.)
Always route signal cables along the cabinet walls.
Route power supply and signal cables separately.
Ensure that all ground connections in the cabinet are made with a large-area
contact.
Connect doors and cabinet walls to the grounded housing support.
Use separate cable racks for power and signal cables and position them at least
0.5 m apart.
Ensure when fitting a [email protected]') system in an 8MF cabinet that the cabinet is
grounded.
Relays and contactors should be interference-suppressed on site.
Ensure that the differences in potential between various system components are
as small as possible.
Note when fitting analog modules in the system that their ground must only be
connected once to the central reference point. It is essential to avoid multiple
connections to other grounded system parts.
1) S I M A T I C ~is referred to below as SIMATIC.
O Siemens
AG 1991 C79000-58576-Cm-01
Installation and Commissioning of Hardware
in the case of systems which generate a high electrostatic voltage (e.g. textile
machines, special napping machines), connect the ground lines of the machine
components subject to interfering signals to a separate signal ground (large-area
ground contact with building construction, armoring) which is isolated from the
central grounding point of the S5 cabinet.
2.2.3.2
Usable Slots for the CP 580 in the Programmable Controller
You can use the CP 580 in the S5-115U, S5-135U and S5-155U programmable
controllers.
The CP 580 occupies 4 slots of a subrack in the S5-135U and S5-155U. The adapter
casing occupies 2 slots in the S5-115U.
Observe the following requirements for installation:
-
You require an adapter casing for pivoted mounting with 4 slots (see Ordering
Information, Chapter 14).
- A fan subassembly is essential (see Ordering Information, Chapter 14).
- Use a 5 V115 A power supply.
Locations for the approved subracks:
Subrack
Possible locations
CR 700-OLB
(for central controllers)
1-2
CR 700-3
(for central controllers)
1-2
O Siemens AG 1991 C79000-68576.C2W-01
Installation and Commissioning of Hardware
Note that you cannot use the CP 580 together with the CPU 921 (S processor) since
this CPU is not enabled in conjunction with the CP 580.
Slots in the approved subracks:
6ES51353KA41
1I
1111Im
1 m m m / m I I I I I m m /
6 E S 5 1 3 5 3 U A 2 1 ~ ~I ~
6ES51353UA11
6ES5i353UA31
IIIIII~I!~
I
Ij1111
6ES51353UM'
I I 1 1 1 1 m 1 ~ m I I 1 1 m I
m I I m I I m I 1 m m
6ES51353UA51
i%z'EL
PGMUX
funcban
Interrupt
g m m
I
1 1 I m m I I 1 mmmmmmmm
The special PG-MUX and interrupt generation functions cannot be used at a slot
occupied or covered by a CP 580. Please observe the above assignments if you wish
to use one of these two special functions of the S5-135U.
O Siemens AG 1991 C79009-B8576-CX)4-01
installation and Commissioning of Hardware
S5-155U:
Slots in the approved subracks:
[ Slot No.
,(
19 ( 2 7 ( 3 5 ( 4 3 151 ( 5 9 1 67175 183 191 ( 9 9 (107(115(123(131/139]
Expansion units for S5-115UlS5-135UlS5-155U
Observe the following requirements for installation:
- A power supply with fan is essential.
Slots in the approved subracks:
(Each EG-185U expansion unit with the IM 3041314 or 3071317 interface modules)
O Siemens
AG 1991 C79MX)-B8576-CX4.01
Installation and Commissioning of Hardware
2.2.3.3
Switching Off the Power Supply of the PLC Rack
A
2.2.3.4
Caution
The CP 580 must not be inserted or removed with the power supply
switched on. It is therefore essential for you to switch off the power
supply for the PLC rack before inserting the CP 580 into the
programmable controller.
Installation of CP 580 into PLC Rack
Now insert the CP 580 into your PLC rack. Observe the permissible slots of the
various programmable controllers (Section 2.2.3.2).
Be careful to hold the module straight and not to bend the contact springs of the
guides in the subrack.
Lock the CP 580 in the subrack.
+
The floppy disk drive does not require transport protection if you wish
to remove the CP 580 again.
The hard disk drive automatically moves into the transport position
when switched off. It is not necessary to park the hard disk drive.
Q Siemens AG 1991 C79909-08576-Cm-01
Installation and Commissioning of Hardware
2.2.4
Connection of Keyboard, Monitor, Printer and
Mouse
The connections for the operation devices and peripheral devices are on the front
panel of the CP 580.
I
ORuN
*:
HD-Busv
1
. . . . . . . STOP
@RUN
interface
@STOP
Faun
@
DlAG
RESET
a
interface
Lvm .
I
VIDEO: RGB connection for monitor
\
COM2: V.24 interface
for mouse
I
IKEYBOARD
I
Fig. 2.7
I
Location of interfaces on front panel of CP 580
O Siemens AG 1991 C79000-88576-C2W-01
Installation and Commissioning of Hardware
You can recognize the following interfaces in Fig. 2.7:
- COM 1:
V.24/lTY interface for logging printer
- COM 2:
V.24 interface for mouse, if required
-
KBD:
Interface for standard keyboard
-
VIDEO:
RGB connection for monitor
-
IF1 (COM 3): TTY interface for optional use
-
IF2 (COM 4): X.27 (RS 422) interface for optional use
A keyboard and monitor are required to use the CP 580. You can additionally connect
a logging printer and a mouse.
Section 10.2, Reference Section for Hardware, shows which devices you can
connect.
When connecting the peripheral devices, we recommend that you use the standard
cable connectors provided by Siemens for reasons of interference resistance within
the complete system.
A
Caution
Important note when routing connection cables for peripheral devices:
Monitor cables and connection cables between the CP 580 and the
PG 750 keyboardlprinter must not be routed parallel to power cables!
Route them on their own cable rack positioned at least 50 cm away
from power cables.
O
Siemens AG 1991 C79900-B8576-CX)4-01
Installation and Commissioning of Hardware
2.2.4.1
Connection of PG 750 Keyboard
Connect the PG 750 keyboard to the keyboard interface KBD.
2.2.4.2
Connection of Monitor
Connect the monitor to the CP 580 via the VIDEO (RGB) interface.
Note the following points:
You must only use double-screened coaxial cables (triax cables) if the
environment is not conducive to EMC (see Chapter 14, Ordering Information).
You can use these cables up to a length of 50 m without further measures.
When using triax cables, only connect the outer screen of the monitor cable to
the housing potential of the process monitor (see Fig. 2.8).
Make large-area metal-metal connections.
Isolate the electronics ground of the monitor (see Fig. 2.8) from the housing
ground. The separation has already been made in the Siemens multistandard
color monitor 6AV1414-OAA00 listed in Chapter 14.
Connect the monitor and the programmable controller to the same phase.
Different ground potentials between the rack and the monitor housing may lead
to picture hum (horizontal dark bars). For this reason and for protection against
accidental contact, connect an equipotential bonding conductor between the S5
cabinet and the monitor housing. The equipotential bonding conductor must be
dimensioned by carrying out measurements on the system such that a difference
in potential of 200 mV is not exceeded.
O Siemens AG 1991 C79999-B8576-CX)4-01
Installation and Commissioning of Hardware
--
Information o n posltioning of monitors
-
When positioning monitors ensure that the distance between two monitors in the
case of asynchronous operation is at least 15 cm since picture interferences
could otherwise occur.
Exception: monitors with mu-metal screening
The monitor and external magnetic sources should be sufficiently far apart.
Do not place the monitors in steel racks or on steel desks. Magnetization of the
surrounding sheet-steel panels may lead to color or picture distortions.
Do not install monitors in the vicinity of transformers, walkie-talkies, loudspeaker
magnets and power cables.
External magnetic fields can be suppressed by using mu-metal screening.
O Siemens AG 1991 C79000-B8576-C%X-01
Installation and Commissioninq of Hardware
Programm
\
I I
3
Outer screen to ground
Ground bar
Protection against accidental contact,
equipotential bonding conductor
Cable clamp
Jumper between 0 V and ground in the monitor
must be separated
Fig. 2.8
Cable connection to grounding rails
O Siemens AG 1991 C79000-88576-C204.01
lnstallation and Commissioning of Hardware
Special conditions when using office monitors
You must not use office monitors with a plastic housing metal-coated on the
inside in environments not conducive to EMC since the internal metal surface
cannot be connected to the external grounding rail at a later date. The separation
between the electronics ground and the housing ground of the monitors which is
essential for environmental conditions not conducive to EMC is not possible with
most off ice monitors.
You can only use such office monitors together with single-screened coaxial
cables. Connection to the CP 580 is thus only possible to a limited extent since
only short distances can be covered using these cables.
2.2.4.3
Connection of Logging Printer
Connect a logging printer to the serial interface COM 1. Printers with V.24 or
TTY interface adapters can be used.
The PT88NlPT89N or PT88SlPT89S printers are recommended and can be
connected via a V.24 or l T Y interface adapter to the CP 580.
Section 10.2.3, Reference Section for Hardware, shows you the coding switch
settings and the interface adaptation for the PT88NlPT89N and PT88SlPT89S.
Only cables with the screen grounded at both ends may be used between the
CP 580 and printers.
The standard cables listed in Chapter 14, Ordering Information, satisfy these
requirements.
O Siemens AG 1991 C79000-88576.C204-01
Installation and Commissioning of Hardware
2.2.4.4
Connection of a Mouse
The CP 580 software supplied does not use a mouse!
It may be useful to connect a mouse in order to use additional software on the CP
580.
Connect the mouse to the CP 580 in the following manner:
Connect any mouse to the serial interface COM 2 on the front panel.
Connect the PG 750 mouse to the mouse plug fitted on the side of the PG 750
keyboard and the COM 2 interface on the front panel.
You must only use one of the two interfaces, since the COM 2 interface Is also
occupied when the PG 750 keyboard is connected!
2.2.4.5
Maximum Cable Lengths for Connection of Operation Devices and
Peripheral Devices
The following table lists the limits for the cable length between the devices. A
prerequisite is an interference-resistant hardware design as described in Section
2.2.3.1.
Table 2.1
2 - 28
Maximum cable lengths for operation devices and peripheral devices
Q Siemens AG
1991 C79000-88576-C2C4.01
Installation and Commissioning of Hardware
2.2.5
Setting the RUNISTOP Switch
Set the RUN/STOP switch to "RUN".
2.2.6
Check List Before Switchlng On the Power Supply
Is the power supply in your subrack correctly dimensioned (Section 2.1.2)?
Have you considered the environmental conditions for the CP 580 and
connected peripheral devices?
Have you made the coding switch and jumper settings on the CP 580 and
peripheral devices?
Is the CP 580 inserted into an approved location in the subrack?
Are the peripheral devices connected correctly?
Have you connected all the cable screens correctly?
Have you installed the monitor correctly and considered the electromagnetic
environmental conditions?
Have you observed the S5 installation guidelines for programmable controllers?
2.2.7
Switchlng On Peripheral Devices
Now switch on the monitor and logging printer.
2.2.8
Switching On the Power Supply to the PLC Rack
Now switch on the power supply for the programmable controller rack.
The operating system is automatically booted when the power supply is switched on.
Hardware commissioning for the CP 580 is now finished.
Please read further in Section 2.3 "Software Commissioning"
O Siemens AG 1991 C79090-B6576-C204-01
Software Commissioning
2.3
Software Commissioning
2.3.1
Procedure when Switching On for the First Tlme
The CP 580 runs up when you switch on the programmable controller.
The RUN and STOP displays on the front panel of the CP 580 light up permanently.
The operation displays on the floppy disk drive, the hard disk drive, and the floppy
disk drive again light up in succession.
The LEDs on the NUM LOCK and SCROLL LOCK keys light up briefly on the
connected PG 750 keyboard.
The following message appears on the screen:
"CP 580 BlOS Version X.XW
The operation display on the hard disk drive now lights up with each access.
2.3.2
Start-up with Default SETUP for the CP 580 Basic Version
The CP 580 runs up in the basic configuration without a manual SETUP.
The RUN, STOP and FAULT displays are deleted when the CPIDHB driver is called.
The RUN display only lights up if the RUNISTOP switch is set to RUN and at least
one page is synchronized.
When delivered, the hard disk contains the MS-DOS operating system, the CP 580
software (CPIDHB driver, program package "File functions") and the
AUTOEXEC.BAT file.
The AUTOEXEC.BAT file is set such that the mass storage functions and the
command interpreter are available following correct running-up.
O Siemens AG 1991 C79000-B8576-C201.01
Software Commissioning
To activate and test CPMASS, CPRECORD and CPSHELL, please read:
- Section 4.3.4 for process data aquisition (CPRECORD)
- Section 5.3.4 for the mass storage functions (CPMASS)
-
Section 6.3.6 for the command interpreter (CPSHELL).
2.3.3
Normal Restart of CP 580
A normal restart is always carried out when you switch off the operating voltage to
your PLC and then on again, if the CP 580 is ready, and if the device configuration
preset in the software has been retained in the RAM as a result of the battery
back-up.
2.3.4
Making Back-up Diskettes
Once the CP 580 has run-up successfully, it is essential for you to make a back-up
copy of the software installed on the GP 580.
A batch file is available for saving the software.
By saving you produce a back-up floppy.
Proceed as follows:
If you have started the command interpreter, terminate CPSHELL by pressing
the key
Format a 3 112-inch HD floppy disk by entering the command FORMAT A:/S
Then enter SAVE580.BAT on the keyboard.
The screen outputs prompts for the operator which explain the further steps.
Q Siemens AG 1991 C79000-B8576-CX)d-01
Possible Faults and Their Elimination
2.3.5
Setting the Hardware Clock of the CP 580
The hardware clock of the CP 580 is set using the installed SETUP.
Activate the SETUP program by pressing the keys
[ X and
) [F]
and [S
or )
[y]
and then set the time.
The CP 580 SETUP is menu-controlled and you need not make any settings apart
from the time and date.
For more information see Section 9.1.
Software commissioning of the CP 580 has now been terminated.
2.4
Possible Faults and Their Elimination
2.4.1
The RUN LED does not go to RUN
The cause may be one of the following:
A page has not been synchronized.
The CPIDHB driver was not called correctly.
The RUNISTOP switch is not set to RUN.
Possible Faults and Their Eliniination
2.4.2
The STOP and FAULT LEDs do not go Off
If these LEDs go off this indicates that the CPIDHB driver has been installed in the
main memory of the CP 580.
Proceed as follows if these LEDs have not gone off:
Check whether the CPtDHB driver is called in the AUTOEXEC.BAT file.
Check that all cables are connected correctly.
Is the power supply for the complete subrack correctly dimensioned? Check the
voltages (mains power supply as well as 5 V, 24 V in the subrack).
Replace the power supply in the programmable controller by another unit.
2.4.3
Displays on Diagnostic Panel (DIAG)
The BlOS carries out a power-on selftest when the CP 580 is switched on. The LEDs
on the diagnostic panel light up as shown in Fig. 2.9 if the CP 580 runs up without
faults.
Table 10.5 in Section 10.1.4 explains the error codes of the diagnostic panel and the
significance of the LEDs.
Check the display on the diagnostic panel; it must be as follows when operation is
fault-free:
Fig. 2.9
Display on diagnostic panel following fault-free running-up of CP 580
O Siemens AG 1991 C79000-08576-C204.01
Contents
Instructions
Contents, Page Overview
How to Use this Manual
C79000-88576-C204
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
7
-
-
Application Examples
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
Contents
Contents
Operation of CP 580 In S5 Programmable Controllers ........................ 3-3
Programmable Controllers for CP 580 ..................................................3-3
Single Processor and Multi-processor Operation ......................................
3-4
Operational Components........................................................................3-5
S5 Backplane Bus and Pages ................................................................... 3-5
Data Handling Blocks ....................
.
......................................................
3-6
CPIDHB Driver ..........................................................................................
3-6
Principle Interaction Between CPU and CP 580 ...................................3-7
Synchronize CP 580 with CPU ................................................................ 3-7
Call CPIDHB Driver for Special Application ..............................................
3-7
3-8
Carry Out Data Transfer ............................................................................
Simultaneous Operation of CP 580 Applications ...............................3-10
Q Siemens AG 1991 C79000-B8576-CX4-01
Contents
Proarammable Controllers for CP 580
3
Operation of CP 580 in S5 Programmable
Controllers
This chapter tells you which S5 programmable controllers you can use the CP 580 in,
and with which applications multi-processor operation is possible (Section 3.1). This
section also tells you which resources on the CP 580 and programmable controller
CPUs are used for data transfer between the CPU and CP (Section 3.2) as well as
how the CPU and CP 580 basically interact (Section 3.3).
The end of this chapter provides you with some information on the simultaneous use
of CP 580 applications.
Programmable Controllers for CP 580
3.1
You can operate the CP 580 with the following S5 programmable controllers and S5
CPUs:
Table 3.1
Programmable controllers and CPUs for operation with the CP 580
CPU 928
No
Yes
Yes
CPU 9288
No
Yes
Yes
CPU 9461947
No
No
Yes
Proarammable Controllers for CP 580
Data can be transferred between the CP 580 and a CPU which is plugged into the
same programmable controller as the CP 580 by means of the connection to the S5
backplane bus of the programmable controller. In addition to application-dependent
settings on the CP, you must always adapt your [email protected] programs on the CPU for
the planned data transfer. You should have experience in programming S5 programmable controllers before carrying this out.
3.1 .l
Single Processor and Multi-processor Operation
The CP 580 enables data transfer with up to four CPUs on the same programmable
controller. Whether several CPUs can be inserted depends on the type of
programmable controller, however.
Whether multi-processor operation is possible with the CP 580 depends on the
application. In addition to true multi-processor operation, there is a mixed form of
single processor and multi-processor operation where the partner CPU can be
changed occasionally by measures on the CP 580.
The various operating modes can be used for the applications as follows:
Single processor operation (data transfer with one CPU):
all applications.
Mixed operation (data transfer alternately with one of up to four CPUs):
process data aquisition, free programming.
Multi-processor operation (data transfer simultaneously with up to four CPUs):
mass storage function, command interpreter and free programming.
Note
It may be necessary to take coordination measures on the associated
CPUs for multi-processor operation. Please refer to the description of
your programmable controller for the means with which you can carry
out coordination (e.g. using interprocessor communication flags or
semaphores).
Q Siemens AG 1991 C79000-BB576-C204.01
Operational Components
3.2
Operational Components
Special hardware and software components are available for data transfer batween
the CP 580 and one or more CPUs:
S5 backplane bus
Pages, dual-port RAM
Data handling blocks (DHB)
CPIDHB driver.
3.2.1
S5 Backplane Bus and Pages
Data transfer between a CPU and the CP 580 or also the process peripherals is via
the S5 bus. The S5 bus is assigned a specific address area as far as the CPU is
concerned (see Fig. 3.1).
I
Normal I10 area
FOoo
F100
Digital and analog
F200
F300
F400
F800
FCOO
.... . . . '
FFFF
Fig. 3.1
System area
................. . . . . . . . . . . .
Division of address area on S5 bus
Q Siemens AG 1991 C79000-B8576-C204-01
Vector registers
I
Operational Components
Part of this area is reserved for the so-called "pages". A page has an address area of
1024 bytes. This address area can be addressed several times using the page
number (selection via vector registers):there is a total of 256 pages with the numbers
0 to 255.
Four pages with consecutive numbers are defined for the data transfer with the CP
580. This is carried out by setting the base interface number (see Section 2.2.2.1).
These four pages are located physically in succession in the dual-port RAM on the
CP 580 module. Each of the four pages is assigned to a CPU. If less than 4 CPUs
are inserted into the programmable controller, correspondingly fewer pages are used.
3.2.2
Data Handling Blocks
Data transfer is controlled on the CPUs by the so-called data handling blocks (DHB).
These are special function blocks which are called by the [email protected] program') for the
desired data transfer and which handle the transfer via one of the pages.
+
3.2.3
The data handling blocks have different numbers (FB numbers) for the
various programmable controllers. The numbers of the DHBs required
in each case are listed in the application-specific chapters (Chapters 4
to 7). You can find a complete summary of the DHBs in Chapter 9.
CPIDHB Driver
The CPIDHB driver on the CP 580 handles the data transfer with one or more CPUs.
It is loaded into the memory and is called by the CP 580 applications (supplied
system programs or user programs) via a special interrupt interface.
The driver remains resident in the memory. You can only delete it from the memory
by removing the load command "CPDHB" from the AUTOEXEC.BAT file and then
carrying out a cold restart of the CP 580.
l)
[email protected]^
is referred to below as STEP 5.
Principle Interaction Between CPU and CP 580
3.3
Principle lnteraction Between CPU and CP 580
All applications of the CP 580 with respect to data transfer with a CPU take place in
the following steps:
1. Synchronize CP 580 with CPU.
2. Call CPIDHB driver for special application.
3. Carry out data transfer.
3.3.1
Synchronize CP 580 with CPU
The CP 580 is synchronized with a CPU by the DHB SYNCHRON during the CPU
restart. The application-specific chapters (Chapters 4 to 7) show you how to program
the DHB call.
Note
The CP 580 and the CPUs inserted into the programmable controller
run up simultaneously when the PLC power supply is switched on.
The CP 580 requires more time than the CPUs, however. If you call
the DHB SYNCHRON in the restart organization blocks of a CPU, you
must repeat this in a program loop until the fault LED "Interface not
ready" is no longer set by the DHB. Make sure, however, that the
program loop is always terminated by means of an abort criterion
(timer or loop counter).
3.3.2
Call CPIDHB Driver for Special Application
The CPIDHB driver is called for the respective application by the supplied system
programs when you start the corresponding program. If you use free programming,
your application program must call the driver via a declared software interrupt (see
Chapter 7).
Q Siemens AG 1991 C79000-88576-CX)4~01
Principle Interaction Between CPU and CP 580
Carry Out Data Transfer
3.3.3
Once the preparatory steps 1 and 2 have been carried out, data transfer between the
CPU and CP 580 takes place according to the following principle (see Fig. 3.2):
A
A
A
t
I
CPU
I
I
1
1
L-
CPUS
I
CPU2
-3
CPU1
2
DHB
.-F
5
T
age.
w e n - f8
C
S5
6
data
S5 user
program
?+3..
. .P.age.
..
.
?+?. . . .
. ~ a g e n t l . ..
l
I
CPIDHB driver
10
1 1
Dual-
I
I
-
l j
7
MS-DOS applications
(system and
user programs)
l
l
PLC CPU
Fig. 3.2
CP5801MSDOS
Principle sequence for data transfer between CPU and CP 580
The S5 user program starts the data transfer by calling a DHB and specifies the
parameters for the source or destination of the data transfer (1).
The DHB enters the interface number supplied by the user program as a page
no. into the vector register and initially transfers job parameters into the page (2).
Principle Interaction Between CPU and CP 580
If data are to be transmitted from the CPU to the CP, data are transferred from
the S5 area into the page via the S5 bus following a further DHB call (3).
The CPIDHB driver on the CP 580 is informed by an interrupt that data transfer
with a CPU is to take place (4).
A special entry informs the CPIDHB driver of the page via which data are to be
transferred, i.e. with which CPU (5).
If data have been transmitted by the CPU, the driver reads them from the page
and transfers them to the MS-DOS application (6).
If data are to be transmitted to the CPU, the driver requests the data from the
MS-DOS application and writes them into the page (7). In this case, another
DHB call is output by the S5 program on the CPU following initialization of data
transfer. The DHB recognizes via an interrupt from the S5 bus (9) that data are
present in the page. It reads these via the S5 bus and transfers them to the S5
area (10).
O
Siemens AG 1991 C79000-88576-C204-01
Simultaneous Operation of CP 580 Applications
3.4
Simultaneous Operation of CP 580 Applications
The system programs on the CP 580 are designed such that they can execute all
applications simultaneously. Once you are more familiar with the functions and
methods of operation of the individual applications, it is up to you to decide whether
this is necessary and what effort you want to invest on the CPU side.
In the delivered state, the applications "Mass storage functions" and "Command
interpreter" are automatically started by entries in the AUTOEXEC.BAT file following
a system restart of the CP 580. This is a important simultaneous usage of both
applications if your CP 580 does not have a keyboard.
Once you have decided which applications are to be used, you can edit the
AUTOEXEC.BAT accordingly (start commands) such that these are automatically
started each time the CP 580 is restarted.
Q Siemens AG 1991 C79000-06576-C206-01
Contents
Instructions
C79000-B8576-C204
Contents, Pa e Overview
How to Use t is Manual
?I
Introduction to Working with the CP 580
1
-
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
3
Process Data Acquisition
Mass Storage
unctions
-
p
-
P
-
5
Command Interpreter
Free Programming of the CP 580
7
Application Examples
8
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
Contents
Contents
.......................................................................
4.3
4
Process Data Acquisition
4.1
Application
4.2
Principal Sequences Between CPU and CP .........................................
4-4
4.3
Process Data Acquisition Operations
..............................................................................................4-3
.................................................
4-5
Related Procedures...................................................................................
4-5
Measures on the CP ..................
.
.
..........................................................
4-6
Setting the Base Interface Number ........................................................ 4-6
Defining Parameters for Data Acquisition .............................................4-7
Definition of Conversion Procedure ...........
.
...........................................4-7
Editing the Configuration File ..................................................................
4-11
Programming of CPU .............................................................................
4-18
Principle...................................................................................................
4-18
Calling and Parameterizingthe Data Handling Blocks ............................4-19
Example................................................................................................. 4-24
Activation and Testing of Process Data Acquisition ................................ 4-26
Activation .................................................................................................
4-26
Testing................... .
.
..........................................................................
4-27
...............................................
4.4
Evaluation of Acquired Process Data
4.4.1
4.4.2
4.4.3
4.4.4
Storage of Process Data on the CP 580 .................................................
4-32
Structure of Process Data in the ASCll Files .....................
...................4-34
Converting the Individual Data .............................................................
4-35
Example of "Individual" Conversion....................................................... 4-39
4.5
Status Messages
4.6
Handling in Various Operating Situations
4-32
...................................................................................
4-40
.......................................... 4-44
Contents
O Siemens AG 1991 C79000.08576.C204-01
Application
Process Data Acquisition
This chapter is intended for users who wish to read process data from a CPU and to
store and evaluate them on the CP 580. The chapter describes all measures and
operations required for process data acquisition on the CP 580, the PG and on the
CPU side:
Only simple operations are required on the CP 580 and PG for process data acquisition (see Section 4.3.2). You must adapt your STEP 5 programs on the CPUs from
which you wish to acquire data to enable the data transfer to take place (see Section
4.3.3). For this you should have experience in programming programmable controllers.
The chapter also provides you with information on everything you must know for
evaluation of the acquired data, as well as information on special operations during
process data acquisition.
4.1
Application
You can use the system function "Process data acquisition" to acquire data on the CP
580 from various S5 data areas, e.g. data blocks, flags etc. from a CPU which is
inserted in the same programmable controller as the CP 580. If several CPUs are
present in the programmable controller, you can select one of the maximum of 4
CPUs for process data acquisition. The CPU from which you wish to acquire process
data can be simply changed at any time by changing parameters on the CP 580.
You can read the data globally or selectively from the S5 data area at specific
intervals and store them in one or more files on the CP 580 for later evaluation. The
data are converted either individually using format specifications in a file on the CP or
universally (e.g. in hexadecimal format) into ASCll representation.
You can record the collected and converted process data on the CP 580 independent
of the operations at the CPU side and process them using a suitable MS-DOS
program (e.g. dBASE).
O Siemens AG 1991 C79000-08576-Cm-01
Principal Sequences Between CPU and CP
4.2
Principal Sequences Between CPU and CP
Fig. 4.1 shows you a summary of the principal sequences with process data acquisition using the CP 580.
S5 bus
CPIDHB driver
7
STEP 5 program for
cycle ( 0 8 1, F8 0)
System program
CPRECORD
Format
l informal
\ tion
--I
l
CPU
1
Synchronization of CPU during restart with CP via DHB SYNCHRON. The frame size
for data transfer is defined in the process.
2
Starting of system program CPRECORD, timer is set by CPRECORD with the cyde time
from the configuration file.
3
Timer activates CPRECORD cyclically
4
CPRECORD transfers via CPIDHB driver trigger to DHB SENDIfunction SEND-ALL with
information on the data source and number.
5
DHB SEND transmits all required data to the CP following triggering. They are fetched from
there by the CPIDHB driver and CPRECORD, converted into ASCll format according to
the format information and stored in the ASCll file "Destination".
Fig. 4 . 1
Sequences during process data acquisition
Q Siemens AG 1991 C79900-B8576-CX)4-01
Process Data Acquisition Operations
4.3
Process Data Acquisition Operations
4.3.1
Related Procedures
You must carry out the following measures in order to transmit data from a CPU to
the CP 580:
Measures for activation of data acquisition
Table 4.1
data transfer.
Create or modify the restart organization blocks on the CPU
such that the DHB SYNCHRON is called in each OB.
PG/
CPU
4.3.3.2
Create or modify the STEP 5 program on the CPU for the cycle
such that the DHB SEND is called in each cycle with the
function SEND ALL.
PG/
CPU
4.3.3.2
63 Siemens
AG
1991 C79009-08576-Cm-01
Process Data Acquisition Operations
4.3.2
Measures on the CP
4.3.2.1
Setting the Base Interface Number
So-called pages are used to address the memory areas when transferring data on the
S5 bus. The pages have a fixed assignment to the modules involved in data transfer.
The CP 580 can transfer data with up to four CPUs via four pages. The pages are
numbered consecutively, the number of the first page is the base interface number.
Define this number for the CPU from which you wish to read the data, and set it on
the CP 580 as described in Section 2.2.2.1.
O Siemens AG 1991 C79000-B8576-C2W-01
Process Data Acquisition Operations
4.3.2.2
Definlng Parameters for Data Acquisition
First define the parameters for process data acquisition. These are:
-
CPU number
Conversion instruction: universal, via format file or via preheader data (see
Section 4.3.2.3)
- Acquisition mode (cyclic or until a parameterizable data volume is attained)
- S5 data area (see Section 4.3.2.4 for permissible data areas)
- With data blocks: number of data block on CPU
- Initial address of first data unit to be read in the data area
- Number of data units to be read
- Time data for acquisition cycle in seconds
- Maximum number of data records per ASCll file (see Section 4.4.2 for data
record)
- Maximum number of ASCll files for process data acquisition
- Field delimiter (ASCII character) by means of which the individual data units in a
data record are to be separated
- Path data for the ASCll files
- ASCll character for file name extension of ASCll files (e.g. TXT for the file
"name .TXTW)
Setting for output of program messages in a logbook file: output ontoff
- Path and file names for the logbook file
- Timeout.
-
4.3.2.3
Definition of Conversion Procedure
Universal conversion: this is defined using the corresponding parameter in the
configuration file (see Section 4.3.2.4).
individual conversion: you have the opportunity here to use a format file on the
CP 580 or - in the case of data blocks - to use the data block file of the PG with
the preheader information.
O Siemens AG 1991 C79990-B8576-C294-01
Process Data Acquisition Operations
Conversion using format file:
Conversion using a format file provides the advantage that you can use it on
all S5 data areas (not only on data blocks) and that you are independent of
your PG since the format file is created directly on the CP 580.
Name of the format file and directory:
The name of the format file can be selected as desired according to the
MS-DOS standard and must have the file name extension FMT. The
directory for the format file is specified in the configuration file (see Section
4.3.2.4).
Structure of the format file:
A format file consists of one or more text lines (ASCII characters). Each
line can consist of one or more format instructions or a comment. It
must be terminated by CR and LF.
Syntax of a format instruction:
A format instruction has the following syntax:
Repetition factor
(optional)
Repetition factor:
Format data
Delimiter
Specifies how many successive items of data are to
be converted with the same data format. If it is not
specified, the subsequent format instruction is
implicitly assigned the repetition factor "1".
Permissible values:
1 to 4091
O Siemens AG 1991 C79WQ-B8576-C294-01
Process Data Acquisition Operations
Format data:
Permissible values:
KC for S5 format KC,
KF for S5 format KF,
KG for S5 format KG,
KH for S5 format KH,
KM for S5 format KM,
KS for S5 format KS,
KT for S5 format KT,
KY for S5 format KY.
Delimiter:
Permissible values:
(Character/ASCII decimal
equivalent):
Space / 32
Comma / 44
Horizontal tab / 9
Semicolon / 59 (must be entered
as ";;" because of double function)
CR + L F / 13 + 10.
Comment line:
A line is not interpreted if it commences with the character ";". You can
then use comments in a format file.
+
The information in a format file refers to the complete S5 area,
e.g. to a complete data block. It is independent of which area
is actually transmitted to the CP 580. The first format
instruction refers to the first word or doubleword in the
defined S5 area.
An exception is the S5 area AS: in this case the first format
Instruction applies to the first word in the AS area to be
transmitted to the CP 580.
If the S5 data area is longer than the result of all format
instructions, the excess data is converted universally using
"KF".
Q Siemens AG 1991 C79000-88576-C2W-01
Process Data Acquisition Operations
Example of a format file:
Name: MYFORM.FMT
Contents:
;3 Fixed-point numbers:
3KF
;4 Floating-point numbers:
4KG
;6 Characters:
6KS
Converslon of data of a data block using preheader data:
If you wish to acquire process data using a data block DB or DX, you can use
the preheader data of this block for the conversion:
The preheader data are generated on the PG when programming the data
block and contain information on the formats of the individual data words in
the data block. You must make the preheader data available on the CP 580
for the conversion. Proceed as follows:
Call the S5 software package on the PG, define a data block DB or DX
and enter the data in the desired format. The data have the function of
token characters here. Store the data block on the PG in a file
??????ST.S5D(?????? = any sequence of letters/numbers, "@" as filler);
following storing, this file contains the data of the data block and the preheader information.
Copy this file in MS-DOS format onto a 3.5-inch floppy disk. If you do not
have a PG with S5 software with the FlexOS operating system, you must
transfer the S5 file from the PCP/M format onto a floppy disk formated for
MS-DOS using an appropriate program.
O Siemens AG 1991 C79000-B8576-C291-01
Process Data Acquisition Operations
Use the MS-DOS command COPY to load the file from the floppy disk
onto your CP 580.
Note
The data will be converted incorrectly if the preheader data do
not agree with the data block.
If the data block is longer than the preheader data, the data of
the data block for which no preheader information exists are
converted with the format "KF".
4.3.2.4
Editing the Configuration File
The file CPRECORD.INI (configuration file) in the directory CP580 on the hard disk
contains the parameters with which the CPRECORD program carries out process
data acquisition. The file consists of ASCll characters and must contain 16 parameter
lines. The sequence of parameters (see Table 4.2) is compulsory! A line can
consist of up to 80 characters (without terminators) and must have the following
syntax:
Parameter
Semicolon
Comment
CR
LF
Optional
A line is not evaluated as a parameter line if its first character is a semicolon. You can
use this feature to continue long comments concerning a parameter in a second line.
If the semicolon is to be part of a parameter (this is only the case with the parameter
"Field delimiter"), you must write two semicolons in succession.
O Siemens AG 1991 C79909-BB576-C204-01
Process Data Acquisition Operations
Table 4.2 shows the meanings of the individual parameters and the permissible
values. Numbers can be entered in decimal form (1234) or hexadecimal form
(Oxabcd), e.g. offset for AS.
Table 4.2
Parameters in the configuration file
Number of CPU corresponding
to slot sequence
I
I
lto4
Specification of data source on
CPU:
QA for output area
AS for absolute address
RS for RS word
DB for data block DB
DX for data block DX
IA for input area
FA for F flag area
PY for 110 area
TA for timer cell area
CA for counter cell area
Number of data block D6 or DX
on the CPU, if the data source is
a data block; this parameter has
no significance for the other data
(the parameter line must still be
present, however!)
Depending
on CPU
No. of 1st data unit to be read
in the S5 area (word or byte no. see Table 4.3)
Depending
on data
tY Pe
and CPU
Process Data Acquisition Operations
starting at "Offset"
8
9
10
Number of
files
Maximum number of ASCll files
for process data acquisition
Number of
data records
Maximum number of data records
per ASCll file (see Sedion 4.4.2
for data records)
Format
"Individual" conversion:
path and file name for format
file or (only with DBIDX) for file
with preheader data
1 to
10 000
2)
1 to
(z3' -
4)
MS-DOS
syntax,
file name:
"??????ST
.S5DWor
"*.FMT";
? = letter/
number or
@,
= max.
8 letters1
numbers
Q Siemens
AG
1991 C79000-88576-Cm-01
4 - 13
Process Data Acquisition Operations
~ n e meter
~ermls-
wnfng
slbk
No.
values
I Continuation 2 of Table 4.2:
10
Format
(contd.) (contd.)
1
"Universal" conversion:
KS for 2character constant
KF for fixed-point number
KG for floating-point number
KH for hexadecimal number
KM for bit pattern
KT for timer value
KC for counter value
KY for 2-byte decimal number
KB for l-byte decimal number
(only meaningful for data
areas IA, QA, PY and FA)
KS,
KF,
KG,
KH,
KM,
KT,
KC,
KY,
KB
Field delimiter Characters by means of which
the individual data of a data
record are to be separated in the
ASCll files (preset value: space)
Acquisition
cycle
Cycle time in seconds in which
the process data are to be read
from the CPU
Acquisition
mode
0: recording is terminated once
the defined file number has
been reached.
1: "Permanent" recording ;
the oldest file is deleted when
the defined file number is
reached and is then overwritten
(similar to cyclic mode)
Message
mode
CPRECORD can store error
messages in a logbook file:
0 = store no messages
1 = store messages
ASC ll
characters
1 to
11 799 360
0 and 1
1
0 and 1
~
Process Data Acquisition Operations
l ) Section 4.4.1 shows you how the file name is produced.
2,
Depending on available memory space. Refer to Sections 4.3.4.1 and 4.4.1 to find out how
the CPRECORD program reacts if the memory space is insuffiaent.
3,
The time between triggering of data transmission and its completion is compared with the
defined timeout. If it is exceeded 3 times in succession, the CPRECORD program aborts
process data acquisition and terminates itself.
4,
Is not checked by CPRECORD for reliability. Only enter meaningful values.
+
In the case of S5 areas which are byteoriented (see Table 4.3), you
should enter an even number for the parameter "Number" (line no.
5) and convert the area in the format "KY".
If you enter an odd number, the last byte of the S5 area is stored in
the ASCll file in a word format where the Low byte of the word is
invalid.
O Siemens AG 1991 C79000-86576-C2C4-01
Process Data Acquisition Operations
If you define the parameters "Offset" (line no. 4) and "Number" (line no. 5) for the S5
area, you can see in the following table whether the S5 data are stored byte-oriented
or word-oriented in the CPU memory.
Table 4.3
Organization of S5 data areas
QA
Output byte numberlnumber of bytes
Byte-oriented
RS
RS word numberlnumber of words
Word-oriented
TA
Timer cell numberlnumber of words
Word-oriented
O Siemens AG 1991 C79900-E8576-C294-01
Process Data Acquisition Operations
3
.... Example of parameters in the configuratlon file:
j::::::
.:.:.:.:
:::S;
:.:.:...
........
.:.:.:.:
....
....
....
....
Line type:
P = parameter
C = comment
Line contents
P / No. 1
C
PINO. 2
P / No. 3
P / No. 4
P / No. 5
C
P/No. 6
P / No. 7
C
P / No. 8
P / No. 9
C
C
C
P / No. 10
C
P / No. 11
C
P / No. 12
C
P / No. 13
C
C
P / No. 14
C
P / No. 15
C
P / No. 16
1;
DB;
20;
0;
8;
Read process data from
CPU No. 1:
S5 area = DB,
from DB no. 20,
from data word DW 0 onwards (offset = O ) ,
8 data words
Path name for ASCll files = "C\CPUI":
C\CPU1;
TXT;
File name extension: TXT
Max. data quantw on CP 580:
200;
max. 200 ASCll files,
500;
max. 500 data records per ASCll file
,
Format:
lndivldual conversion via
preheader data with file [email protected]:
C:\S5D\[email protected];
Field delimiter:
+.
separate individual data by "*"
I
Acquisition cycle:
acquire data evev 10 seconds
10;
,
Acquisition mode:
1;
"Permanent" acquisition (acquisition
,
mode = 1)
Message mode/logbook file:
Output messages (message mode = 1)
1;
and store in file "C:\CPRECORD.LOGW
C:\CPRECORD.LOG;
Timeout:
50;
50 seconds
Q Siemens AG 1991 C7900088576-Cm-01
Process Data Acquisition Operations
4.3.3
Programming of CPU
4.3.3.1
Principle
Programming the CPU for data transfer comprises synchronization of the CPU during
the restart and the cyclic calling of a special function block for transmitting the CPU
data. For both functions you require the so-called "Data handling blocks" (DHB): the
DHB SYNCHRON for synchronization and the DHB SEND for data transfer.
Fig. 4.2 shows you the positions at which you must call the two data handling blocks
in your STEP 5 program.
Manual/automatic
cold restart
Cyclic STEP 5
program
OB 20 l )
Call DHB SYNCHRON,
evaluate bits in PAFE
Manual warm
restart
Call DHB SYNCHRON,
evaluate bits in PAFE
Call DHB SEND with
job no. 0 (no undesired
effect on rest of STEP 5
Automatic warm
restart
l ) OB 20 and
Call DHB SYNCHRON,
evaluate bits in PAFE
Fig. 4.2
FB 0 are not
available on
every CPU.
Principle of DHB calls in STEP 5 program of CPU
Q Siemens AG 1991 C79000-B8576-CX)4-01
Process Data Acquisition Operations
Calling and Parameterizing the Data Handling Blocks
4.3.3.2
The functions of the data handling blocks which you need to transfer CPU data to the
CP 580 are explained in this section as far as is necessary for programming. You can
obtain further information on the data handling blocks from the corresponding descriptions of the DHBs. These descriptions are available for the S5-135U and S5-155U
(see Reference Literature). The description of the DHB for the S5-115U can be found
in the S5-115U Manual.
The data handling blocks have different block numbers on the various programmable
controllers. The following table lists the numbers of the DHBs SYNCHRON and
SEND which you require for the various programmable controllers.
Table 4.4
DHB numbers on the various programmable controllers
DHB SYNCHRON:
Block diagram
SYNCHRON
PAFE-
@ Siemens
AG
1991 C79000-08576-Cm-01
Use the block no.
FB xxx from
Table 4.4
Process Data Acquisition Operations
Table 4.5
Format and meaning of parameters for SYNCHRON
SSNR
D
KY Interface number
BLGR
D
KY Frame size
PAFE
Q
BY Parameter assignment error bits
Set the following parameters for the DHB SYNCHRON:
SSNR:
Enter the number of the page by means of which you wish to read the
data from the CPU: "(CPU no. - 1) + base interface no." (see Section
4.3.2.1).
Permissible values:
0 to 255 ')
BLGR:
Use this parameter to define the maximum number of bytes to be
transmitted to the CP 580 in a CPU cycle.
Permissible values:
0 = 256 bytes (standard setting)
1 = 16bytes
2 = 32 bytes
3 = 64 bytes
4 = 128 bytes
5 = 256 bytes
6 = 512 bytes
PAFE
Byte address for parameter error bits, e.g. FY 210. Bit no. 0 of the
status byte is set to "1" in the event of a parameter error (refer to
Section 4.3.4 for the meaning of the other status bits).
l ) The base interface no. must be set in steps of four (0, 4, 8, 12 etc.)!
O Siemens AG 1991 C79000-B8576-C294-01
Process Data Acquisition Operations
Note
The CP 580 requires more time to run up than the CPU. Therefore
you should call the DHB SYNCHRON repeatedly in a program loop
until the synchronization is successful. Make sure, however, that the
program loop is always terminated by an abort criterion (timer or loop
counter).
Longer data blocks are transmitted faster if you set the frame size
BLGR larger, but the S5 bus is also under a greater work load and
vice versa the bus loading is less with smaller frame sizes, but data
transmission to the CP 580 then takes longer.
You must decide which frame size is most favorable for your CPU by
considering the complete operation on the programmable controller.
I
Following synchronization by the CP 580, the CPU receives a request if necessary
from the CPRECORD program to read the CPU data whilst utilizing the CPIDHB
driver to transmit the required data. To enable the CPU to correctly satisfy this
request, the DHB SEND with parameterization for the function "SEND ALL" must be
called in each CPU cycle as shown in Fig. 4.2.
O Siemens AG 1991 C79000-B8576-C2C4-01
Process Data Acquisition Operations
Use the block no.
FB xxx from
Table 4.4
Block diagram
SEND
-SSNR
- A-NR
- ANZW
- QTYP
- DBNR
- QANF
PAFE -
-QLAE
Table 4.6
I
I
I
1
SSNR
A-NR
ANZW
QNP
Format and meaning of parameters for SENDPSEND ALL'
I
I
I
1
D
D
I
D
I
I
I
1
KY
l Interface number
KY IJobnurnber
W
KS
I Status word
1 These Darameters are irrelevant with the function
"SEND ALL"; they must nevertheless be specified
~~Ol~)
I
I
QANF
QLAE
PAFE
I
I
D
D
Q
I
I
KF
KF
BY
I
I
Parameter assignment error bits
O Siemens AG 1991 C79000-88576-C2W-01
Process Data Acquisition Operations
Set the following parameters for the DHB SEND:
SSNR:
Enter the number of the page via which you wish to read the data from
the CPU: corresponding to the call of the DHB SYNCHRON.
A-NR:
Job number: you must enter zero here for the function "SEND ALL".
ANZW:
Address of two successive words. These words are used by the data
handling blocks to store job-related status bits. These words are
deleted during transfer with the CP 580 for process data acquisition.
Permissible addresses:
FW 0 to 252
DW 0 to 254
PAFE:
As with DHB SYNCHRON.
Note
The parameters required for data transmission (QTYP, DBNR, QANF
and QLAE) are made available following calling of the DHB SEND
using the SEND ALL function:
The CPRECORD program determines them from the data in the
configuration file. They are made available to the DHB SEND via the
CPIDHB driver.
Process Data Acquisition Operations
4.3.3.3
Example
Data are to be transmitted on the S5-135U from a CPU 9288 (the only CPU in the
PLC!) to the CP 580. The CPU 9288 must then be programmed as follows:
Function block FB 111 (RESTART) is called in the restart OBs (OB 20 to OB 22). FB
111 handles synchronization of the CP 580. The necessary STEP 5 operations are
programmed in OB 1 for cyclic calling of the DHB SEND.
The names of the DHBs for the SS-135U programmable controller are obtained from
Table 4.2:
DHB SYNCHRON = FB 125, DHB SEND = FB 120.
The STEP 5 program consists of three parts:
a) Calling of FB 111 in the restart blocks
b) FB 111 with callin$ of DHB SYNCHRON
c) STEP 5 operations for calling the DHB SEND in OB 1.
a) STEP 5 operations in OB 20, OB 21 and OB 22:
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
NAME
ERR
: JU
FB 111
: CPSYNC
:
M 200.0
STEP 5 OPERATIONS FOR
SYNCHRONIZATION OF CP 580:
CALL CPSYNC
MARKER FOR PARAMETER ERROR
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
O Siemens AG 1991 C79000-B8576-CX4-01
Process Data Acquisition Operations
b) Function block FB 111:
SEGMENT l
NAME :CPSYNC
DECL
:ERR
I/Q/D/B/T/C: Q
NAME
SSNR
BLGR
PAFE
: JU
FB 125
: SYNCHRON
:
KY 0,12
:
KY 0,O
:
FY 255
:A
. --
M 255.0
ERR
BI/BY/W/D: BI
INTERFACE NO. OF CP 580 (PAGE NO. 12)
FRAME SIZE = 256
PARAMETER ERROR DETECTED
SET OUTPUT BIT
c) STEP 5 operations in OB 1:
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
NAME
SSNR
A-NR
ANZW
QTY P
DBNR
QANF
QLAE
PAFE
: JU
: SEND
FB 120
STEP 5 OPERATIONS TO
CALL THE DHB SEND:
CALL DHB SEND
KY 0,12
KY 0,O
DW1
KS
KY 0,O
KF +O
KF +O
FY 201
INTERFACE NO. OF CP 580 (PAGE NO. 12)
JOB NO. = 0 ("SEND ALL")
DW 1 AND 2 FOR TRANSFER FLAGS
NO SIGNIFICANCE
NO SIGNIFICANCE
NO SIGNIFICANCE
NO SIGNIFICANCE
FLAG BYTE FOR PARAMETER ERROR
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
Q Siemens AG 1991 C79000-B8576-CZC4-01
Process Data Acquisition Operations
4.3.4
Activation and Testing of Process Data Acquisition
4.3.4.1
Activation
You can activate process data acquisition (initially for the test) once you have carried
out all preparatory measures on the CPU and CP 580:
Make sure that the entry for loading the CPIDHB driver ("CPDHB") is present in
the AUTOEXEC.BAT file in the main directory of the CP 580 hard disk. l )
Boot the CP 580 in order to start the CPIDHB driver. l )
Restart the CPU in order to synchronize it with the CP 580
Start process data acquisition on the CP 580:
Enter the command CPRECORD on.
If you have already debugged the data process acquisition, you can also enter
the command into the AUTOEXEC.BAT file. In this case the process data acquisition is automatically started when the CP 580 is run up.
-
The program starts and outputs the following text on the monitor:
CPRECORD data recording for CP 580 - version 1.O
Copyright (c) Siemens AG 1991
........................
CPIDHB driver version = xx
CPIDHB interrupt number = OX66
CPRECORD installed...
'CPRECORD\?' indicates command syntax
Data recording started
l ) If the load command for the driver has been removed from the AUTOEXEC.BAT file for
a specific reason, you can load the driver using the keyboard input "CPDHB".
-
Process Data Acouisition Operations
The program installs itself in the main memory.
* The CPRECORD.INI configuration file is searched for in the directory ir: which
the program is present, and is then evaluated.
If you have switched message output on in the configuration file, the start
message of the program together with the date and time is entered in the
logbook file.
a CPRECORD then checks whether there is sufficient space for all ASCll files
(in the case of small data quantities, 2048 bytes are provided per file) on the
destination drive which you have specified in the configuration file in the path
name for the ASCll files.
CPRECORD outputs an error message if the space on the drive is insufficient.
Data recording is nevertheless commenced.
The process data are transferred into the ASCll files whose path you have
specified in the configuration file.
3
The CPRECORD program is executed in the background. All other programs
can be active in the foreground; the reaction times are influenced, however.
4.3.4.2 Testing
Proceed in steps to find out whether the data transfer required from the CPU to the
CP 580 is being executed correctly:
1. Check whether the STEP 5 operations for data transfer are being executed
correctly on the CPU.
2. Check that your configuration file on the CP 580 has the correct format and is
logically correct (the CPRECORD program informs you of faults in the sequence
by means of error messages - see Section 4.5).
3. Initially transfer static test data (data block) from the CPU to the CP 580 and
check whether these reach the destination file on the CP 580 correctly
converted.
Q Siemens AG 1991 C79999-B8576-CX)4-01
Process Data Acquisition Operations
Re 1.:
In order to determine whether the STEP 5 operations programmed by you on the
CPU are being correctly executed for data transfer, you can test them with the
PG on-line functions (handling is explained in your programmable controller
manual or in the STEP 5 Basic Package manual, see Reference Literature).
Initially activate the CP 580 without process data acquisition ("idling" of CPU).
The data handling blocks store flags in the agreed PAFE byte when they are
called, from which you can draw conclusions on any errors:
Error byte PAFE:
Bit No. ,
t
*
7
,
1
l
,l
Cause of error
= Common bit:
0:
1:
4
(,
3
,,
1
,I
O
*
,
no errors
parameter error, more details in bits 4 to 7
Table 4.7 lists all error bits which can be stored by the data handling blocks in
PAFE.
Table 4.7
4 - 28
Causes of parameter errors
Q Siemens AG 1991 C79900-B8576-C204-01
Process Data Acquisition Operations
Evaluation of the status word is not meaningful with the CPRECORD function.
You must eliminate the mentioned cause of the error if one of the causes listed
in Table 4.7 occurs: check your STEP 5 operations for correct parameters and
compare these values with the hardware configuration of your PLC and the CP
580 if applicable. Also check that the CP 580 including the CPIDHB driver is
ready.
You can proceed to the next test step if no errors have been indicated in the
PAFE.
O Siemens AG 1991 C7900QB8576-C204-01
Process Data Acquisition Operations
Re 2.:
Initially program a data block DB with test data on the PG such that these data
can be converted universally (e.g., only enter fixed-point numbers in the DB).
Before you load the data block into the CPU, ensure that it will not be overwritten
by dynamic data from your STEP 5 program for the test.
Edit the following parameters in the CPRECORD.INI configuration file:
-
S5 area:
enter "DB" here.
-
DBIDX number:
enter the DB no. under which you have loaded the data
block on the CPU.
- Number of files:
-
Number of
data records:
only specify one file for the test.
specify a clear number, e.g. 20.
- S5 format:
enter the data format with which you wish to convert all the
data in the DB universally.
-
Cycle time:
enter a large time in order to initially eliminate dynamic
effects during the test.
-
Permanent:
switch on the storage of messages in a logbook file
using "1".
- Logbook file:
enter the pathhame for the logbook file.
- Timeout:
enter 20 seconds.
O Siemens AG 1991 C79000-B8576-CX)4-01
Process Data Acquisition Operations
You must specify all the above parameters according to your test plan. Then
start process data acquisition.
If the CPRECORD program determines errors or faults during interpretation of
the configuration file or during process data acquisition, it stores corresponding
error messages in the set logbook file (see Section 4.5).
Re 3.:
If you have carried out test steps 1 and 2, and if no error bits are registered on
the CPU and CP, check whether the data have been completely transferred from
the CPU and correctly converted (read in Section 4.4 how the data are stored in
ASCll files):
To do this, log the ASCll file on the CP 580 on a printer using the MS-DOS
command PRINT and compare the log with that of the data block from the PG.
Data transmission is correct if the data are identical.
Once you have carried out steps 2 and 3 using data converted universally, repeat
these steps with "individual" conversion using a data block in which mixed data
formats occur (you must of course match the configuration file to the modified test
conditions). To do this you must either edit a format file (see Section 4.3.2.3) or
transfer the S5 file generated on the PG with the data and preheader information of
the data block to the CP 580.
Q Siemens AG 1991 C7W-68576-C204-01
Evaluation of Acquired Process Data
Evaluation of Acquired Process Data
4.4
This section tells you how the process data are stored on the CP 580 and where you
can find the data of the data block again.
Storage of Process Data on the CP 580
4.4.1
What file names are used?
The names of the ASCll files are generated from the data type and a four-digit
consecutive number. The file number extension is taken from the configuration file.
Table 4.8
')
Names of ASCll files
nnn
mmmm
eee
= data block no. of
DB/DX
= consecutive file number
= file name extension from configuration file
C
3 Siemens AG 1991 C79000-88576-C2W-01
Evaluation of Acauired Process Data
Example:
File names for D0 20 with file name extension "TXT":
...........
....
...
... .......
...
l..i...i...!...
:?iiiii
020DOOOO.TXT
020D0001.TXT
02000002.TXT
020D0003.TXT
for
for
for
for
1st ASCll file
2nd ASCll file
3rd ASCll file
4th ASCll file etc.
How are the ASCll files written?
Following a warm system restart on the CP 580 and starting of process data
acquisition, the most recently written ASCl l file is assigned the consecutive number
"n" using the time stamp (MS-DOS entry in file directory) independent of the mode of
acquisition. The newly acquired process data are then stored in a new file with the
number "n+lW.If no data were initially present for the type of data acquired, the file is
first created with the consecutive number "0".
If the last file (corresponding to the number of files in the configuration file) also
becomes full during acquisition, or If no more memory space Is available, the
procedure is continued depending on which acquisition mode you have specified in
the configuration file:
"Permanent recording": in the next acquisition cycle, the file with the consecutive
number "0" is deleted, created again and rewritten (the old data are then lost).
Once this has been filled, the next file is recreated etc., i.e. the data are stored in
a type of cyclic process.
"Terminate recording": no further data are acquired.
Note
The ASCll files are filled with the value "binary zero" when created.
Unwritten areas of an ASCll file therefore have a value of zero.
63
Siemens AG 1991 C79000-B6576-C204-01
1
Evaluation of Acquired Process Data
4.4.2
Structure of Process Data In the ASCll Files
What is a data record?
All data which are read by the CPU and stored converted in an ASCll file within one
acquisition cycle constitute a data record. A data record is terminated by the ASCll
characters CR and LF (see Fig. 4.3).
Data block DBlDX
Bit No. 15
8,7
I
DWO
Bit No. 15
0
Bbck header
l
1
ASCll file
8,7
1st data remrd
0,
i
lst data word
Last data word
QANF = offset from 1st data word = n
QLAE = number of data words to be acquired = 8
Fig. 4.3
Storage of a data record in an ASCll file
O Siemens AG 1991 C79000-B8576-CX)4-01
Evaluation of Acquired Process Data
What i s the data record format?
A data record contains the individual process data from the data area of the CPU
which you defined. Each item of data is separated from the next by the field delimiter
defined in the configuration file.
Example (corresponding to Fig. 4.3):
g
.......
23 " ~ + 1 4*+l
$$
1 .234567e+001*XY* 123*456*OAEF'~~5500"435*~4711
(CRLF)"
:.:.S
.:.:.:.
A
4.4.3
= space,
= delimiter
Converting the Individual Data
The individual data of the S5 area are converted according to the following procedure:
"lndividual" conversion using preheader data of a DBIDX or using a format file
edited by you.
"Universal" conversion of a complete S5 area.
Note
Independent of the format specification for the individual data, one
item of 16-bit information from the S5 area is observed and converted. In the case of byte-oriented S5 data (e.g. inputs and outputs), this
means that two bytes are combined in each case.
lndividual conversion:
In the case of individual conversion, the read S5 area is divided into individual data
using the information in the preheader data or the format file on the data type and
type repetition, and these individual data are converted corresponding to the type.
Q Siemens AG 1991 C79999-B8576-C204-01
Evaluation of Acquired Process Data
The following table shows you the results obtained in the ASCll file from individual
conversion and the S5 areas for which you can use individual conversion.
Table 4.9 Individual conversion of S5 data
Format instruction "KG"
KG = +5500000+01 "+5.500000e+000"
e = characters for exponent
Mantissa: sign,
1 digit before
decimal point,
6 digits after
decimal point
Exponent: sign,
3 digits
4 - 36
leading
spaces
DX,
IA,
FA,
PY
14
characters,
leading
zeros
DB,
DX,
poss. FA
3,
8 Siemens AG 1991 C79000-B8576.CZW-01
Evaluation of Acquired Process Data
"AI854"
Format instruction "KT"
KT = 032.2
7
The time value is calculated in
hundredths of a second from
characters,
the "Value"and the "Timebase":
leading
spaces
"~~3200"
DB,
DX,
TA
Format instruction "KY"
KY = 007.062
Two successive bytes of the S5
area are converted into two
3-digit decimal numbers and
stored in two arrays:
2 3
characters,
leading
spaces
AI l
areas
"~7"delimitet'~62"
O Siemens AG 1991 C79000-08576-C204.01
-
4 37
Evaluation of Acquired Process Data
l ) A = space
*) A string is stored in the ASCll file with the format 'KS'. The end criterion of the file is:
a) a change in format,
b) a binary zero in the S5 data stream.
3, Only those S5 data are correctly converted into floating-point numbers which have been
generated either via a KG format (with data blocks) or with an S5 floating-point operation.
Universal conversion :
The individual data are converted by a universal conversion in the same manner as
with individual conversion. In this case, however, the complete S5 area read is
converted with the same format.
The following format symbols are possible: <KB>, <KS>, cKF>, <KG>, <KH>, <KM>,
<KT>, cKY> and <KC>.
Each data unit from the S5 area is mapped in a character array in the ASCII file. An
exception to this procedure is the format instruction KS: since in contrast to all other
formats neither the length of the S5 data nor the length of the string following
conversion are fixed in this case (in the case of individual conversion they are defined
by the repetition factor), the complete S5 area read is mapped in one character array.
Each data record in the ASCll file therefore contains only one character array with the
universal format instruction "KS".
O Siemens AG 1991 C79000-08576-C204-01
Evaluation of Acquired Process Data
Example of "Individual" Conversion
4.4.4
Table 4.10 shows you an example of how S5 data (e.g. from a data block) are
converted in a format file using format instructions. "*" is declared as the delimiter
following a data record.
Table 4.10
Example of individual conversion of S5 data
S5 data block
,
DW No.
Contents of DW
ASCll file
Data
record
No.
ASCll character
0
M+123*
1
A-4567
2
+34653*
3
+5.500000e+000*
KG=+5500000+03
4
+5.500000e+002*
KG=-3410000-02
5
-3.410000e-003*
KG=-1234567+00
6
-1.234567e-001
0
KF = +l23
1
KF=-4567
2
KF=+34653
3
KG=+5500000+01
4
5
Format f ilel
format instruction
;3 Fixed-point
numbers:
3KF
;4 Floating-point
numbers:
4KG
6
7
8
9
10
-
11
KS=EX
12
KS=AM
13
KS=PL
O Siemens AG 1991 C79990-88576-CX)4-91
;6Characters:
6KS
7
EXAMPL*
Status Messages
4.5
Status Messages
If special events are determined during process data acquisition, they can be entered
as messages in a logbook file on the CP 580 (see Section 4.3.2.4 "Editing the
Configuration File").
Messages are generated by the CP/DHB driver and the CPRECORD program. The
following two tables show you which messages can occur and what they mean.
Table 4.1 1
CPlDHB driver messages
I [CPDHB] CPU not synchronized
I
I [CPDHB] Aborted by timeout
[CPDHB] Parameter invalid (PAFE 1)
[CPDHB] DB/DX does not exist (PAFE 2)
[CPDHB] Area too small (PAFE 3)
[CPDHB] Area does not exist (PAFE 4)
[CPDHB] Status word error (PAFE 5)
Table 4.12
CPRECORD program messages
Message
Data recording started
<Date> <Time>
Remarks
Message at beginning of
process data acquisition
1
<Date> <Time>
4 - 40
O Siemens AG 1991 C79000-B8576.C204-01
Status Messages
Unknown option
Incorrect parameter in
CPRECORD command
(see Section 4.6)
S5D file: could not be opened
MS-DOS output
S5D file: read error
MS-DOS output
S5D file: not a root directory
Format error
S5D file: too many subdirectories (> 128)
S5D file: no DV subdirectories
S5D file: positioning error
MS-DOS output
"Seek Error"
S5D file: too many data elements (> 128)
S5D file: the configured DV block is missing
S5D file: wrong block ID in DV
preheader <Code>
Format error, <Code>
= incorrect block code
Status Messages
Insufficient number of available DOS clusters
(<Actual value> <Required value>) l )
CPRECORD.INI not found in current directory
Configuration file extension is not ".INIW:
<Config file>
<Config file> =
name of configuration file
CPIDHB driver not loaded
FMT file:
could not be opened
<FMT file>
MS-DOS output
<FMT file> = name of
format file
FMT file:
unknown format in line <n>
(<Format>)
<n> = line No.,
<Format> = incorrect format
FMT file:
format error in line <n>
(<Format>)
<n> = line No.,
<Format> = incorrect format
FMT file:
too long in line <n> onwards
(<Format>)
<n> = line No.,
<Format> = incorrect format
O Siemens AG 1991 C79999-B8576-CX)4-01
Status Messages
')
..
.:..:
... . ..
. ...
........
.....
' . I:>.
. ..:.. .
Cluster = contiguous logical memory area on drive.
Example of an error message:
CPRECORD data recording for CP 580 version - 1.0
Copyright (c) Siemens AG 1991
............................
-----------------W----------
CPIDHB driver version = xx
CPJDHB interrupt number =OX66
CPRECORD installed...
[CPDHB] CPU not synchronized
O Siemens
AG 1991 C79000-68576-C204-01
Handling in Various Operating Situations
4.6
Handling in Various Operating Situations
The CPRECORD program enables you to influence process data acquisition prior to
starting or during the sequence or to obtain information on operating states and
parameters using special commands and special key combinations (so-called hot
keys).
Information on CPRECORD:
Enter the command "CPRECORD l?".
Replacing the preset configuration file:
Start process data acquisition using the command "CPRECORD path name"
e.g. CPRECORD C:\MYDIR\MYCONF.INI
Following this command, CPRECORD uses the configuration file specified by
you.
Delete CPRECORD program from the CP 580 memory (process data acquisition
is aborted if active when the command is entered):
Enter the command "CPRECORD /U".
Note
If the acquisition of process data in non-permanent mode was terminated because the maximum file number was reached, you must enter
the command "CPRECORD /U" before restarting acquisition.
0 Siemens AG 1991 C79000-B8576-CX)4-01
Handlina in Various O~eratinaSituations
Display of configuration parameters:
Simultaneously press the keys
[K)(right-handkey) and (ALT
and
The CPRECORD program outputs the parameters from the configuration file on
the screen starting at the current cursor position (see Fig. 4.4).
T
( 1) CPU number = ...
( 2) S5 area = ...
( 3) DB/DX number = ...
( 4) Data off set = ...
( 5) Data length = ...
( 6) Output directory = ...
( 7) File extension = ...
( 8) Number of files = ...
( 9) Number of data records = ...
(10) S5 format = ...
(11) Field delimiter = ...
(12) Cycle time (sec.) = ...
(13) Permanent = ...
(14) Logging = ...
(15) Log file = ...
(16) Timeout (sec.) = ...
Fig. 4.4
Display of configuration parameters on the screen
Handling in Various Operating Situations
Display of the current operating status:
Simultaneously press the keys
and
Q
The CPRECORD program outputs the following status variables of the process data
acquisition on the screen starting at the current cursor position (see Fig. 4.5):
\
F
' Recording active = 011
Timer = ...
Record = ...
File = ...
Permanent cycle =
Fig. 4.5
/
/
/
/
/
0: recording inactive 1: recording active
remaining time for recording
No. of current data record in file
current file
cycle counter
i~
Display of configuration parameters on the screen
Interrupt or continue acquisition:
Simultaneously press the keys
(left-hand key) and
and
El
The function acts like a "flip-flop": if the acquisition was active, it is interrupted
by pressing the key combination. If it was interrupted by pressing the key
combination, pressing again continues it.
G? Siemens AG 1991 C79999-B8576-C294-01
Contents
Instructions
Contents, Page Overview
How to Use this Manual
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
-
p
-
Process Data Acquisition
Mass Storage Functions
5
Command Interpreter
Free Programming of the CP 580
7
Application Examples
8
- -
Reference Section for System Software
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
--
- - -- -
Abbreviations
Index
Ordering Information
14
Contents
Contents
......................................................................
5-3
.............................................................................................
5-3
5
Mass Storage Functions
5.1
Application
5.2
Principle Sequences Between CPU and CP
5.3
Mass Storage Function Operations
........................................5-4
..............................
......................5-8
Related Procedures............................................................................5-8
Measures on the CP ..............................................................................
5-9
Programming the CPU ......................................................................... 5-10
Principle................................................................................................ 5-10
Synchronization of the CPU .................................................................. 5-12
Transmission of Data from CPU to CP 580 ......................................... 5-14
Transmission of Data from CP 580 to CPU .............................................5-17
Preselection of Directory on CP 580 or Delete S5F Files .......................5-22
Indirect Parameterization " R W ...............................................................
5-25
Example of DHB Parameterization for Mass Storage Functions.............5-27
Activation and Testing of the Mass Storage Functions ...........................5-30
5-30
File Names for CPU Data on the CP .......................................................
Testing .............. .
.
5-31
..................................................................................
................................................................................................
5.4
Error Bits
5.4.1
5.4.2
Parameter Error Bits............................................................................. 5-33
Job Status Bits .............................
.
.
...................................................
5-35
Q Siemens AG 1991 C79099-B8576-CX)4-01
5-33
Contents
O Siemens AG 1991 C79009-98576-CX)4-01
Application
Mass Storage Functions
This chapter is intended for users who wish to use the CP 580 as an additional
storage medium for a CPU. The chapter describes all measures and operations
required on the CP 580 and on the CPU:
Only a single setting is required on the CP 580 (see Section 5.3.2). You must match
your STEP 5 programs according to the required functions on the CPUs with which
you wish to use the mass storage functions (see Section 5.3.3). For this you should
have experience in programming programmable controllers.
This chapter also provides information on the response of the mass storage functions
on the occurrence of faults.
5.1
Application
If the memory media existing on a CPU of your programmable controller are
insufficient you can transfer data to the CP 580 using the mass storage functions and
fetch these back - selectively if necessary - to the CPU as required. You can buffer
data areas of up to 4 CPUs inserted in the same programmable controller as the CP
580 on the hard disk (or also on a floppy disk) of the CP 580 in binary form. Four hard
disk directories (CPU1 to CPU4) are preset on the CP 580 for each of these CPUs.
You can use a CPU to change its preset directory by specifying a drive andlor a
special directory for data storage.
The mass storage functions also provide you with the facility for deleting all mass
storage files (S5F files) of a directory on the hard disk of the CP 580 using a CPU.
O
Siemens AG 1991 C790M)[email protected]
Principle Sequences Between CPU and CP
5.2
Principle Sequences Between CPU and CP
Fig. 5.1 shows you the basic sequence of a mass storage function on the CPU and
CP 580. Figs. 5.2 to 5.4 show you the basic data transfer between the CPU and CP
580, the switching over of a directory and the deletion of S5F files.
S5 bus
r
CPIDHB driver
t
STEP 5 program for
cycle (061, FE 0)
1
System program
CPMASS
Calling of data handling
. . blocks for desired
function
l
CPU
1
1
CP 580
1
Synchronization of CPU during restart with CP via DHB SYNCHRON. The frame size for
subsequent data transfer is set in the process.
2
Triggering of mass storage function.
3
Execution of mass storage function.
Fig. 5.1
1
l
Basic sequence of mass storage functions
O Siemens AG 1991 C79000-B8576-C204-01
Principle Sequences Between CPU and CP
S5 bus
STEP 5 program for
cycle (OB 1, FB 0)
CPIDHB driver
I
f
+I
System program
CPMASS
*
SEND-ALL
/ / / / / / / / / / / /
/ S 5 data area, e.g.
-5
data block DB 10
" ' / / / / / / / / / / I
CPU 1
CP 580
1
Call of DHB SENDIfunction SEND-DIRECT. The source parameters (including data block DB 10)
are also defined here. By calling the DHB SEND, the S5 program activates the CP 580 and
transfers the address of the data to the CPMASS system program via the CPIDHB driver. The
CPMASS system program generates the file name for storing the data from the transferred
address.
2
Call of DHB SENDlfunction SEND-ALL. The DHB SEND is activated for transmission of S5 data
by the CPMASS system program via the CPIDHB driver and provided with the address of the data.
3
SEND-ALL transmits the data from CPU l (example) out of the S5 data area to the CP 580 and
stores them in the file 010BOOO.S5F (example) in the directory CPUl\ (example).
Fig. 5.2
Sequence when transmitting data from CPU 1 to the CP 580
62 Siemens AG 1991 C79900-B8576-C294-01
Principle Sequences Between CPU and CP
S5 bus
l
STEP 5 program for
cycle (OB 1, FB 0)
~
I
CPIDHB driver
1
I
FETCH
System program
CPMASS
b
1
+
l
T
RECEIVE-ALL
7
' Directory C\:CPU2
File 0 2 0 ~ ~ 0 0 0 - ~ 5 ~ / /
.
Hard disk
CP 580
CPU 2
1
Call of DHB FETCH. The destination parameters (including data block DX 20) are also defined
here. By calling the DHB FETCH, the S5 program activates the CP 580 and transfers the
address of the data to the CPMASS system program via the CPIDHB driver. The CPMASS
system program generates the file name for reading the data from the transferred address.
2
Call of DHB RECEIVEIfunction RECEIVE-ALL: The DHB RECEIVE is activated by the
CPMASS system program via the CPlDHB driver to read the data from the CP 580 and
provided with the destination address.
3
RECEIVE-ALL reads the data from the CP 580 in the directory CPU2\ (example) from the
file 020DXOOO.S5F and transmits these to CPU 2 (example) into data block DX X)
(example).
Fig. 5.3
Sequence when transmitting data from the CP 580 to CPU 2
Q Siemens AG 1991 C79009-B8576-CX)4-01
Principle Sequences Between CPU and CP
S5 bus
b
CPJDHB driver
cycle (OB 1, F B 0)
ti
System program
CPMASS
SENPALL
Data block D B 15
I
a
C:\MINE\DIR
C:\MINE\DIR
Hard disk
CPU 3
CP 580
1
Call of DHB SENDIfunction SEND-DIRECT. The address of a string (here in DB 15) is also
specified. By calling the DHB SEND, the S5 program activates the CP 580 and transfers the
string with the path name of the directory to the CPMASS system program via the CPIDHB driver.
2
The path name is transmitted to the CP 580.
3
Once all characters of the path name have been transferred to the CPMASS system program,
this carries out the desired function (switchover to directory or delete SSF files from directory).
Fig. 5.4
Sequence when switching over a directory/deleting S5F files on the hard disk of the CP 580
from CPU 3
Q Siemens AG 1991 C79000-88576-C2€4-01
Mass Storage Function Operations
5.3
Mass Storage Function Operations
5.3.1
Related Procedures
You must carry out the following measures in order to transfer data between a CPU
and the CP 580:
Table 5.1
Measures to activate the mass storage functions
Measure
j
on
See;
Section:
I
Make sure that the CPU with which you wish to exchange
data and the CP 580 are plugged into your programmable
controller. The base interface No. for data transfer must be
set on the CP 580.
I
PLC/
CP
580
5.3.2
Create or modify the STEP 5 program on the CPU for the
cycle according to your applications of the mass storage
functions (e.g. transmit or fetch data depending on a certain
operating state).
PG/
CPU
5.3.3
Carry out a test on the CPU to make sure that the
DHBs to be called in the restartlwarm restart or cyclically
are actually called correctly (see Section 5.3.4).
PG/
CPU
5.3.4.2
Make sure that the CPIDHB driver is loaded in the memory
of the CP 580 (cold restart of CP 580 if necessary).
The mass storage functions are automatically started with a
cold or warm restart (AUTOEXEC entry).
CP
580
--
Create or modify the restart organization blocks on the CPU
such that the DHB SYNCHRON is called in each OB.
O Siemens AG 1991 C79000-88576-C2W-01
Mass Storage Function Operations
Synchronize the CPU with the CP 580 by triggering a
restart or warm restart of the CPU.
5.3.2
Measures on the CP
Only one preparatory measure is required on the CP to use the mass storage
functions:
Setting the base interface number:
So-called pages (page frames) are used to address the memory areas when
transferring data via the S5 bus. These pages have a fixed assignment to the
modules involved with data transfer.
The CP 580 can transfer data with up to four CPUs via four pages. These pages
must be numbered consecutively. The number of the first page is the base
interface number.
Define this number for the first CPU with which you wish to exchange data and
set it on the CP 580 as described in Section 2.2.2. The pages for data transfer
with three further CPUs then have consecutive numbers following the page with
the base interface number.
O Siemens AG 1991 C79000-B8576-C204.01
Mass Storage Function Operations
5.3.3
Programming the CPU
5.3.3.1
Principle
Programming of the CPU for data transfer comprises the synchronization of the CPU
during the restart and the calling of special function blocks for specific applications of
the mass storage functions. You require so-called "data handling blocks" (DHB) for
both functions: the DHB SYNCHRON for synchronization. The other DHBs which you
additionally require, and where these must be called, depend on your special
application of the mass storage function.
Fig. 5.5 shows you the positions in your STEP 5 program at which you must call the
two data handling blocks.
ManuaVautomatic
cold restart
Cyclic STEP 5
program
Call DHB SYNCHRON,
evaluate bits in PAFE
Manual warm restart
l
Call DHB SYNCHRON,
evaluate bits in PAFE
Automatic
warm restart
l)
l
Call DHB SYNCHRON,
evaluate bits in PAFE
:
Fig. 5.5
OB 20 and
FB 0 are not
available on
every CPU.
Principle of DHB calls in the STEP 5 program of the CPU with the mass storage functions
O Siemens AG l991
C79000-BB576-CX)4-01
Mass Storage Function Operations
Before you commence with programming or adaptation of your STEP 5 program,
consider the following:
Which mass storage functions are to be used?
Which events or operating statuses are to activate the various mass storage
functions:
-
Following a cold restart (activation in the cycle, e.g. following scanning of bits)
-
Following a manual warm restart (activation in the cycle, e.g. following
scanning of bits)
-
Following an automatic warm restart (activation in the cycle, e.g. following
scanning of bits)
-
Depending on an input signal (activation in cycle following scanning of the
input signal).
Once you have answered these questions, you can read in the following sections
which data handling blocks you require and which parameters must be assigned to
these for the respective application.
Table 5.2 shows you the function block numbers of the DHBs for the various
programmable controllers.
Q Siemens AG 1991 C79000-B8576-C2W-01
Mass Storage Function Operations
DHB numbers on the various programmable controllers
Table 5.2
5.3.3.2
I
Synchronization of the CPU
DHB SYNCHRON:
I
Block diagram
61*11/
SYNCHRON
Table 5.3
-
Use the block no.
FB xxx from
Table 5.2
Format and meaning of parameters for SYNCHRON
Parameter Kind Type Meaning
SSNR
D
KY
Interface number
BLGR
D
KY
Frame size
PAFE
Q
BY
Parameter error bits (see Section 5.4)
l
Mass Storage Function Operations
Set the following parameters for the DHB SYNCHRON:
SSNA:
Enter the number of the page via which you wish to read the data
from the CPU: "(CPU No. - 1) + base interface number"
(see Section 4.3.2).
Permissible values:
0 to 255 l )
BLGR:
Use this parameter to define the maximum number of bytes to be
transmitted to the CP 580 in a CPU cycle.
Permissible values:
0 = 256 bytes (standard setting)
1 = 16 bytes
2 = 32 bytes
3 = 64 bytes
4 = 128 bytes
5 = 256 bytes
6 = 512 bytes
PAFE
Byte address for parameter assignment error bits, e.g. FY 210. Bit
no. 0 of the status byte is set to "1" in the event of a parameter error
(refer to Section 5.4 for the meaning of the other status bits).
Note
The CP 580 requires more time to run-up than the CPU. Therefore
you should call the DHB SYNCHRON repeatedly in a program loop
until the synchronization is successful. Make sure, however, that the
program loop is always terminated by an abort criterion (timer or loop
counter).
Longer data blocks are transmitted faster if you set the frame size
BLGR larger, but the S5 bus is also loaded more. Vice versa the bus
loading is less with smaller frame sizes, but data transmission to the
CP 580 then takes longer. You must decide which frame size is most
favourable for your CPU by considering the complete operation on the
programmable controller.
A
') The base interface no. must be set
O Siemens
AG 1991 C79MX)-B8576-C2W-01
in steps of four
(0, 4, 8, 12 etc.)!
Mass Storage Function Operations
5.3.3.3
Transmission of Data from CPU to CP 580
In order to transmit data from the CPU to the CP 580, you must program the call for
DHB SEND twice in the cyclic STEP 5 program (OB 1 or FB 0):
1. SENDIfunction SEND-DIRECT
2. SENDIfunction SEND-ALL
Use the block no.
FB xxx from
Table 5.2
Block diagram
SEND
-SSNR
- A-NR
ANZW
- QTYP
- DBNR
- QANF
-QLAE
Table 5.4
5-14
PAFE -
Format and meaning of parameters for SEND
O Siemens AG 1991 C79000-B8576-C294-01
Mass Storage Function Operations
SEND call with function SEND-DIRECT:
With the first call of the DHB SEND you activate the CP 580 via your STEP 5
program and assign it the address of the data to be transmitted by the CPU. You
must ensure that the result of the previous logic operation (RLO) has a value of
"1" when calling the DHB SEND. The CPMASS program generates the name of the
destination file on the CP from the transferred address.
Set the following parameters for the DHB SEND for the function SEND-DIRECT:
SSNR:
Enter the number of the page via which you wish to read the data
from the CPU: corresponds to the call of the DHB SYNCHRON.
A-NR:
Enter a value from 1 to 99 as the job number.
ANZW:
Address of two successive words. These words are used by the
data handling blocks to store job-related bits (see Section 5.4).
Permissible values:
FW 0 to 252
DW 0 to 254
Mass Storage Function Operations
QTYP:
Enter which type of data you wish to transmit.
Permissible values:
DB for data block DB
DX for data block DX
FY for flag bytes
IA for process input image
QA for process output image
TA for timer cells
CA for counter cells
With indirect addressing:
XX (see DHB description)
RW (see Section 5.3.3.6)
QANF:
Enter the number of the first item of data of the above type to
be transmitted.
Permissible values:
QLAE:
Specify the number of words (with DB or DX) or bytes
(with the other data types) which are to be transmitted to the CP 580.
Permissible values:
PAFE:
dependent on data type and CPU
dependent on data type and CPU
Byte address for parameter assignment error bits, e.g. FY 210. Bit
no. 0 of the status byte is set to "1" in the event of a parameter
assignment error (refer to Section 5.4 for the meaning of the
other status bits).
SEND call with function SEND-ALL:
The second call of the DHB SEND using the function SEND-ALL triggers data
transmission to the CP 580. Set the following parameters for the DHB SEND:
Mass Storage Function Operations
SSNR:
Enter the number of the page via which you wish to read the data
from the CPU: corresponds to the call of the DHB SYNCHRON.
A-NR:
Always enter "0" as the job number.
ANZW:
Address of two consecutive words as with SEND-DIRECT.
QTY P:
DBNR:
QANF:
QLAE:
These parameters are irrelevant
with SEND-ALL. They must be recorded
for format reasons, however.
Enter "0" for all of them.
PAFE:
As with SEND-DIRECT.
5.3.3.4
Transmission of Data from CP 580 to CPU
In order to transmit data from the CP 580 to the CPU, you must call the following
DHB after synchronization of the CPU:
1.
FETCH
2.
RECEIVE/function RECEIVE-ALL
O Siemens
AG 1991 C79XO-B8576-C2W-01
Mass Storage Function Operations
Use the block no.
FB xxx from
Table 5.2
Block diagram
FETCH
-SSNR
- A-NR
- ANZW
- ZTYP
- DBNR
ZAN F
-ZLAE
Table 5.5
PAFE
-
Format and meaning of parameters for FETCH
O Siemens AG 1991 C79099-B8576-CX)4-01
Mass Storme Function Operations
Calling of DHB FETCH:
By calling the DHB FETCH you activate the CP 580 via your STEP 5 program and
transfer the address of the data to be transmitted to the CPU to it. The CPMASS
program generates the name of the source file on the CP from the address.
Set the following parameters for the DHB FETCH:
SSNR:
Enter the number of the page via which you wish to read the data
from the CPU: corresponds to the call of the DHB SYNCHRON.
A-NR:
Enter a value from 1 to 99 as the job number.
ANZW:
Address of two successive words. These words are used by the
data handling blocks to store job-related flags (see Section 5.4).
Permissible values:
FW 0 to 252
DW 0 to 254
ZTYP:
Enter which data type you wish to have on the CPU.
Permissible values:
DB for data block DB
DX for data block DX
FY for flag bytes
IA for process input image
QA for process output image
TA for timer cells
CA for counter cells
With indirect addressing:
XX (see DHB description)
RW (see Section 5.3.3.6)
C
2 Siemens AG 1991 C79900-B6576-C294-01
Mass Storage Function Operations
ZANF:
Enter the number of the first item of data of the above type
to be written into the CPU.
dependent on data type and CPU
Permissible values:
ZLAE:
Specify the number of words (with DB or DX) or bytes
(with the other data types) which are to be transmitted to the CPU.
Permissible values:
PAFE:
dependent on data type and CPU
Byte address for parameter assignment error bits, e.g. FY 210. Bit
no. 0 of the status byte is set to "1" in the event of a parameter error
(refer to Section 5.4 for the meaning of the other status bits).
Block diagram
RECEIVE
(1)
-SSNR
(2) - A-NR
(3) - ANZW
(4) - Z W P
(5) - DBNR
(6) - ZAN F
(7)-ZLAE
PAFE
Use the block no
FB xxx from
Table 5.2
Mass Storage Function Operations
Table 5.6
Format and meaning of parameters for RECEIVEIfunction RECEIVE-ALL
These parameters are irrelevant with the function
RECEIVE-ALL; they must be specified for format
reasons, however.
ZLAE
D
KF
PAFE
Q
BY
Parameter error bits (see Section 5.4.1)
RECEIVE call with function RECEIVE-ALL:
By calling the DHB RECEIVE with the function RECEIVE-ALL you trigger data
transmission from the CP 580 to the CPU. Set the following parameters for the DHB
RECEIVE:
SSNR:
Enter the number of the page via which you wish to read the data
from the CPU: corresponds to the call of the DHB SYNCHRON.
A-NR:
Always enter "0" as the job number,
ANZW:
Enter the address of two consecutive words as with FETCH.
Q Siemens AG 1991 C79000-68576-Cm-01
Mass Storage Function Operations
ZTYP:
DBNR:
ZANF:
ZLAE:
These parameters are irrelevant with
RECEIVE-ALL. They must be recorded for
format reasons, however.
Enter "0" for all of them.
PAFE:
As with SEND-DIRECT.
5.3.3.5
Preselection of Directory on CP 580 or Delete S5F Files
If necessary for your application of the mass storage functions, you can use a CPU
to adjust the directory presetting for four assigned CPUs (directory C:\CPU1 to
C:\CPU4) to a different directory. The new directory may also be on a drive other than
"C:".
You can also delete all files from a directory which have been created by the
CPMASS program on the CP 580 for the mass data (S5F files). The same rules apply
to the selection of this directory as to the setting.
The function is executed as follows:
First all files which have the file name extension S5F are deleted from the specified
directory. The cataiog itself is also deleted if the directory has no other files and
no further subdirectories. If the directory has subdirectories, the CPMASS program
only deletes the files from the selected directory but not the subdirectories and the
directory itself.
The main directory on the hard disk of the CP 580 and the current working
directory (on the hard disk or floppy disk drive) cannot be deleted. Furthermore you
cannot delete any S5F files which have the file attribute read-only (MS-DOS).
Caution
A
Proceed carefully when using the delete function so that you do not
destroy important information on the CP 580 by mistake.
Q Siemens AG 1991 C79099-B8576-C224-01
Mass Storaqe Function Operations
Programming of the two functions is similar to that described in Section 5.3.3.2. The
two DHB calls SENDISEND-DIRECT and SENDISEND-ALL are used. Proceed as
follows:
Make sure that the path name of the addressed directory is stored in a data
block of the CPU such that it commences at a word limit. Spaces at the end of
the path name are not evaluated.
The following syntax must be observed:
dr:\dirl\dir2\ ...\dirn\name (possibly spaces) 0
where
dr:
MS-DOS drive designation, e.g. C or A,
always with 'V, even if only drive information.
dirl to dirn:
Name of directories which are present
in the hierarchy prior to the selected directory,
with 'l".
name:
Name of directory into which data are to be written or
from which data are to be read or deleted,
without "Y:
The end of the string must be terminated by a byte
with the binary value "0".
Call the DHB SENDflunction SEND-DIRECT using the following parameters:
SSNR:
As described in Section 5.3.3.3.
A-NR:
Preselect directory:
Delete S5F files:
ANZW:
As described in Section 5.3.3.2.
QTY P:
DB for data block DB or DX for data block DX.
O Siemens AG 1991 C79909-B8576-C294-01
201
207
Mass Storage Function Operations
DBNR:
Number of data block in which the name of the
desired directory is stored.
QANF:
Offset of 1st data word with the path name
(the path name must commence at a word limit,
see Fig. 5.6).
QLAE:
Length of path name as number of words:
QLAE 2 ((112 number of characters) + 1).
PAFE:
As described in Section 5.3.3.2.
,Data block DB l 0
Binary zero
,
Data block DB 10
KH
l -L
R K S
Correct
Fig. 5.6
Incorrect
Storage of path name in a data block
O Siemens AG 1991 C79000-B8576-CX)4-01
Mass Storage Function Operations
5.3.3.6
Indirect Parameterization "RW"
The DHB SENDIfunction DIRECT and FETCH enable you to characterize the data
source and destination differently using indirect parameterization (e.g. source on CP
580 = data type IA and destination on a CPU = data type FY).
Proceed as follows:
1. Program the source and destination parameters in a data block DB or DX with
the following format:
1
QANF*
+O
Possibly other data
KS QTYP:
1
Type of data source, but not
XX, RW and DX
DBNR:
Only if QTYP DB and DX
QANF:
Initial address of data source
QLAE:
Length of data source
ZTYP:
Type of data destination, but not
XX, RW and NN
Source
l
S; : : : :
Destine
tion
parameters
DBNR: Only if QTYP DB and DX
ZANF:
Initial address of data destination
ZLAE:
Length of data source
I
Possibly other data
I
2. Parameterize the call of the DHB SENDIDIRECT or FETCH for indirect parame-
terization with the following special values:
QTYPIZTYP:
DBNR:
QANFIZANF:
RW
KY = 0,dno
KY = 1,xno
QANF'
For indirect parameterization "RW"
If parameter in DB (dno = DB number)
If parameter in DX (xno = DX number)
Number of first data word in parameter
block of DBlDX (see diagram)
Mass Storage Function Operations
Observe the following peculiarities when using indirect parameterization with " R W :
What is the data source, what is the data destination?
SENDIDIRECT
CP 580
CPU
Source
Destination
Destination
Source
How is the length of the data area to be transmitted determined?
With SENDIDIRECT:
by QLAE
With FETCH:
by ZLAE
Whether the length is determined by words or bytes depends on the
organization of the source or destination area.
Caution
Undefined data may occur in the destination when using FETCH to
transmit data from a byte-oriented area into a word-oriented area or
vice versa.
Example: CP 580 file IAxxx.SSF is to be transmitted into DBy. The
destination length is word-oriented. More words are transmitted than
the length of the file IAxxx.SSF. Random values may be written into
the destination DB during the process since the transmission is
executed via a transfer buffer.
C
2 Siemens AG 1991 C79000-B8576-C!X4-01
Mass Storage Function Operafions
5.3.3.7
Example of DHB Parameterization for Mass Storage Functions
Data from the CP 580 are to be read on the S5-135U and transmitted to the CPU
9288 using the mass storage functions depending on a set input signal 1 20.0
(switch):
- The data transmission is to take place at the rising edge of the input signal
-
1 20.0.
The CPU is the only one in the PLC and has the CPU number "1".
200 data words are to be read from the CP 580 (file name
=000DB020.S5F) starting at DW 0 and transmitted into DB 20.
The STEP 5 program for this task consists of the following parts:
a) The CPU must be synchronized with the. CP 580 in the restart blocks OB
20/21/22. The DHB SYNCHRON is called in FB 111 for this purpose. The
programmable controller goes to STOP if synchronization has not been achieved
following a maximum of three calls of the DHB SYNCHRON (approx. 30 S).
(The CP 580 requires more time to run up than the CPU; therefore provide a
program loop for several attempts.)
b) The DHB FETCH is called in OB 1 following edge evaluation of the input switch
1 20.0. The actual data transmission is carried out using the DHB
RECEIVVfunction RECEIVE-ALL.
The DHBs to be used for the CPU 9288 have the following function block numbers:
DHB SYNCHRON:
DHB FETCH:
DHB RECEIVE:
O Siemens AG 1991 C79000-06576-C204-01
FB 125
FB 122
FB 121
Mass Storage Function Operations
a) STEP 5 operations in OB 20, OB 21, OB 22:
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
NAME
REP
: JU
FB 1 1 1
: CPSYNC
:
KF + 3
STEP 5 OPERATIONS FOR DATA
EXCHANGE WITH CP 580:
CALL SYNCHRON BLOCK
NUMBER OF ATTEMPTS:
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
Function block FB 111 :
SEGMENT 1
NAME : CPSYNC
: REP
I/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KF
DECL
:L
KF +O
:T
FW 10
INITIALIZE LOOP
COUNTER
DHB SYNCHRON
LOOP :JU
FB 125
NAME :SYNCHRON
SSNR
:
KY 0,16
INTERFACE NO. OF CP 580 (PAGE NO. = 16)
BLGR
:
KY 0,O
FRAME SIZE = 256 BYTE
:
FY 12
PAFE
ERROR BYTE
:L
KB 0
:L
FY 12
: != F
SYNCHRONIZATION SUCCESSFUL?
: JC
= END
YES: LEAVE BLOCK
:L
FW 10
INCREMENT......
:I
1
... LOOP COUNTER ........
:T
FW 10
... FW l0
: LW
= REP
REPETITION FACTOR ...
:<=F
... ILOOP COUNTER FACTOR?
: JC
= LOOP
NEW AlTEMPT
: STP
PLC = STOP
: BE
END
Mass Storage Function Operations
b) STEP 5 operations in OB l :
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
STEP 5 OPERATIONS FOR DATA
EXCHANGE WITH CP 580:
EDGE EVALUATION OF
INPUT SIGNAL
. --
NAME
SSNR
A-NR
ANZW
ZTYP
DBNR
ZAN F
ZLAE
PAFE
NAME
SSNR
A-NR
ANZW
PAFE
:S
: AN
:R
:A
: JU
: FETCH
INTERFACE NUMBER
JOB NUMBER = 1
STATUS WORD
DESTINATION: DATA BLOCK 'DB'
DB 20
WORD No. 0 ONWARDS
WRITE 200 WORDS
PARAMETER ERROR
: JU
: REC-A
:
:
:
:
FB 127
CALL RECEIVE/FUNCTION RECEIVE-ALL
KY 0,16
KY 0,O
FW 246
FY 14
PAGE NO. = SSNR = 16
RECEIVE-ALL ID
STATUS WORD
PARAMETER ERROR
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
Q Siemens AG 1991 C79000-B8576-C294-01
Mass Storage Function Operations
Activation and Testing of the Mass Storage Functions
5.3.4
The AUTOEXEC.BAT file in the main directory of the hard disk is set when the CP
580 is delivered such that the CPMASS program is started for the mass storage
functions with each system restarVwarm restart of the CP 580. The program then
expects to be triggered by a CPU in the same programmable controller as the CP 580
in order to then transfer data with it.
The CPMASS program outputs the following text on the monitor when started:
The program remains installed following a system restaftharm restart of the CP 580.
If you do not wish to use it, and therefore wish to delete it from the memory, you must
remove the CPMASS command from the AUTOEXEC.BAT file and carry out a cold
restart on the CP 580.
5.3.4.1
File Names for CPU Data on the CP
Before commencing with the test of your STEP 5 program for application of the mass
storage functions, you should know how the CPMASS program generates the file
names for these data on the CP 580 depending on the type of CPU data. You can
then later check for all data whether these have arrived from an S5 data area on the
CP 580.
Table 5.7
Names and lengths of the CP 580 files for S5 data
Q Siemens AG 1991 C79000-B8576-C20d-01
Mass Storage Function Operations
Timer cells
"
TA
TAaaa.S5F
512 bytes
nnn = DWDX number, aaa = job number
Note
When writing an S5 data area into a file, the file is always created in
the length assigned to the data type (see Table 5.7). If the length of
the transmitted data is not utilized, the rest of the file is filled with
binary zeros. You must observe this if you read data out of the CP
580 file again.
5.3.4.2
Testing
Proceed as follows to establish whether your required data transfer between the CPU
and CP 580 is being executed correctly:
1. Prepare a data block for the test with static data (not equal to zero!) on the PG
(e.g. DB 20) and transfer the block using the PG to the CPU whose STEP 5
program you wish to test for data transfer.
2. Write the STEP 5 program such that it initially only sends data once from the
CPU to the CP 580 (e.g. following scanning of an input in the restartlwarm
restart).
C
2 Siemens AG 1991 C79000-B8576-CM4-01
Mass Storage Function Operations
3. Determine whether calling of the DHBs SYNCHRON, FETCH and
RECEIVE-ALL is executed on the CPU without error bits being indicated (see
Section 5.4).
4. Check whether the associated file has been created (for DB 20
=
020DBOOO.S5F) in the preset directory following execution of the STEP 5
program on the CP 580 (CPU1 for the CPU with interface no. 1, CPU2 for
interface no. 2 etc.). If the file does not exist, check the results of steps 1 to 3 to
determine where the cause of the fault is to be found.
5. Copy the file with the CPU data into another file in the same directory in order to
fetch this file back to the CPU (e.g. file 020DBOOO.S5F from data block DB 20
into the file for data block DB 21 with the MS-DOS command "COPY
020DBOO.S5F 021DBOOO.S5F").
6. Write the STEP 5 program such that it reads data once from the copied CP 580
file into the corresponding data block (e.g. the file 021DBOOO.S5F into data block
DB 21).
7. Compare the data of the transmitted data block with that of the received data
block. If they agree, you can assume that data transfer with the mass storage
functions is executed correctly. You can then cancel any modifications made to
your STEP 5 program (e.g. access other S5 data areas) or program the DHB
calls for the mass storage function "Setldelete directory" if required.
Q Siemens AG 1991 C79000-B8576-C204.01
Error Bits
5.4
Error Bits
You can evaluate the bits of the data handling blocks in order to test your STEP 5
program for the mass storage functions. Two types of bits are available:
Parameter assignment error bits
Job status bits
5.4.1
Parameter Error Bits
All data handling blocks check the transferred parameters for syntax and logical
errors when called. In addition, they check whether the addressed interface is
available for the triggered function.
Whether parameter errors have occurred and which ones can be seen from the status
byte whose address you have specified by the parameter PAFE when calling the
DHB:
Error byte PAFE:
Bit No.
7
,
I
I
1
Cause of error
* = Common bit:
3
I
I
1
I
o
*
0: no error
1: parameter error, more details in bits 4 to 7.
Table 5.8 lists all bits which can be stored by the data handling blocks in the PAFE.
Q Siemens AG 1991 C79000-B8576-CX4-01
Error Bits
Table 5.8
Parameter assignment error bits
O Siemens AG 1991 C79009-B8576-C2Ol-Ol
Error Bits
Job Status Bits
5.4.2
Bits are set in two declared status words with the mass storage functions by means
of the DHBs SEND, RECEIVE and FETCH and by the CPMASS program via the
CPIDHB driver. You must specify the initial address of the status words in the
parameters ANZW of the DHB calls.
Some of the status bits of the DHB SENDflunction SEND-DIRECT and the DHB
FETCH are important for the test. These status bits will be explained later. You can
obtain more information on the DHB status bits from the DHB descriptions.
The status words of the DHB SENDISEND-DIRECT and FETCH have the following
format:
Bit No. 15
ANZW
ANZWcl
1
12 11
CPMASS
error number
8 7
4 3
Status bits from
data management
0
Status bits from
job management
Number of transmitted bytes
1
Status bits from job management (bit nos. 0 to 3):
You can obtain the respective status of a job from these status bits.
Table 5.9
Job status bits of CPMASS
If bits 1 and 2 are set simultaneously in the status word, you cannot send jobs to the
CP 580 for the respective job number. Remember this response during the restart of
your S5 program (see also Section 5.2.8).
O Siemens AG 1991 C79009-08576-Cm-01
5 - 35
Error Bits
Status bits from data management (bit nos. 4 to 7):
These status bits inform you on the current state of the triggered data transfer:
Table 5.10
Status bits from data management
Special status bits of the CPMASS program (bit nos. 8 to 11):
If the CPMASS program determines when processing a job from a CPU that it cannot
be handled without faults, it stores this in the first status word of the two words of the
CPU error bits addressed with ANZW.
Table 5.1 1 shows you the status bits which may occur during execution of the mass
storage functions.
Table 5.1 1
Error bits from data management
1
Value of
bit NO. 8
Cause of e r w
to bit
No. If
I
I
OH
1H to 5H
/
6H
I NO error
1
I
DHB error (also referred to as PLC or CPU error), error numbers
PAFE 1 to PAFE 5
/ CPJDHB error
1
Q Siemens AG 1991 C790M)-BB576-Cm-01
Error Bits
\rectory was not completely deleted since it contains subdirectories
or non-deletable files (job "Delete S5F files" from CPU)
EH
Timeout (after 50 seconds)
FH
Parameter error
@ Siemens AG 1991 C79000-08576.C204.01
Error Bits
O Siemens AG 1991 C79099-88576-CX)4-01
Contents
Instructions
Contents, Page Overview
How to Use this Manual
C79000-B8576-C204
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
-
Application Examples
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
Contents
Contents
..............................................................................6-3
6
Command Interpreter
6.1
Application
6.2
Principle Sequences Between CPU and CP
6.3
Command Interpreter Operations
...........................................................................................
6-3
......................................... 6-4
.......................................................
6-5
Related Procedures...................................................................................
6-5
Measures on the CP ................................................................................
6-6
6-7
Defining the Command Output ..................................................................
Programming the CPU .............................................................................
6-9
Storing Commands in Data Block ....................................................... 6-9
STEP 5 Operations for the Command Interpreter ...................................
6-10
Calling and Parameterizing the Data Handling Blocks ............................6-11
. . . .......................................................................
6-17
Example.....................
.
.............. 6-21
Activation and Testing of the Command Interpreter ..........
6-21
Activation .................................................................................................
........
..........................................................................
6-22
Testing .............
...............................................................................................
6.4
Error Bits
6.4.1
6.4.2
Parameter Error Bits ................................................................................
6-23
Job Status Bits .......................................................................................6-25
6.5
Special Features During Command Interpretation
O Siemens AG 1991 C79MX)-BB576-C204.01
6-23
............................. 6-27
Contents
Q Siemens AG 1991 C79990-B8576-C294-01
6
Command Interpreter
This chapter describes how you can execute MS-DOS commands on the CP 580
using a CPU inserted together with the CP 580 in your programmable controller.
The chapter describes all measures and operations required on the CP 580 and the
CPU:
You must adapt your STEP 5 programs for the command interpreter function on the
CPU from which you wish to execute the MS-DOS commands on the CP 580 (see
Section 6.3.4).
For this you should have experience in programming programmable
controllers.
This chapter also provides you with information on the response of the command
interpreter when errors occur.
6.1
Application
You can use the function "Command interpreter" with a CPU to execute on the CP
580 any MS-DOS commands stored in a data block DB or DX. For example, if you
use your CP 580 without a keyboard because you only use the "Mass storage
functions", the command interpreter can be used if necessary to copy files from the
CPU onto the CP or to trigger other MS-DOS functions as required.
Refer to the information in Section 6.3.3 when selecting the commands.
Once the command interpreter has been started, you cannot enter commands via a
keyboard apart from the command to terminate the command interpreter.
The command interpreter can be addressed by up to four CPUs which are inserted in
the same programmable controller as the CP 580.
O Siemens AG 1991 C79000-B8576-CX)4-01
Principle Sequences Between CPU and CP
Principle Sequences Between CPU and CP
6.2
Fig. 6.1 shows you the basic sequence of command interpretation on the CPU and
CP 580.
S5 bus
I
1
Restart OB (OB 20, 21, 22)
CPIDHB driver
1
C
System program
CPSHELL
(command ~nterpreter)
STEP 5 program for
cycle (OB 1, FB 0)
SEND-DIRECT
*
command processing
SEND-ALL
1
CPU
1
9
Kprogram
Hard disk
,
CP 580
1
Synchronization of CPU during restart and warm restart with CP via DHB SYNCHRON
2
Triggering of command interpreter.
3
Read command line from data block and transmit to CPSHELL command interpreter via CPIDHB
driver.
4
CPSHELL transfers the received command line to the MS-DOS commmand interpreter
COMMAND.COM. This handles further processing under MS-DOS as with a command input via
the keyboard.
5
In the case of commands which cannot be executed internally by COMMAND.COM, the
corresponding program file (xxx.EXE, xxx.COM or xxx.BAT) is started via the currently set path
of the hard disk.
6
MS-DOS hands over control to CPSHELL again when the command has been executed or
when the started program has been terminated, and the STEP 5 program receives a ready signal
Fig. 6.1
Basic sequence of a command interpretation
O Siemens AG 3991 C79000-B8576-C2€4-01
Command Interpreter Operations
6.3
Command Interpreter Operations
6.3.1
Related Procedures
You can use the CP 580 to execute commands which you have stored in an S5 data
block DB or DX.
You must carry out the following measures:
Table 6.1
Measures to activate the command interpreter
Create or modify the restart organization blocks on the CPU
such that the DHB SYNCHRON is called in each OB.
PG/
CPU
6.3.4.3
Create or modify the STEP 5 program on the CPU for the
cycle ( 0 6 1 or F 6 0) according to the defined conditions for
command execution and the syntax of the command data block.
PG/
CPU
6.3.4.3
Make sure by carrying out a test on the CPU that the DHB to
be called in the restarttwarm restart or cyclically is called
correctly.
PG1
CPU
Q
Siemens
AG 1991 C79000-BB576-C202.01
6.3.6.3
and 6.4
6- 5
Command Interpreter Operations
the CP 580. The command interpreter is automatically started
with a cold or warm restart (entry in AUTOEXEC). If the entry in
the AUTOEXEC is missing you can start the driver with the
CPDHB command.
6.3.2
Measures on the CP
Only one preparatory measure is necessary on the CP to use the command
interpreter:
Setting the base interface number:
So-called pages (page frames) are used to address the memory areas when
transferring data on the S5 bus. These pages have a fixed assignment to the
modules involved with data transfer.
The CP 580 can transfer data with up to four CPUs via four pages. These pages
must be numbered consecutively. The number of the first page is the base
interface number.
Define this number for the first CPU with which you wish to exchange data, and
set it on the CP 580 as described in Section 2.2.2.1. The pages for data transfer
with three further CPUs then have consecutive numbers following the page with
the base interface number.
O Siemens
AG 1991 C79900-68576-Cm-01
Command Interpreter Operations
6.3.3
Defining the Command Output
To prepare the programming operations on the CPU, you must first answer the
following questions:
Which commands are t o be output?
It is certainly not relevant to use the complete spectrum of MS-DOS commands
on a CPU.
Therefore first define the commands you wish to execute with the CPU. You are
allowed-to load your own MS-DOS programs onto the CP 580 for specific
applications and to start these from the CPU using their name.
When is a specific command to be output?
The command string must be transmitted to the CP 580 in the cyclic STEP 5
program using data handling blocks. Since it is not necessary to output a
command in each cycle, however, you must define start signals which can be
scanned by the cyclic program. These can be inputs or flags, for example.
Which directory is t o be addressed using a command?
If a command (e.g. TYPE) is output using MS-DOS, it usually refers to a file of
the currently set path. Since the CPU does not know what the current path is,
you must define the path in the command.
Examples:
TYPE C:\MYDIR\MYFILE
"+
C:\MYDIR\MYPROG
"* Call MYPROG program
O Siemens AG 1991 C79000-B8576-C204.01
Output MYFILE file
Command Interpreter Operations
Are commands output by several CPUs3
If you wish to use the command interpreter from several CPUs, you must
consider whether coordination measures are also necessary (refer to the
description of your programmable controller on how to implement these).
Caution
The FORMAT should not be used at all with the command
interpreter, the DELETE command only very carefully.
O Siemens AG 1991 C79000-B8576-C2W-01
Command Interpreter Operations
6.3.4
Programming the CPU
6.3.4.1
Storing Commands In Data Block
Once you have defined commands, you must program these as strings in a data
block DB or DX. The command string must be terminated by a binary zero. Spaces
at the end of a string prior to the binary zero are not evaiuated.
When activating a command (see Section 6.3.4.3)enter its initial address in the data
block. This must be a word address (see Fig. 6.2).
Data block DB 10
M
QANF = n
I
..........,.
A
1l
--
Binary zero
J
I
For later calling of DHB SENDIfunction SEND-DIRECT
Fig. 6.2
Storage of a command in the data block
O Siemens AG 1991 C79909-B8576-C294-01
1
l
Correct
'l
:
.....,.....
Incorrect
Command lnterpreter Operations
6.3.4.2
STEP 5 Operations for the Command Interpreter
Programming of the CPU for application of the command interpreter comprises
synchronization of the CPU during the restart and the cyclic calling of a special
function block for transmitting the command string. For both functions you require the
so-called "Data handling blocks" (DHB): the DHB SYNCRHON for synchronization
and the DHB SEND for command transfer.
Fig. 6.3 shows you the positions at which you must call the two data handling blocks
in your STEP 5 program.
ManuaVautomatic
cold restart
Cyclic STEP 5
program
1 0 ~ 1
or FBO
l)
Call DHB SYNCHRON,
evaluate bits in PAFE
Manual
warm restart
Call DHB SEND-DIRECT
with job no. 209
Call DHB SYNCHRON,
evaluate bits in PAFE
Call DHB SEND-ALL with
job no. 0
Automatic warm
restart
'l
Call DHB SYNCHRON,
evaluate bits in PAFE
Fig. 6.3
OB 20 and
FB 0 are not
available on
every CPU
Principle of DHB calls in the STEP 5 program of the CPU when using the command
interpreter
Command Interpreter Operations
6.3.4.3
Calling and Parameterizing the Data Handling Blocks
The functions of the data handling blocks which you need to execute commands on
the CP 580 are described in this section as far as is necessary for programming. You
can obtain further information on the data handling blocks from the corresponding
descriptions of the DHBs. These descriptions are available for the S5-135U and the
SS-155U programmable controllers (see Catalog for Order Nos.). The description of
the DHBs for the S5-115U programmable controller can be found in the S5-115U
Manual.
The data handling blocks have different block numbers on the various programmable
controllers. The following table contains the numbers of the DHBs SYNCHRON and
SEND which you require for the various programmable controllers.
Table 6.2
DHB numbers on the various programmable controllers
Block diagram
(2)
4 BLGR
Q Siemens AG 1991 C79000-B8576-CXI4-01
Use the block no.
FB xxx from
Table 6.2
Command Interpreter Operations
Table 6.3
Format and meaning of parameters for SYNCHRON
Set the following parameters for the DHB SYNCHRON:
SSNR:
Enter the number of the page via which you wish to read the data
from the CPU: "(CPU No. - 1) + base interface No." (see Section 6.3.2).
Permissible values:
0 to 255 l )
BLGR:
Use this parameter to define the maximum number of bytes to be
transmitted to the CP 580 in a CPU cycle.
Permissible values:
0 = 256 bytes (standard setting)
1 = 16 bytes
2 = 32 bytes
3 = 64 bytes
4 = 128 bytes
5 = 256 bytes
6 = 512 bytes
PAFE:
Byte address for parameter assignment error bits, e.g. FY 21 0. Bit
no. 0 of the status byte is set to "1" in the event of a parameter error
(refer to Section 6.4 for the meaning of the other status bits).
l'
The base interface no. must be set in steps of four (0, 4, 8, 12 etc.)!
6-12
C
2 Siemens AG 1991 C79999-08576-CX)4-01
Command Interpreter Operations
Note
-
The CP 580 requires more time to run up than the CPU. Therefore
you should call the DHB SYNCHRON repeatedly in a program loop
until the synchronization is successful. Make sure, however, that the
program loop is always terminated by an abort criterion (timer or loop
counter).
Send command to CP 580 and execute:
In order to send a command from the prepared data block to the CP 580 and to
execute it, you must program the call DHB SEND twice in the cyclic STEP 5 program:
1.
2.
SENDIfunction SEND-DIRECT
SENDIfunction SEND-ALL
Use the block no.
FB xxx from
Table 6.2
Block diagram
SEND
-SSNR
- A-NR
- ANZW
- QTYP
- DBNR
- QANF
-QLAE
O Siemens AG 1991 C79000-B8576-C294-01
PAFE -
Command Interpreter Operations
Table 6.4
Format and meaning of parameters for SEND
SEND call with functlon SEND-DIRECT
With the first call of the DHB SEND you activate the CP 580 via your STEP 5
program and assign it the address of the command to be sent by the CPU. You must
ensure that result of the previous logic operation (RLO) has a value of "1" when
calling the DHB SEND. To make sure that a previously output command has been
completed, you must check in the status word whether another job is still active (see
Section 6.4). In this case you must not send a new command.
Set the following parameters for the DHB SEND for the function SEND-DIRECT:
SSNR:
Enter the number of the page via which you wish to read the
command from the CPU; corresponds to the call of the DHB
SYNCHRON.
O Siemens AG 1991 C79999-B6576-CX)4-01
Command Interpreter Operations
A-NR:
Enter the value 209 as the job number.
ANZW:
Address of two successive words. These words are used by the
data handling blocks to store job-related status bits (see Section 6.4).
Permissible values:
FW 0 to 252
DW 0 to 254
QTY P:
Enter the type of data block in which the command is stored.
Permissible values:
DB for data block DB
DX for data block DX
QANF:
Enter the initial address (= No, of data word at which the
command commences - see Fig. 6.2) of the command.
Permissible values:
QLAE:
Enter the number of words of which the command string consists
(= 112 number of characters including spaces and terminating word
with binary zero - see Fig. 6.2).
Permissible values:
PAFE:
dependent on CPU
dependent on CPU
Byte address for parameter assignment error bits, e.g. FY 210. Bit
no. 0 of the status byte is set to "1" in the event of a parameter error
(refer to Section 6.4 for the meaning of the other status bits).
Q Siemens AG 1991 C79000-B8576-C204-01
Command Interpreter Operations
SEND call with function SEND-ALL:
The second call of the DHB SEND using the function SEND-ALL triggers
transmission of the command to the CP 580. Set the following parameters for the
DHB SEND:
SSNR:
Enter the number of the page via which you wish to read the data from
the CPU; corresponds to the call of the DHB SYNCHRON.
A-NR:
Always enter "0" as the job number.
ANZW:
Address of two consecutive words as with SEND-DIRECT
QTYP:
DBNR:
QANF:
QLAE:
These parameters are irrelevant
with SEND-ALL. They must be recorded
for format reasons, however.
Enter "0" for all of them.
PAFE:
As with SEND-DIRECT, but a different address since the function
SEND-DIRECT supplies its own status bits.
Note
With the S5-135U and S5-155U programmable controllers you can
use a special DHB SEND-A instead of the call SENDtfunction
SEND-ALL. With this DHB you need not note the irrelevant
parameters (see above). See Section 9.2.1 for the FB numbers of
these DHBs.
Q Siemens AG 1991 C79999-B8576-C294-01
Command Interpreter Operations
Example
6.3.5
The command "TYPE MYFILE" is to be executed on the CP 580 on the S5-135U
programmable controller by means of a CPU depending on a set input signal 1 127.0
(switch):
- The command is only to be executed at the rising edge of the input signal
-
1 127.0.
The CPU is the only one in the programmable controller and has the CPU
number "1".
The command is programmed in DB 5 starting at data word 10. In order to
program a "Zero termination" easily, the command string is extended by a
space and the word following the string defined by the instruction "KH =
0000" with two binary zero bytes. The complete command to be transmitted thus has a length of 8 words (see Fig. 6.2).
The STEP 5 program for this task consists of the following parts:
a) The CPU must be synchronized with the CP 580 in the restart blocks OB
20121122. The DHB SYNCHRON is called in F6 111 for this purpose. The PLC
goes to STOP if synchronization has not been achieved after a maximum of
three calls of the DHB SYNCHRON (approx. 30 S).
(The CP 580 requires more time to run up than the CPU; therefore provide a
program loop for several attempts.)
b) The DHB SENDIfunction SEND-DIRECT is called in OB 1 following edge evaluation of the input switch 1 127.0. The command is transmitted by means of the
DHB SENDIfunction SEND-ALL.
c) Data block D6 5 with the command starting at DW 10.
The DHBs to be used for the CPU 928B have the following function block numbers:
DHB SYNCHRON:
DHB SEND:
8 Siemens AG 1991 C79MX)-B8576-CZC4-01
FB 125
FB 120
Command Interpreter Operations
a) STEP 5 operations in OB 20, OB 21, OB 22:
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
NAME
REP
:JU FBI11
: CPSYNC
:
KF + 3
STEP 5 OPERATIONS FOR DATA
EXCHANGE WITH CP 580:
CALL SYNCHRON BLOCK
NUMBER OF ATTEMPTS
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
Function block FB 111 :
SEGMENT1
NAME : CPSYNC
DECL
: REP
I/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KF
:L
KF +O
:T
FW 10
INITIALIZE LOOP COUNTER
LOOP :JU
FB 125
DHB SYNCHRON
NAME :SYNCHRON
SSNR
:
KY 0,16
INTERFACE NO. OF CP 580 (PAGE NO. = 16)
BLGR
:
KY 0,O
FRAME SIZE = 256 BYTE
:
FY 12
ERROR BYTE
PAFE
:L
KB 0
:L
FY 12
: != F
SYNCHRONIZATION SUCCESSFUL?
: JC
= END
YES: LEAVE BLOCK
:L
FW 10
INCREMENT ......
:I
1
... LOOP COUNTER ...............
:T
FW 10
...
FW 10
: LW
= REP
REPETITION FACTOR ...............
:<=F
...
5 LOOP COUNTER FACTOR?
: JC
= LOOP
NEW ATTEMPT
: STP
PLC = STOP
END
:BE
Command Interpreter Operations
b) STEP 5 operations in OB 1 :
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
:A
: AN
.-
STEP 5 OPERATIONS FOR DATA
TRANSFER WITH CP 580:
EDGE EVALUATION OF
INPUT SIGNAL
:S
: AN
:R
NAME
SSNR
A-NR
ANZW
QTY P
DBNR
QANF
QLAE
PAFE
NAME
SSNR
A-NR
ANZW
QTY P
DBNR
QANF
QLAE
PAFE
:A
: JU
: SEND
INTERFACE NUMBER
JOB NUMBER = 209
STATUS WORD
SOURCE: DATA BLOCK 'DB'
DB 5
WORD No. 10 ONWARDS
READ 8 WORDS
PARAMETER ERROR
: JU
: SEND
CALL SENDIFUNCTION SEND-ALL
PAGE NO. = SSNR = 16
SEND-ALL ID
STATUS WORD
NO SIGNIFICANCE
NO SIGNIFICANCE
NO SIGNIFICANCE
NO SIGNIFICANCE
PARAMETER ERROR
STEP 5 OPERATIONS FOR
OTHER FUNCTIONS
O Siemens AG 1991 C79000-B8576-C204-01
Command Interpreter Operations
c) Data block DB 5:
(see also Fig.6.2)
OTHER COMMAND
10 :
17 :
18 :
19 :
KS = 'TYPE MYFILE ':
KH = 0000:
COMMAND CHARACTER + 1 SPACE
TERMINATE WITH BINARY ZERO
FURTHER COMMANDS
Command lnterpreter Operations
6.3.6
Activation and Testing of the Command lnterpreter
6.3.6.1
Activation
You can activate the command interpreter (initially for the test) once you have carried
out all preparatory measures on the CPU and CP 580:
Make sure that the entry for loading the CPIDHB driver (CPDHB) is present in
the AUTOEXEC.BAT file in the main directory of the CP 580 hard disk. l)
Trigger a warm restart on the CP 580 in order to start the CPIDHB driver. l )
Carry out a warm or cold restart on the CPU in order to synchronize it with the
CP 580.
Start the command interpreter on the CP 580 by entering the CPSHELL
command (if you have already debugged use of the command interpreter and
wish to automatically start it during a system restart or warm restart, you must
enter the CPSHELL command in the AUTOEXEC.BAT file in the main directory
of the CP 580 hard disk).
The command interpreter outputs the following message on the monitor when
started:
CP 580 S5 command interpreter Vx.x
Copyright (c) Siemens AG 1991
CPSHELL ready
MS-DOS commands are now sent to the CP 580 from the CPU which you have
programmed for the command interpreter application and according to the conditions
defined by you, and then executed. The commands are output on the CP 580 monitor
as with a keyboard input.
l) If the load command for the driver has been removed from the AUTOEXEC.BAT file for
a specific reason, you can load the driver by entering CPDHB on the keyboard.
O Siemens AG 1091 C79999-B8576-Cm-01
Command Interpreter Operations
If messages are output by the called MS-DOS function l ) or the started program,
these also appear on the monitor.
The program CPSHELL is terminated by pressing the ESC key
6.3.6.2
Testing
Proceed in steps to establish whether a command stored on the CPU is sent correctly
to the CP 580 and executed:
1. Store a simple, "non-dangerous" MS-DOS command in a data block on the CPU.
For example, you can output the AUTOEXEC.BAT file from the main directory of
the hard disk on the monitor using the command "TYPE AUTOEXEC.BAT" (to
ensure that the string has an even number of characters, enter a space after the
command in the data block; this has no effect when the command is executed).
2. Generate the STEP 5 program such that the command is triggered by an input
(keyboard).
3. Check that calling of the DHBs SYNCHRON, SEND-DIRECT and SEND-ALL are
executed on the CPU without error bits (see Section 6.4).
4. Check that the command appears on the monitor of the CP 580 and that the
AUTOEXEC.BAT file is output.
If the command is not correctly transmitted to the CP and executed, you must
evaluate the status bits stored by the DHB in the PAFE and in the status words,
correct your program as necessary, and repeat the test.
')seeSection 6.5 for handling of acknowledgement signals.
6 - 22
O Siemens AG 1991 C79000-B8576-C2W-01
Error Bits
6.4
Error Bits
You can evaluate the bits of the data handling blocks in order to test your STEP 5
program for use of the command interpreter. Two types of bits are available:
Parameter assignment error bits
Job status bits
6.4.1
Parameter Error Bits
All data handling blocks check the transferred parameters for syntax and logical
errors when called. In addition, they check whether the addressed interface is
available for the triggered function.
Whether parameter errors have occurred and which ones can be seen from the status
byte whose address you have specified by the parameter PAFE when calling the
DHB:
Error byte PAFE:
Bit No.
7
,
I
Cause of error
= Common flag:
0:
1:
no error
parameter error, more details in bits 4 to 7
Table 6.5 lists all bits which can be stored by the data handling blocks in the PAFE.
O Siemens AG 1991 C79XX)-B8576-CX)4-01
Error Bits
Table 6.5
Parameter assignment error bits
81 H
lnterface not ready
91H
Interface overloaded
A1 H
Dependent on CPU
B1H
Job number illegal or frame size (SYNCHRON) illegal
C1H
lnterface does not react, or interface does not react at correct time, or
interface rejects job
D1H
Dependent on CPU
E1H
Dependent on CPU
F1H
Dependent on CPU
-
Q Siemens AG 1991 C79000-085?6-C204-01
Error Bits
Job Status Bits
6.4.2
When using the command interpreter, bits are set in two declared status words by the
DHB SEND and the CPSHELL program via the CPIDHB driver. You have defined the
initial address of the status words in the parameter ANZW in the DHB calls.
Some of the status bits of the DHB SENDflunction SEND-DIRECT are of importance
for the test. These status bits are explained later. You can obtain more information on
the DHB status bits from Chapter 9.
The status words of DHB SENDISEND-DIRECT have the following format:
Bit No. 15
12 11
4 3
CPSHELL
error no.
ANZW
ANZW+I
8 7
I
Number of transmitted bytes
0
Stat~sb~tsfrom
1
Flags from job management (bit nos. 0 t o 3):
You can obtain the respective status of command processing from these status bits:
Table 6.6
Bits from job management
If bits 1 and 2 are set simultaneously in the status word, you cannot send jobs to the
CP 580 for the respective job number. Remember this response during the restart of
your S5 program (see also Section 9.2.8).
O Siemens AG 1991 C79000-08576-CX)4-01
6 - 25
Error Bits
Special flags of the CPSHELL program (bit nos. 8 to 11):
If the CPSHELL command interpreter determines when processing a command that
this cannot be executed without an error, it sets error bits in the first status word of
the two CPU words addressed with ANZW.
Table 6.7 shows you the status bits which may occur when processing a command.
Table 6.7
Error bits from the
CPSHELL command interpreter
Q Siemens
AG 1991 C79000-88576-C2CY1-01
Special Features Durina Command Intermetation
6.5
Special Features During Command Interpretation
You must observe the following special features during processing of a command
when selecting commands or programs which you wish to execute or start using a
CPU:
User programs:
A command interpretation is only terminated when a started program has been
terminated (only then can a new command be sent by a CPU).
This requires that a user program can only wait for an operator input if a
keyboard is present on the CP 580.
Handling of MS-DOS acknowledgement bits:
If a bit is to be output which can be acknowledged by MS-DOS, because e.g. a
floppy disk is not present in an addressed drive, this output is suppressed by
CPSHELL. A bit is set in the first status word of the DHB call SEND on the CPU
from which the command was sent (see Section 6.4.2).
Commands from several CPUs
If you wish to use the command interpreter from several CPUs, you must
coordinate the command output of the individual CPUs. Refer to the description
of your programmable controller in order to learn how this is carried out.
Caution
A
Data losses may occur in the event of uncoordinated execution of
certain commands (e.g. COPY) from several CPUs.
O Siemens AG 1991 C79900-B6576-C294-01
Contents
Instructions
Contents, Page Overview
How to Use this Manual
C79000-88576-C204
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
-
Free Programming of the CP 580
Application Examples
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
Contents
Contents
.........................................................
7
Free Programming of the CP 580
7.1
Application
7.2
Procedure
7.2.1
7.2.2
Summary ...................................................................................................
7-4
Analysis of Task ........................................................................................
7-5
7.3
Programming of DHB Calls ....................................................................7-7
..........................................................................................
...........
.
.
.............................................................................
7-3
7-3
7-4
General Information................................................................................
7-7
Available Data Handling Blocks ................................................................7-8
Parameters of the Data Handling Blocks ............................................. 7-9
7-10
Parameter Description.............................................................................
Direct and Indirect Parameterization .................................................... 7-16
Indirect Parameterization of SSNR. A.NR. ANZW and BLGR ................7-16
Examples of Indirect Parameterization................................................. 7-17
lndirect Parameterization of QTY PJZTYP. DBNR. QANFIZANF
and QLAEJZLAE......................................................................................
7-20
Format and Meaning of the Status Word ............................................... 7-22
.
...................... 7-23
Meaning of Status Bits (Bit Nos. 0 to 7) ....................... .
Meaning of Error Numbers ...................................................................... 7-25
Length Word ....................
.
.
.................................................................7-26
.
.
......... 7-27
Status Word "Parameter Assignment Error (PAFE)"...............
SEND Block ...............
.
..........................................................................
7-28
Description of the SEND-ALL Mode ........................................................
7-29
7-30
Description of the SEND-DIRECT Mode .................................................
RECEIVE Block .....................................................................................7-31
Description of the RECEIVE-ALL Mode ............................................ 7-32
Description of the RECEIVE-DIRECT Mode ........................................... 7-33
FETCH Block .......................................................................................... 7-34
Description of the FETCH Function........................................................ 7-35
O Siemens
AG 1991 C79XKl-B8576-C294-01
Contents
CONTROL Block .....................................................................................
7-36
RESET Block...........................................................................................
7-37
SYNCHRON Block ..................................................................................
7-38
Programming the CP 580 User Program
........................................
7-39
CPIDHB Driver ........................................................................................
7-39
Installation and Calling ...........................................................................
7-40
Parameterizing the CPJDHB Driver ........................................................7-41
Transfer Control Block (TCB) ..................................................................
7-43
DHB Description......................................................................................
7-44
Transmission Parameters.......................................................................
7-45
Extended Transmission Parameters ...................................................
7-49
Parameters for the Buffer Area ................................................................
7-49
Summary of Driver Functions..................................................................
7-50
Example of Call of CPJDHB Driver ........................................................ 7-52
Direct Transfer with Direct Jobs ..............................................................
7-54
Direct Job Sequence ............................
.
.
..........................................7-54
TCB for Transfer Functions with Direct Jobs ...........................................
7-60
Parameterization of Driver Functions for Direct Jobs ..............................7-61
Status Codes for Direct Jobs ...............
........
.................................
7-70
Data Transfer Without Direct Jobs ...................................................
7-72
Other Driver Functions ...................................................................
7-76
MS-DOS Multiplexer Interrupt (INT 2FH) of the CPIDHB Driver .............7-77
Testing the Application .........................................................................7-79
Procedure ...........
.
.
...........................................................................
7-79
Testing the S5 Program...........................................................................
7-80
Testing the CP 580 Program ...................................................................
7-80
Representation of the S5 Data in the CP 580 Memory ...........................7-81
Error Bits of the CPIDHB Driver .......................................................... 7-83
O Siemens AG 1991 C79999-B6576-CX)4-01
Application
Free Programming of the CP 580
This chapter is intended for CP 580 users who wish to use the functions of the
CPIDHB driver and the S5 data handling blocks for special applications.
If you wish to program your own CP 580 applications, you should be well experienced
in programming S5 programmable controllers and have detailed knowledge on the
assembler language of MS-DOS assemblers.
If you are acquainted with high-level languages, it may be sufficient to have a basic
knowledge of the assembler language in addition to experience in STEP 5
programming in order to program an interface module which can be called for the
driver functions using a high-level programming language.
Section 7.2 informs you of the steps neccessary to solve your problem.
Section 7.3 provides you with an introduction to the use of the data handling blocks
for parameterization and evaluation of bits for communication between the CPU and
CP 580.
Section 7.4 informs you of the CPIDHB driver, interaction between the CPU and CP
580 and the required programming of the driver functions.
Information on testing your application can be found in Section 7.5.
7.1
Application
Free programming of the CP 580 enables you to sohe special tasks which may be
necessary for communication between CPUs and the CP 580, e.g. data transfer with
higher-level computers or operator inputs for a CPU (e.g. modification of limits).
The CP 580 program enables communication with up to 4 CPUs. The CPUs must be
plugged into the same programmable controller as the CP 580.
Q Siemens AG 1991 C79CCQ-B8576-C2C4-01
Procedure
7.2
Procedure
7.2.1
Summary
Proceed in the order recommended in Table 7.1 to solve your special application
Table 7.1
Recommended procedure to solve an application ~roblem
Measure
--
7.2.2
--
7.3
PG
--
--
7.4
Program the MS-DOS program with which you wish to handle
the communication.
CP
580
7.4
Make sure that the CPU with which you wish to exchange data
and the CP 580 are inserted in your programmable controller
and that the CPIDHB driver is loaded in the memory (TSR).
CP
580
First make an exact analysis of what communication is to take
place between the CP 580 and the CPU(s). When trying for the
1 time, only use communication with one CPU.
first
l
1
Note which data handling blocks you required to solve the
communication task and how these are parameterized.
Program your STEP 5 program with calls of the required DHBs.
Note for the CP/DHB driver:
- How is it called by an MS-DOS program?
- What is the interaction with the DHB?
- When must it be called?
- With which DHB does it cooperate?
- How must it be parameterized?
Test the correct execution of your STEP 5 program initially
without your MS-DOS program but with the CPIDHB driver
(synchronization of CP 580 with CPU).
7-4
PG/
CPU/
CP
2.2.3
and 7.4
7.5
O Siemens AG 1991 C79000B8576-Cm-01
Procedure
data handling blocks on the CPU.
with several CPUs.
7.2.2
Analysis of Task
Before you read further in the next sections which functions of the data handling
blocks and the CPIDHB driver you require and how you should program your
application, first answer the following questions with respect to the task:
Is communication to take place with one or several CPUs?
(If communication is to take place with several CPUs, first answer the rest of the
questions for one CPU and implement the communication for this one. When this
takes place correctly, repeat the analysis for several GPUs.)
In which direction are data to be transmitted?
a) From the CPU to the CP 580 (CPU sends data)?
b) From the CP 580 to the CPU (CPU receives data)?
c) In both directions (CPU sends and receives data)?
How large is the data volume to be exchanged with one process (job)?
Q Siemens AG 1991 C79000-B8576-C2W-01
Procedure
Once you have answered these questions, inform yourself first in Section 7.3 on the
functions of the data handling blocks (DHB). Define which DHBs you require taking
into consideration your replies to the questions, and program or modify your STEP 5
program. You can then draft and generate your MS-DOS program for communication
in accordance with the DHB calls in your STEP 5 program and after studying Section
7.4.
-
Note
The system programs supplied for "Mass storage functions" and
"Command interpreter" occupy the following job numbers for your
applications:
- Mass storage functions:
1 to 99
20 1
207
- Command interpreter:
209
If you require job numbers for your applications (only with so-called
"direct" jobs) and wish to use one of the system programs in
addition to your application, you must not assign the corresponding
job numbers.
-
Q Siemens AG 1991 C79000-B8576-C2W-01
Programming of DUB Calls
7.3
Programming of DHB Calls
Detailed knowledge on the data handling blocks (DHB) is required in order to program
data transfer functions with the CPIDHB driver. The most important characteristics of
the DHBs which you require for programming are explained in the following
subsection. Information on the properties of DHBs which affect programming of the
CPU, e.g. the various sizes of the areas, can be obtained from the DHB descriptions
for the various programmable controllers (see Reference Literature).
7.3.1
General Information
Communication between the S5 CPU and the CP is via the so-called page area
which is present on the S5 bus at address F400H and which occupies an address
area of 1024 bytes. The S5 CPU accesses the dual-port RAM of the CPs via this
address. Data transfer between the CP and the S5 CPU is via this dual-port RAM. A
so-called vector register is required since all pages of all CPs are present in the same
address area. The CPU writes the number of the desired page into the vector register
before accessing the page area. The page number (also referred to as the interface
number) must be set on the respective CP using a switch assembly. All CPs in a PLC
must occupy different page numbers, otherwise there will be address conflicts.
The previously described sequence is completely handled by the data handling
blocks. It is only necessary to define the interface number (SSNR) when
programming a DHB. The DHB automatically selects the page.
A data handling block can only exchange a limited quantity of data with the CP during
a cycle. This quantity is referred to as a data frame. You can set the frame size in
various steps from 16 to 512 byte using the DHB SYNCHRON (see Sections 7.3.4
and 7.3.12). If the quantity of data to be transmitted is larger than the selected frame
size, several CPU cycles are required in order to transfer all the data.
O Siemens AG 1991 C79000-B8576-C2W-01
Programming of DHB Calls
7.3.2
Available Data Handling Blocks
SEND:
The SEND block is able to transmit data areas from the CPU to the CP. The
SEND block can transmit a maximum of one data frame.
SEND-ALL:
A special operating mode of the SEND block is SEND-ALL. The CPIDHB driver
can use the SEND-ALL mode to request the SEND block to transmit data areas
from the CPU to the CP. The CPIDHB driver defines the address of the CPU
data.
RECEIVE:
The RECEIVE block can transmit data areas from the CP to the CPU. Like the
SEND block, a RECEIVE block can only transmit one data frame.
RECEIVE-ALL:
A special operating mode of the RECEIVE block is RECEIVE-ALL. The CPIDHB
driver can use the RECEIVE-ALL mode to request the RECEIVE block to transmit data areas from the CP to the CPU. The CPIDHB driver defines the address
of the CPU data.
FETCH:
The FETCH block itself cannot transmit data. RECEIVE-ALL is always required
here for the actual data transfer. The FETCH block is only used to trigger the CP
to supply and transmit the required data.
Programming of OH5 Calls
SYNCHRON, RESET, CONTROL:
These data handling blocks are not directly involved in data transmission. They
handle auxiliary functions which are described in more detail in the following
sections.
7.3.3
Table 7.2
Parameters of the Data Handling Blocks
Parameters of the data handling blocks
. ...........................
. . ... .. . . .
..........................................................
,;: .......................
::::::::::::::., .".. <,,A: :,.,:'::<:.:::::::::::::::::::::::::::::::::::::::::.~::::::::,::,:.:::.:::::,,:.?:::A,:.::;:
...:..:...:.:.,.:.:.:
....:..::::.,:.::,:::.: :::.:::::::.::::::: .:,. . . . ,.:: .;.:.;j.:.j:,;:;j:;jjjjjj::
..........................................
.............................. .:. . ..:.:.::..:...... .... ,:c::
,.,> .................
......................................................................................................................................................................
.. : . (.: .....................
.
., .,. . . .............................
::;.;.:::.',:;..
.. . .
...
. . . . . . .. . .. .. .. .... .. .. .. .. . . . .: ..................................................
. .:.:.:.:.......:.:....:.. . . . . . . . . . . . . .,:::::,:
. . . . .:>.: . . ...................................
. . . . ..............................................................
..... . .. ... . . . . .::,,..,.
. . . . ...............................
. . . . . . . . . . . . . . ........................................
. . . . . . ...............................................................................
. . . . . . . . . . . . . . . . . . . . .:.:;:::::::::::::.:
. . . . . . . .... ............. . . . . . . . . . . . . . . . . .
D&ignat[on?II;z,;j
$i.iiiii::l::i;.;:;~J~~;~li:i'~:i;il;j::i~:;~~:~;:i:i<:i~;;
..I
SSNR
Interface number (page number)
A-NR
Job number
ANZW
Status word
QTY PIZTYP
Type of data source or data destination
DBNR
Data block number
QANFIZANF
Relative initial address within the area
QLAEIZLAE
Number of source data or destination data
PAFE
Parameter error
BLGR
Frame size
C
3 Siemens AG 1991 C79000-B8576-C204-01
Programming of DHB Calls
7.3.4
Parameter Description
The formal operands which must be assigned when using the data handling blocks
have the following meanings:
SSNR - interface number:
The parameter SSNR is used to define the logical number of the interface (page) to
which the respective job refers.
y
=
0..255
y
=
0..255
Direct parameterization
Interface number (page number)
Indirect parameterization
Data word number. The parameters
SSNR A-NR and ANZW are stored in
t DB starting with the specified
O Siemens AG 1991 C79999-B8576-C294-01
Programming of DHB Calls
A-NR - job number:
The jobs for an interface are differentiated by this number.
y = 1..223
Parameter X is irrelevant
ALL mode selected (not with FETCH)
Direct mode selected with the number of
the job to be executed.
ANZW - status word:
Use this parameter to enter the address of a doubleword in which the processing
status of a specific job is displayed. Section 7.3.6 explains the evaluation of the status
word.
0..255
Address of status word with direct
Note
Note that the status word always occupies two words or four bytes.
The data handling blocks cannot detect whether the assignments
overlap.
O Siemens AG 1991 C79999-B8576-C204-01
Programming of DHB Calls
QTYPIZTYP - Type of data source or data destination:
Assign these parameters with ASCll characters which define the type of data source
(with SEND) or the data destination (with RECEIVE or FETCH).
Direct parameterization:the data on
the data sourceldestination directly
affect the parameters QTYPIZTYP,
DBNR, QANFIZANF, QLAEIZLAE.
KS = NN
Without parameterization: no data
on the data source or destination. The
effect of the job is determined only by
the job number.
KS = XX
Indirect parameterization: either the
parameter set for the data source or
that for the data destination is present
in a data area specified by the
parameters DBNR and QANFIZANF.
KS = RW
Indirect parameterization: two
parameter sets are always present in
a data area specified by the
parameters DBNR and QANFIZANF:
O Siemens AG 1991 C79090-B8576-C204-01
Pioarammina of DUB Calls
DBNR - data block number:
If you wish to assign DB, RW or XX to the parameters QTYPJZTYP, you musi define
the number of the desired data block with this parameter.
y = 3 to 255 Number of the data block in which the
data are present. DBNR is only relevant
to data blocks (DBJDX).
An exception is the area AS (absolute
addresses) with the CPU 9$6/94;~here
the remaining addresses 2 to 2 are
stored in DBNR.
QANFiZANF - initial address of data block of source or destination:
With indirect parameterization - assignment of RW or XX to QTYPJZTYP - enter the
number of the DW here at which the parameter block commences.
With direct parameterization, QANFIZANF refers to the defined area.
start of the area.
ZANF is used analog to QANF to specify the
destination data area.
The permissible range of values depends on the CPU
used. Please refer to the DHB description for your
O Siemens AG 1991 C79000-B8576-C2W-01
Programming of DHB Calls
QLAElZLAE - length of data block of source or destination:
In the case of direct parameterization, the length is understood as the number of
bytes or words depending on the specification of the source or destination type.
QLAE is used to define the length of the source data
area, ZLAE the length of the destination data area.
The permissible range of values depends on the CPU
used. Please refer to the DHB description for your
-1 means "joker length"
With RECEIVE, all the data delivered by the
has been reached.
BLGR - frame size:
This parameter defines the maximum size of the data frame which can be transferred
between the PLC and the CP in one DHB cycle. It is only relevant to the SYNCHRON
block. The execution time for the data transfer mainly depends on the defined frame
size. Using the DHB description for your CPU you must decide which execution times
are possible for your special application. Note with small frame sizes, i.e. shcrt
execution times, that several CPU cycles may be necessary for data transfer
depending on the quantity of data.
O Siemens AG 1991 C79999-B8576-CX)4-01
Programming of DHB Calls
Param-
format
Assfgmnt
I eter type
I
Data
(byte)
/O.Y
Frame size
y=O
64 bytes for S5-115U
256 bytes for S5-135U1155U
y=l
16 bytes
y=2
32 bytes
y=3
64 bytes
y=4
128 bytes
y=5
256 bytes
y=6
512 bytes
y = 7..254 like y S 0
y = 255
512 byte
PAFE - indication with parameter error:
Enter a byte to be set when the block detects a parameter error. Evaluation of the
parameter error is explained in Section 7.3.6.4.
The size of the areas is CPU-specific
O Siemens
AG 1991 C79000-88576-Cm-01
Programming of DUB Calls
7.3,5
Direct and Indirect Parameterization
7.3.5.1
indirect Parameterization of SSNR, A-NR, ANZW and BLGR
The High byte of the parameter SSNR serves as a switchover criterion for direct or
indirect parameterization of the parameters SSNR, A-NR, ANZW and BLGR.
High byte of SSNR = 0
means direct parameterization:
SSNR, A-NR, ANZW or BLGR are directly
defined in the block called.
High byte of SSNR z 0
means indirect parameterization:
SSNR, A-NR and ANZW or BLGR are stored in
the opened data block starting at the data word
specified in the Low byte of SSNR.
SSNR and A-NR have the same data format (KY) in both parameterization modes.
The formats are different in the status word ANZW. Whereas the address of the
status word (e.g. FW 100) can be specified during direct parameterization, additional
information on the area of the status word must be specified with indirect
parameterization. This area is specified in ASCll code in the data word which
precedes the status word:
FW for status word in flag area
DB for status word in data area
The ANZW address is present in data format KY in the following data word of the
parameter area in the DB, and additionally the block number with DB (in the first byte
of the KY format).
O Siemens AG 1991 C7900O-BB576.C204-01
Programming of DHB Calls
7.3.5.2
Examples of lndirect Parameterization
The parameters
SSNR,
A-NR and
ANZW
are to be addressed indirectly.
Example 1 : A flag address is specified for the status word.
.'..I. . .
STEP 5 commands for DHB call:
..
.... ...
:C
NAME
SSNR
A-NR
ANZW
...
........
::if
....
, ,..
.:
DB 44
:JU FB 244
:SEND
:KY 255,l
:KY 0,O
:FW 0
Opening of DB 44
(FB 244 only with S5-115U)
Indirect parameterization begins at DW 1
Not relevant
Not relevant
Parameters in data block DB 44:
0:
1:
2:
3:
4:
5:
O Siemens
KY 0,l:
KY 0,31:
KS FW:
KY 0,200:
AG 1991 C79000-B8576-C204-01
Any data
DW l : the interface number is 1
DW 2: the job has the number 31
DW 3: the status word is in the flag area
DW 4: the status word is displayed
in the flag words FW 200 and FW 202
Programming of DHB Calls
Example 2: The status word is to be present in a data block.
:isi: STEP 5 commands for DHB call:
NAME
SSNR
A-N R
ANZW
:JU FB 244
:SEND
:KY 255,l
:KY 0,O
:FW 0
(FB 244 only with S5-115U)
Indirect parameterization begins at DW 1
Not relevant
Not relevant
Parameters in data block DB 24:
0:
1:
2:
3:
4:
5:
KY 0,1
KY 0,31
KS DB
KY 222,10
DW 0: any data
DW l: the interface number is 1
DW 2: the job has the number 31
DW 3: the status word is in the data block
DW 4: the address of the status word is:
"DB 222, DW l 0 and DW 11"
ANZW in DB 222:
DW 10: status word
DW 11 : length word
Programming of DHB Calls
Example 3:
The parameters
SSNR and
BLGR
are to be addressed indirectly during calling of the DHB SYNCHRON.
..............:::.
...........
.......
....
. ...... .
. .....
..
STEP 5 commands for DHB call:
....
.... .
. . ....
:C
NAME
SSNR
BLGR
DB 49
:JU FB 249
:SYNCHRON
:KY 255,100
:KY 0,O
Opening of DB 49
(FB 249 only with S5-115U)
Indirect parameterization begins at DW 100
Not relevant
Parameters in data block DB 49:
DB49
100:
101:
KY 0,10
KY 0,6
O Siemens AG 1991 C79000-B8576-C2W-01
DW 100: the interface number is 10
DW 101: the frame size is set
to 512 bytes
Programming of DHB Calls
7.3.5.3
Indirect Parameterlzation of QTYPETYP, DBNR, QANFEANF
and QLAERLAE
When parameterizing QTYP or ZTYP with RW or XX, the data on the data source or
destination are obtained from a data area. The starting address of this data area is
defined by the value of the parameter QANF.
When parameterizing indirectly with XX, the following data must be entered in the
data block defined by the formal operand "DBNR":
Table 7.3
lndirect addressing of transmission parameters
. . . . ...:,:.:.:
. . . .,<<..
. . ,::.:::::.:;:.:::::,:: .......................................... ...............
...... : : :.::... .:...:.....................................................
-........................................................................................
........;.:.:.:.:.:.,
j
.................................................
...
...........:.:.:.:.:.:j.j.:.j:j:jjj.j::::::;::I::I:Ij~;:::j:::::;:j:j:~j:.:j:j:::;:;:;:;:::::..:.:::fi:::::::::<::.:::::::::::::::
...
.....
....................................................................................................
.:::;::;,:.~da,f~&:f";
....
..
gzp&f&m-$
@:$j.~;,j~$~Am~~:"m#:~$:@$j,$~~;;:
............. .:.>::.:.:.:
.:.:.:.......................................................
.............................
.....
.....
I:.'.;.......;cr&ttp':'N~i'(;'i:i:i:i:i:
.. .. . . . . . . . . . . . . . . . . .#l.:,.i. . ;. . .;. .;. . .;. .i. .;. . .i. .~
.....
..:.........................
.. .. .. . . . . . . . . . . . . . . . .. .. .. .....;:&fgi:i'[email protected]
. . . .g
. . . .g
. . . .~
. . . .$
. [email protected]~)
: : :.:,: :,: ......... .:,:,: :;,: ..../.:5::j::::s::
:.:.:+:.......................................... :;:;::::.:::;:::;;;:j:;:;::::::;.;:;;:::;:j:::;::fij:z
..................... ;:.,:.:.:
. .>,.j:j.:.::::::
,
;,
/
/
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ,.-,., . .
,-
QANF
+O
KS
QA, AS, RS, DB, DX, IA,
FA, PY, TA, CA
Definition of type of source
or destination (QTYPJZTYP)
+1
KY
3 to 255
Number of DB with source
or destination type DB
(DBNR) (High byte = 0)
+2
KF
Range of values depends Initial address of source or
destination data area
on area and CPU
(QANFJZANF)
+3
KF
Range of values depends Length of source or
destination data area
on area and CPU
(QLAEJZLAE)
O Siemens AG 1991 C79999-B8576-C204-01
Programming of DHB Calls
In the case of indirect pararneterization with RW, the data in the data block with the
number "DBNR" must have the following contents:
Table 7.4
Parameter values with indirect addressing with RW
O Siemens AG 1991 C79000-B8576-CX4-01
Programming of DHB Calls
Format and Meaning of the Status Word
7.3.6
Information on the status of job handling is stored in the status word. You define the
address of the status word during parameterization. The information can then be read
and evaluated from there.
The status word is part of a doubleword which is addressed by the parameter ANZW.
The second part of the doubleword is the so-called length word.
-
1
12 11
15
\
V
Not used
A
1
4
7
8
"
Bit No.
3
Word n+l
Length word
0
/
Error No.
n
SENDIFETCHiREC. read without errors
/1 I- I' with errors or not yet started
I
i
1 SENDfFETCHiREC. ready with errors
0 SENDfFETCHiREC. running or ready
with errors or not yet started
/ /
1 /Data transferfacceptance running
0 I No data transfer
l)
I
I
1
1 1 Data transfer finished (SEND)
0 / Data transfer not finished
I
1 /Data acceptance finished (REC.)
0 /Data acceptance not finished
I
' 1 /Data transfer disabled
0 [Data transfer enabled
Fig. 7.1
')
Error NO. provides
further information
on cause of error
Format of DHB status words
Q Siemens AG 1991 C79999-B8576-CX4-01
Programming of DHB Calls
Note
Assign an individual status word to each job used.
If you must send two DHB calls in succession for a job (SEND SEND-ALL, FETCHIRECEIVE - RECEIVE-ALL), individual status
words must always be provided for each call since these are handled
separately by the DHBs specified.
7.3.6.1
Meaning of Status Bits (Bit nos. 0 to 7)
The status bits of the status word provide information on execution of a DHB call.
They also serve as input information for the DHB itself and then influence its
execution.
Table 7.5
Parameter values with indirect addressing with RW
0
DHB
CP application
signals data
ready
DHB
CPIDHB driver
signals start of
communication
RECEIVE
Scan whether
With Bit no. 0 = 1, data present for
communication
RECEIVE
with the CP is
started if RLO = 1
1
DHB
CPIDHB driver
signals start of
communication
DHB
CP application
signals job
processed
SENDIFETCH
Scan whether job
With Bit no. 1 = 0, finished
communication
with the CP is
started if RLO = 1
O Siemens AG 1991 C79000-B8576.C204.01
7 - 23
Programming of DHB Calls
Btt
Set
No.
Delete/
DHB evakiation
I.
user evaluation
overwrite
Continuation 1 of Table 7.5:
The CP
application
signals job
finished without
error
DHB
The CP
application
signals job
finished with
error
5
7 - 24
Scan whether job
finished without
error
DHB
If job triggered
again
DHB
If the job is
triggered again
No
Scan whether the
job was
terminated without
errors. Bit nos. 8
to 11 (error nos.)
contain more
information on the
cause of the errors
If data transfer
for a job has
been started
SENDIRECEIVE No
If data transfer for
a job has been
completed
Scan whether
data are currently
being transmitted
SEND
If data transfer
to the CP has
been terminated
SEND
If data transfer for
a new job has
commenced
Scan whether the
data block of a
new job has
already been
transferred to the
PLC and when a
new data record
can be provided
for a current job
O Siemens AG 1991 C79999-B8576-CX)4-01
Programming of DHB Calls
data block of the
7
User
Disable access
to data area
7.3.6.2
User
Enable access to
data area
SENDIRECEIVE
No data transfer
takes place with
bit no. 7=1, an
error message is
output to the CP
No
Meaning of Error Numbers
The error numbers are only valid if Bit no. 3 of the status word is set at the same time.
They influence these error numbers by means of their CP program.
Table 7.6
Meaning of error numbers
Programming of DHB Calls
7.3.6.3
Length Word
The data handling blocks SEND and RECEIVE store in the length word the number
of data (in byte) already transferred with the respective job. With the ALL functions,
the blocks SEND and RECEIVE enter the job number for which they were active in
the current cycle in the Low byte. The job number "0"(idling) means that no job was
processed. The following table indicates how the length word is influenced.
.............
................................................................................................................................
:::::::::..::::...::,:.::.::,.... ............................................................................................
.............
:,::::: ,:...
.
.
.
................................................
.:.:......... ,:.:,.:.,:.: .............................................................
................................................................................................................................................................................................................................
: : ....................
.....: : .,::: : >:., ............................................................
:.:.:.:,:,
..............
,. ..................................................................................................................................................................................................
..........................
.........................
.........................
.........................
.........................
.........................
........................
........................
..........................
........................................................
,:,:.:.:.:.:.................................................................................................................
......................................................
. . I..
:.:.:.:...:<W:::':.:.:.'.:.:.:
:....:.:.:.:.
....................................................................................................
....................................................................................
....:...::
......,.:.:::::
........... . . :.:.:.:
. . . . :c. ...:...:.:.
. . . . . .::.)..:
......................
.......:.\:...:.:.:.:.:
.......................................................................................................
. . . . . . . .......
. . .........
.....C......... .:.:............
...... . . . . ........ . . . ........ . . . . ....... . . . . ........ . . . ........ . . . . ....... . . . . ........ . . . . ....... . . . . ...... . . . . . .:...:,.:..:...:
. w ~ & ~ m~~w&fo#gfi#$:j::j:
~ @ ~ ~ , $ ~ jil;:'I':::~:~:~::,;:1jj~~1j:jjj:E$~
SENDIRECEIVE
During data transfer:
number of bytes
transmitted
SENDIFETCHIRECEIVE
By overwriting with next
job
User
If bit no. 22, 25 or 26 is
set, the current source or
destination length is
present in the length word
If bit no. 23 is set, the
length word specifies how
much data has been
transmitted up to the
occurrence of the error
O Siemens AG 1991 C79000-B8576-C2W-01
Programming of DHB Calls
7.3.6.4
Status Word "Parameter Assignment Error (PAFE)"
Bit No.
Cause of error
= Common bit:
Table 7.7
0:
1:
no errors
parameter error, more details
in bits 4 to 7
Meaning of bits in status byte PAFE
a block not present or illegal
DX 0 with QTYP = DB or DX)
O Siemens AG 1991 C79999-B8576-C294-01
7 - 27
Programming of DHB Calls
7.3.7
SEND Block
The SEND block is used to transmit data areas from the CPU to the CP. There are
two modes:
SEND-ALL
The function block serves as a substitute for a direct memory access of the CP
to the CPU.
SEND-DIRECT
Data are transmitted to the CP with a specific job number.
Example of a call of the SEND block
NAME
SSNR
A-NR
ANZW
QTYP
DBNR
QANF
QLAE
PAFE
JU
FB
SEND
KY
KY
FW
KS
KY
KF
KF
FY
xxx
0,10
0,32
14
DB
0,10
+1
+33
13
FBxxx
- SSNR
SEND
- A-NR
- ANZW
- QTYP
- DBNR
- QANF
- QLAE
PAFE
Programming of DHB Calls
7.3.7.1
Description of the SEND-ALL Mode
The block requires the following parameters for this function:
SSNR Interface number
Job number (preset to "0")
A-NR
ANZW Specification of status word
PAFE Specification of error byte
All other parameters are irrelevant with this job. A value must nevertheless be entered
for the irrelevant parameters but it is not evaluated by the data handling blocks.
The following parameters are transferred by the CPIDHB driver to the SEND-ALL
block during communication:
Address of status word of the direct job responsible for triggering
Specification of data type
Number of data
Initial address of data area.
The following bits are evaluated or modified in the status word of the associated job:
Bit No. 7: data transfer disabled
Bit No. 5: data transfer finished
Bit No. 4: data transfer running.
The number of data to be transmitted for the respective job is indicated by the block
in the length word which follows the status word of the associated direct job.
The SEND block must be called at least once per interface in the control program in
operating mode "ALL" if:
The CP 580 can automatically request data from the CPU, e.g. if you use the
CPRECORD program.
A job is triggered by SEND-DIRECT, but the application only requests data from
the CPU with the assistance of background communication.
The quantity of data to be transferred to the CP using SEND-DIRECT is larger
than the frame size set.
O Siemens AG 1991 C790M)-BB576-C2W.01
Programming of DHB Calls
Note
With the S5-135U and S5-155U programmable controllers you can
use a special DHB SEND-A instead of the call SENDIfunction SENDALL. With this DHB you need not note the irrelevant parameters (see
above). See Section 9.2.3.2 for the FB numbers of these DHBs.
7.3.7.2
Description of the SEND-DIRECT Mode
The direct mode operates with the following parameters:
SSNR Interface number
A-NR
Job number
ANZW Specification of status word
PAFE Specification of error byte
QTYP Source type
DBNR Number of data block
QANF Initial address of source
QLAE Number of source data
The direct mode is generally called in the cyclic part of the CPU program. The block
can also be called during interrupt or alarm processing, but the status word is then not
updated cyclically. This function must then be handled by the CONTROL block.
Two conditions must be fulfilled for data transfer or activation of the SEND job:
RLO = 1 was transferred to the function block
Bit No. 1 = 0 in the status word
Only the status word is updated if RLO = 0 (idling) is transferred.
Proorammina of OHB Calls
7.3.8
RECEIVE Block
The RECEIVE block is used to receive data from the CP by the CPU. There are two
modes:
RECEIVE-ALL
The function block serves as a substitute for a direct memory access of the CP
to the CPU
RECEIVE-DIRECT
Data are transmitted to the CPU with a specific block number.
Example of a call of the RECEIVE block
NAME
SSNR
A-NR
ANZW
ZTYP
DBNR
ZANF
ZLAE
PAFE
:
:
:
:
:
:
:
:
:
JU
FB
RECEIVE
KY
KY
FW
xxx
KS
DB
- ANZW
KY
KF
KF
FY
0,10
+l
+33
13
- ZLAE
O Siemens AG 1991 C79000-BB576-C2W-01
0,10
0,32
14
FBxxx
- SSNR
RECEIVE
A-NR
- ZTYP
- DBNR
- ZANF
PAFE -
Programming of DHB Calls
7.3.8.1
Description of the RECEIVE-ALL Mode
The block requires the following parameters for this function:
SSNR Interface number
A-NR
Job number (preset to "0")
ANZW Specification of status word
PAFE Specification of error byte
All other parameters are irrelevant with this job. A value must nevertheless be entered
for the irrelevant parameters but it is not evaluated by the data handling blocks.
The following parameters are transferred by the CPIDHB driver to the RECEIVE-ALL
block during communication:
Address of status word of the direct job responsible for triggering
Specification of data type
Number of data
Initial address of data area.
The following bits are evaluated or modified in the status word of the associated job:
Bit No. 7: data transfer disabled
Bit No. 6 : data receive finished
Bit No. 4: data receive running.
The number of data to be transmitted for the respective job is indicated by the block
in the length word which follows the status word of the associated direct job.
The RECEIVE block must be called at least once per interface in the control program
in operating mode "ALL" if:
The CP 580 can automatically send data to the CPU.
A job is triggered by FETCH, and the application transmits the data to the CPU
with the assistance of background communication
A job is triggered by RECEIVE-DIRECT, and the application transmits the data to
the CPU with the assistance of background communication
The quantity of data to be received by the CP using RECEIVE-DIRECT is larger
than the frame size set.
Q Siemens AG 1991 C79000-B8576-C2W-01
Programming of DHB Calls
Note
With the S5-135U and S5-155U programmable controllers you can
use a special DHB RECEIVE-A instead of the call RECEIVE/function
RECEIVE-ALL. With this DHB you need not note the irrelevant parameters (see above). See Section 9.2.5.2 for the FB numbers of these
DHBs.
7.3.8.2
Description of the RECEIVE-DIRECT Mode
The direct mode operates with the following parameters:
SSNR Interface number
A-NR
Jobnumber
ANZW Specification of status word
PAFE Specification of error byte
ZTYP
Destination type
DBNR Number of data block
ZANF
Initial address of destination
ZLAE
Number of destination data
The direct mode is generally called in the cyclic part of the CPU program. The block
can also be called during interrupt or alarm processing, but the status word is then not
updated cyclically. This function must then be handled by the CONTROL block.
Two conditions must be fulfilled for data receive or activation of the RECEIVE job:
RLO = 1 was transferred to the function block
Bit No. 0 = 1 in the status word
Only the status word is updated if RLO = 0 (idling) is transferred.
C
3 Siemens AG 1991 C79999-B8576-CX)4-01
Proqrammino of DUB Calls
7.3.9
FETCH Block
The FETCH block is used like the RECEIVE block to transfer data from the CP to the
CPU. The FETCH block does not have an ALL mode.
O Siemens AG 1991 C79CQJ-BB676-C204-01
Programming of DHB Calls
7.3.9.1
Description of the FETCH Function
All parameters must be assigned when calling FETCH. The destination parameters
(ANZW, ZTYP, DBNR, ZANF, ZLAE) are transferred to the CPU during the
acknowledgement. As soon as the application has collected the required data at the
CP end, they are transferred to the CPU using a RECEIVE-ALL. The FETCH block
itself does not transmit or accept any data.
The FETCH job is activated if the following conditions are satisfied:
RLO = 1 was transferred to the function block
Bit No. 1 = 0 in the status word
Note
Note that Bit No. 1 is used in the status word for SEND and FETCH.
The FETCH block can be called from the cyclic, time-controlled or interrupt-controlled
program section. The status word is updated by the FETCH or CONTROL block.
Q Siemens AG 1991 C79099-B8676-C294-01
Programming of DHB Calls
7.3.10
CONTROL Block
The CONTROL block updates the status word for a particular job or specifies which
job is currently being processed.
Description of the CONTROL function
The following parameters are required for this function:
SSNR Interface number
A-NR
Number of job to be monitored
ANZW Specification of status word to be updated
PAFE
Specification of error byte
Assignment of parameter A-NR with 0:
The number of the last job processed is transmitted to the Low byte of the status
word. The CPIDHB driver accepts the associated job number into job line 0 with each
communication.
Processing of the block does not depend on the RLO. The CONTROL block should
be called in the cyclic part of the CPU program, however.
O Siemens AG 1991 C79099-08576-CX)4-01
Programming of DHB Calls
7.3.11
RESET Block
The RESET block deletes a job which is running via the specified interface. There are
two modes of the RESET block:
RESET-ALL
When assigning 0 to the job number, all jobs of the CPIDHB driver are deleted.
RESET-DIRECT
If the job number is + 0,only the specified job of the interface is deleted.
.............
:.:.. .........................
:... ..................................................
. .......................................................
.. .. .. . .. .. .. .... ... ............ .. ...... ................ .. ... ..:...........
:.,..........
. :..,
: ............:.:............................
..(.(:::;:, :,..;
:,:: ......:..:. .:. . . . . ..................
. . . . .:.:.:.:.:.... . .:. . . :.::.::.:..
;:j.i.: ....................... :I: : : ........................................................................
: ..............
. :.:.:.
. .. .. . .. .. .. . .. .
. ,;..
.::............................
..............
....
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
:
..
.
.
.
.
.
.
.
.
.
.
.
.
.............
.............
.. :.. S T ~ , , ?
$~~,,~~ftA~$$$$ji,:j>.;:j:ijjj.:jj.j.j.j~.j.j~~.jj.
; ;. . :... . . . ...................
,::,;.j:.ji.:j$$$<.
ji;.j.j :j:': ..........................................
.....
. . ::::::::..:. .:.., :.:.:...:.:
...........................I.'
...........
. . . . :.:...
. . ...:.:
... . . .. ............::...:
. .. ... .. .. ...:....
... .. ........
.. .. .. . .. .. .. . .. .. .. .... .. ... ..:.:....:.
. . ..:..,
. . . . ... . . . .:,:,:,:,:,:,
.. .
. . ... .. . . ..... . . ..... . . .. ... .. . .. ... .. . . ......:.:.:.
. . .. . .. :.,
. . . .. ,:,:,:::,
I.....
/
:;.:j-;.ii2.j;;;
;$;,:l
;:;
NAME
SSNR
A-NR
ANZW
PAFE
:
:
:
:
:
:
JU
RESET
FB
xxx
KY
KY
FW
FY
0,10
\
..............%
.................
FBxxx
RESET
20
24
The block requires the following parameters:
SSNR Interface number
A-NR
Number of job to be deleted
PAFE
Specification of error byte
The RESET block operates depending on the RLO and can be called from cyclic,
time-controlled or alarm-controlled program sections.
Programming of DHB Calls
7.3.12
SYNCHRON Block
The SYNCHRON block initializes the interface on the CP 580 for communication with
the data handling blocks when restarting the programmable controller. The data
handling blocks can only operate correctly following synchronization.
The following parameters must be assigned:
SSNR Interface number
BLGR Frame size
PAFE Specification of error byte
The frame size defines how many data (bytes) can be transmitted during one cycle of
SEND or RECEIVE. Since larger data quantities are divided into a corresponding
number of individual frames, the set frame size largely determines the transmission
time in the case of large quantities of data.
The SYNCHRON block must be called in one of the restart OBs (20, 21, 22).
Synchronization is only achieved if RLO = 0 was transferred to the block.
C
2 Siemens AG 1991 C79000.88576-Cm-01
Programming the CP 580 User Program
7.4
Programming the CP 580 User Program
The CP 580 user program must handle data transfer together with the DHB calls
programmed at the CPU end such that the desired communication is achieved. The
user program uses the CPIDHB driver for this purpose.
This section provides information for programming your CP 580 program:
Fundamental information on the CPIDHB driver.
When you must call the driver for which function (interaction with DHB calls on
the CPU).
How you must parameterize the driver for the individual functions.
Note
Calling and parameterizing the CPIDHB driver are described for
assembler programming. If you wish to generate your user program in
a high programming language, you must program an interface module
for this language in assembler via which you call the CPIDHB driver.
7.4.1
CPIDHB Driver
The CPIDHB driver handles the data transfer between S5-CPUs and MS-DOS
programs on the CP 580. The purpose and structure of the data to be transmitted are
of no significance to the driver. This is only concerned with the handling of the
communication protocol using the data handling blocks.
Use of the data handling blocks must be matched between the S5 application and
the MS-DOS program: the driver calls required to handle communication must be
provided for each call of a data handling block in the S5 program (see Section 7.4.6).
Q Siemens AG 1991 C79000-B8576.C201-01
Programming the CP 580 User Program
7.4.1.1
lnstallatlon and Calling
The CPIDHB driver is installed with MS-DOS as a TSR program (terminate and stay
resident). The driver program remains resident in the memory following the
installation, and MS-DOS returns to the command line. In this manner MS-DOS
enables several programs to be loaded simuRaneously in the memory. The driver
program and the application program are therefore present as separate MS-DOS
programs in the CP 580 memory. The CPIDHB driver functions are called using a
software interrupt. The interrupt number is set to 66H. Fig. 7.2 shows you a simplified
division of the CP 580 memory and the calling mechanism of the driver.
ideo RAM,VGA EPROM
Area for loadable
user programs
MS-DOS and
TSR programs
lntermot vector 66H
7
Interrupt vector table
Fig. 7.2
7 - 40
Memory assignments of CP 580 and calling of CPIDHB driver
O
Siemens AG
1991 C79000-B8576-Cm-01
Programming the CP 580 User Program
7.4.1.2
Parameterizing the CPlDHB Driver
If you call the CPIDHB driver in your program in order to execute a specific function,
you must specify the job exactly using parameters and provide the driver with means
to handle the job depending on the function. Fig. 7.3 provides an overview.
User program
TClDHB driver
1 Parametersmin registers
,
INT 66
TCB address i
Function z
Transfer control block
(TCB)
signals
Address and length
of transfer buffer
4
~
i
Transfer buffer
i
I Data
l
i
" The TCB is not required
by all functions
Fig. 7.3
Parameters and resources which must be provided by the user program for driver calls
Programming the CP 580 User Program
Direct parameters and conditions codes:
The application of direct parameters to the CPIDHB driver functions and the
return of condition codes is via the CPU registers of the CP 580.
Indirect parameters and resources:
You must provide indirect parameters (e.g. address and length of transfer buffer)
and certain resources in a transfer control block (TCB, see Section 7.4.2). An
important aid is the transfer buffer which you can provide in your program or
somewhere in the CP 580 memory.
Register set:
Fig. 7.4 shows the 8086 register set with the registers provided for parameter
transfer:
m
1-1
Fig. 7.4
= Reg~steroccup~edfor dr~verfunctrons
= Register is not modified
Register set for driver call
O Siemens AG 1991 C7900O-B8576-C294-01
Programming the CP 580 User Program
Call:
Register AX = number of desired function (see Section 7.4.3).
The registers BX, CX, DX and ES are used specific to the function
(you must store the offset in BX and the segment address of the TCB
in ES for all transfer jobs).
Result:
Condition codes for a job are transferred by the CPIDHB driver in
register AX when the called program is continued.
The unmentioned registers are not evaluated by the driver and are not modified.
7.4.2
Transfer Control Block (TCB)
If you wish to send a data transfer job to the CPIDHB driver in your program, you
must provide a transfer control block (TCB) in the program. All data relevant to the
transfer are stored in the TCB. The address of the TCB is transferred as a parameter
from the program to the driver when a transfer function is called. The TCB is
managed by the driver until the transfer is terminated.
C
2 Siemens AG 1991 C79000-B8576-C294-01
Programming the CP 580 User Program
Fig. 7.5 shows the structure of the TCB.
Bit No.:
Word
Word
Word
Word
Word
Word
Word
Word
Word
Word
Word
Word
Word
0
DHB job number
1
2
3
4
5
6
7
0
1
DHB type
DHB description
CPU number
Area identification
Transfer parameters
Area offset
Area length
RW area identification
RW DB number
I
Extended transfer
RW area off set
parameters
I
RW area lenath
l l
"
Offset buffer area
8
....
,-.
l
Segment buff er area
9
Parameters for
10
Length
buffer area
Writelread index
11
Current number of transmitted bytes
12
Fig. 7.5
!f
15
Structure of transfer control block (TCB)
The following subsections describe the meanings of the individual TCB components.
7.4.2.1
DHB Description
The DHB description determines what data handling blocks are used for
communication and also the mode. The DHB description also includes the job
number via which the data handling block handles a job.
O Siemens AG 1991 C79000-B8576-CX4-01
Programming the CP 580 User Program
DHB job number:
The DHB job number corresponds to the A-NR when parameterizing the DHB. The
meaningful range for the job number is 1 to 223. A number outside this range is
rejected.
DHB type:
Use the DHB type to specify which DHB is to be addressed and in which mode data
transfer is to take place.
Table 7.8 shows you which codes are permissible for the DHB type byte and what the
meaning of these codes is:
Table 7.8
Permissible codes of DHB type
7.4.2.2
Transmission Parameters
The transmission parameters comprise the CPU number, area identification, data
block number, area offset and area length, The S5 data to be transmitted are
addressed using the transmission parameters.
C
2 Siemens AG 1991 C79000-B8576-C2W-01
Programming the CP 580 User Program
The CPU number must always be specified by the CP 580 program. The other
transmission parameters are either specified by the S5 program depending on the
driver function or determined by the CP 580 program.
CPU number:
The CPU number defines the CPU in the programmable controller with which
communication is to take place. Since the CPUs have a fixed assignment to the
pages (see Section 3), the page number is also simultaneously defined by the CPU
number in the TCB.
Byte format with CPU number:
Bit No.: ,7
4. 3
I
0
/
0
CPU NO.
/
CPU1 :
CPU2:
CPU3:
CPU4:
CPU No. =
CPU NO. =
CPU NO. =
CPU No. =
0001
0 0 10
0 100
1000
Area identification and DB number:
The area identification defines the S5 area to be transmitted. One byte is reserved
in the TCB for the area identification. The area identification corresponds to the
parameters QTYPRTYP with the data handling blocks (see Section 7.3).
The area identification is entered by the CP/DHB driver when the job arrives in the
case of the transfer functions which operate with the direct jobs. This only takes
place, however, if the DHB has recognized that subsequent blocks are necessary or
if it is defined in the DHB type that only parameters are transferred.
You must enter the area identification in the TCB in the case of the transfer functions
which only use the DHB function "ALL" since the address of the S5 data can be
defined here by the CP 580 program.
Programming the CP 580 User Program
DB number corresponds to the parameter DBNR with the data handling blocks (see
Section 7.3). With the S5 data area DB or DX, the number of the data block to be
transferred is entered here (the entry is as with the area identification). The entry for
the DB number has no significance with all other S5 areas.
Table 7.9 explains which area identifications are permissible, what meaning they
have and how they must be coded for the TCB.
Table 7.9
Assignment of Q N P I Z l Y P to the area identifications
..............
m::..,:.;.:.:
..:,::..:,.: ...:.::::::.::::::.: :.:.:.:.:::.....:.:.:.:.......:........ . .::......................... ..:.:..:......:.:
...
:z:i.:.QnPmP;j,:
....
....
I.
..............................................................
.
.
. . .;,$h
:...
. ....... .:"ai;iikiiii'$:j:::.lj$,..,::i,
.......:......,:. .....:
.. ..:.:. ,...:.,.
. . . . . . . . . . . . .. .. ..... .. .. ... .. .:..
. . .:,,. . . . . . . . . . . .
QA
Process output image
AS
Absolute memory addresses l )
RS
System data area
DB
Data blocks DB
DX
Extended data blocks DX
IA
Process input image
FA
F flag area
PY
I10 modules
TA
Timer cells
07H
CA
Counter cells
06H
With the CPU 9461947, the arameter DBNR is used with absolute memory addresses (AS)
l
19
to specify the addresses 2 to 2 .
Area offset:
The area offset is used to specify the starting address within the selected S5 area.
The area offset is interpreted differently depending on the S5 data area since these
areas are organized differently (see Table 7.9).
O Siemens AG 1991 C79000-B8576-CX)4-01
Programming the CP 580 User Program
Table 7.10
Meaning of area offset and organization of S5 data areas
TA
Timer cell number
Word-oriented
CA
Counter cell number
Word-oriented
l ) Refer to the description of your programmable controller to see which ranges are permissible
for the various offsets.
Area length:
The area length defines the number of elements to be transmitted. As with the area
offset, it is also necessary to consider the different organization of the S5 data areas
(see Table 7.9). You must take into consideration the value of the defined offset for
the permissible number range.
Programming the CP 580 User Program
7.4.2.3
Extended Transmission Parameters
The extended transmission parameters are only significant with the DHB parameter
type RW (see Section 7.3 and description of data handling blocks). The CPIDHB
driver stores the additional parameters for this parameter type in the TCB area
"Extended parameters".
The parameter type RW can be used for SEND and FETCH, but the following
differentiation must be observed:
Applicable to SEND:
Transmission parameters:
Extended transmission parameters:
source parameters
destination parameters
Applicable to FETCH:
Transmission parameters:
Extended transmission parameters:
destination parameters
source parameters
7.4.2.4
Parameters for the Buffer Area
You must provide a sufficiently large memory area in your program or in the RAM of
the CP 580 for the useful data to be transmitted.
Offsetlsegment buffer area:
Use the parameters "Offset buffer area" and "Segment buffer area" to define the
address of the memory area into which the data are to be written or from which they
are to be read.
Length:
Use the parameter "Length" to define the size of the buffer. The value is entered as
"Number of bytes" and can be up to FFFFH.
With the size of the buffer you determine the length of the data area to be transferred
with the CP 580: the CP/DHB driver uses it to monitor the area limits. Data outside
the defined area are neither read nor written by the driver.
O Siemens AG 1991 C79000-08576-CX4r04-01
Programming the CP 580 User Program
Wrltelread index:
The CPJDHB modifies a byte-oriented writehead index when transferring data. When
transferring data into or out of the buffer by the driver, the current buffer area is
always addressed via the writetread index relative to the initial address of the buffer.
Current number of transmitted bytes:
The driver enters the current number of transmitted bytes into the TCB during
handling of a transfer job. This value is accepted by the DHB into status word 2.
7.4.3
Summary of Driver Functions
The CPtDHB driver differentiates between two types of transfer jobs:
-
Data transfer with direct jobs
and
Data transfer without direct jobs.
Data transfer with direct jobs:
If the initiative for data transmission is to be with the S5 program in your application,
you must use the direct jobs (SEND-DIRECT, RECEIVE-DIRECT and FETCH).
Data transfer without direct jobs:
If you wish to trigger data transmission from the CP 580, call a driver function "Data
transfer without direct job". In this case, one SEND-ALL or RECEIVE-ALL data
handling block is sufficient in the CPU cycle depending on the transmission direction.
Data transmission is then carried out when the corresponding driver function is called
without a direct influence of the S5 program.
O Siemens AG 1991 C79099-B6578-C204-01
Programming the CP 580 User Program
The following table provides you with a summary of all driver functions:
Table 7.1 1
Summary of driver functions
Global scan of DHB job reception
Read S5 data area
01H
Without
S5 data area
02H
Without
30H
--
Write
I
Scan driver status
O Siemens AG 1991 C79000-88576-C204-01
Programming the CP 580 User Program
7.4.4
Example of Call of CPlDHB Driver
Call a driver function from an assembler program:
TITLE
BSP1
.........................................................
tcb
dhb-t ype
dhbJ O ~ - ~ O
CPu-no
area-ident
db-no
area-offset
area-length
area-ident-rw
db-no-rw
area-offset-rw
area-length-rw
off set-buffer
seg-buffer
sizeof-byte
sl-index
size-transfer-byte
system
tcb
STRUCT
DB
DB
DW
DB
DB
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
DW
DB
24
ENDS
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
?
DUP (?)
Declare Transfer Control Block:
; TCB structure
; DHB type (SEND, RECEIVUFETCH)
; DHB job number
; CPU No.
; Area identification
; DB number
; Area offset
; Area length
; RW area identification
; RW D6 No.
; RW area offset
; RW area length
; Offset buffer area
; Segment buffer area
; Length of buffer area
; Writelread index
; Current number of transmitted bytes
; System area 24 bytes
.DATA
..........................................................
stcb
buff er
7 - 52
tcb c>
DW 2000 DUP (?)
Variable:
; TCB variable
; Buffer area 2000 words
O Siemens
AG 1991 C79000-96576-C204-01
Programming the CP 580 User Program
.CODE
START
.......................................................
mov
mov
mov
mov
mov
mov
mov
mov
mov
mov
mov
stcb.cpu-no,Ol h
stcb.area-ident,Ol h
stcb.area-offset,l d
stcb.area-length,l OOOd
stcb.db-no,l OOd
ax,SIZE buffer
stcb.sizeof-byte,ax
ax,OFFSET buffer
stcb.offset-buff er,ax
ax,SEG buffer
stcb.seg-buffer,ax
,.....................................................
; CPU No. = 1
; Area identification = 1 ( DB )
; Area offset = 1
; Area length = 1000
; DB No. = 100
; Length of buffer area
; Off set buffer area
; Segment buffer area
Call function "Read S5 area":
mov
mov
mov
mov
ax,Ol h
bx,OFFSET stcb
es,SEG stcb
cx,100d
; Function number = 01H
; Offset TCB
; Segment TCB
; Timeout parameter (100 timer ticks)
int
66h
: Driver call
cmp ax,Oh
jne error
error:
CODE
Assign relevant values to TCB:
; Function terminated without errors
; Error handling
ENDS
END START
C3 Siemens AG 1991 C79990-98576-C294-01
Programming the CP 580 User Program
7.4.5
Direct Transfer with Direct Jobs
Section 7.4.5 with its subsections explain the data transfer sequence with direct jobs
and parameterization of the CPIDHB driver calls required.
In the case of direct jobs, data transmission is initiated by the S5 program from the
CPU. The data handling blocks permit the following 3 types of direct jobs:
SEND-DIRECT
FETCH
RECEIVE-DIRECT
The jobs listed are only accepted by the CPIDHB driver if their reception was
previously registered with the driver.
Note
When transferring a TCB to the driver it is not possible to differentiate
between SEND and FETCH since the status word (ANZW) only
provides one bit in the job status for both types of DHB.
7.4.5.1
Direct Job Sequence
The two following Figs. show you the basic sequence for data transfer with
SEND-DIRECT:
Fig. 7.6: SEND-DIRECT with separate data transfer.
Fig. 7.7: SEND-DIRECT with direct data transfer.
In both cases the CP 580 program initially registers a TCB for SENDIFETCH with the
CPIDHB driver and then cyclically checks the status of the TCB. The useful data are
transmitted once a SEND job has arrived. This depends on the type of DHB which
you have specified in the TCB:
either this has already taken place when the SEND-DIRECT arrives (direct data
transfer, Fig. 7.6), or the data are explicitly transmitted with their own driver call (Fig.
O Siemens AG 1991 C79000-06576-C2Q4.01
Programming the CP 580 User Program
SEND-DIRECT
1
Start commun~catlonw~thCP
and transmlt transfer
parameters to CP
Update ANZW
( ~yes,
f
only parameters,
no data)
via SEND-ALL
Process rece~veddata
(appl~cation-speaf~c)
Start commun~catlonwith CP
and transmlt data
rqE7
Update own ANZW and ANZW
1
Fig. 7.6
1-
= CPIDHB dr~vercall
Principle sequence "SEND-DIRECT with separate data transfer"
Programming the CP 580 User Program
1-(
S5 CPU
CP580
l
Register processing of
SEND-DIRECT with
data transmission
Job runnrng 7
--
I
Start communication with CP
and transmit 1st
data block to CP
Process received data
Start communication with CP
and transmit subsequent blocks
with/without errors)
Update own ANZW and
I
of SEND-DIRECT
1
Fig. 7.7
/l
= CPlDHB driver call
Basic sequence "SEND-DIRECT with direct data transfer"
O Siemens AG 1991 C79990-B8576-C294-01
Programming the CP 580 User Program
You can process the useful data in your CP 580 program once they have been
transferred.
You must inform the S5 program of the end of transmission by means of a driver call
"Set job status". Another transmission can then usually take place immediately.
FETCH sequence:
Fig. 7.8 shows the sequence of a data transfer with FETCH:
The sequence is similar to that with SEND except that the transfer direction is
reversed.
The CP 580 program initially registers a TCD for SENDIFETCH with the driver. It then
waits until the required FETCH job has been placed by the S5 program at the CPU
end.
Once the CP 580 program has recognized that the job has been received, it must
provide the data required for the transfer and send these to the CPU.
You must inform the S5 program of the end of the transmission as with
SEND-DIRECT by means of a driver call "Set job status". The next job can then
usually be processed immediately.
Programming the CP 580 User Program
S5 CPU
CP580
FETCH
L
No
RLO = l ?
Reglster processing
Start communicat~onwith CF
and transmit transfer
parameters to CP
I
4
Update ANZW
(rf yes, only parameters
c->;#-
Supply required data
(application-speafic)
Start communicat~onw~thCP
and transmit data
Update own ANZW and ANZW
of FETCH
I
Fig. 7.8
= CPIDHB drlver call
Basic sequence FETCH
G
3 Siemens AG 1991 C79009-B8576-C294-01
Programming the CP 580 User Program
RECEIVE-DIRECT job:
S5 CPU
CP580
l
Provide data
(application-specific)
Update ANZW
RECEIVE-ALL
transmit subsequerit blocks
of RECEIVE-DIRECT
BE
Fig. 7.9
O Siemens
Basic sequence RECEIVE-DIRECT
AG 1991 C79000-88576-C204-01
m.:)i.j,:)i.j):,j.j).:i
CPIDHB driver call
Programming the CP 580 User Program
Fig 7.9 shows the sequence of a data transfer with RECEIVE-DIRECT:
As with SEND and FETCH, you must first register a TCB with the driver in your CP
580 program. The DHB description of this TCB must contain the code for the
RECEIVE block, however.
Once the data for the transmission are ready at the CP end, the CP 580 program
must indicate to the S5 program that it is ready for communication by means of a
corresponding driver call "Set job status".
The useful data are then usually transmitted directly to the CPU when the RECEIVE
call arrives, i.e. the data used have already been transmitted when the user program
detects that a RECEIVE job has arrived.
The CP 580 program then signals using "Set job status" that the job has been
finished, and the sequence can begin again.
7.4.5.2
TCB for Transfer Functions with Direct Jobs
You must enter the following parameters in the TCB for transfer functions with direct
jobs:
Number of CPU with which the data are to be exchanged
DHB description
DHB job number for the job to be handled
Address (offset and segment) and length of the buffer area.
If your CP 580 program is to handle different direct jobs, you must register a transfer
control block with the CP/DHB driver for every job present in it. It is only possible to
wait for one direct job with one TCB.
O Siemens AG 1991 C79000-B8576-C2C4-01
Programming the CP 580 User Program
The transmission parameters for area identification, DB number, area offset and area
length result from the parameter settings of the DHB in the S5 program at the CPU
end and are entered from the CPIDHB driver into the TCB during handling of !he job.
The following table shows you the assignment between the parameter settings of the
DHB and the resulting transmission parameters:
Table 7.12
Assignment of DHB parameters to TCB transmission parameters
....
.....................................................................
::.:::, ,::::::::.,,.:.,: :.::.:.:
.. ,.:..:... . . . . . . . ... . .: .:.. ....)... . .......
. ..,.:.;,
. . . . . .. . .>... ...........................................................
. . . :..... . ....
. . ..... . . ..... . . .. ... . . .. ... .. . . . . . .............................................................................
:::,::::,,,:,:::::.......................... ...................
:,:.:. ,j:j:j:j:f:::::::::::::,:.;...:. ............."
,.:,.:::.:
: ;,,:::
......................
:::::::::::.,. I. . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
:.
.
..................................................................................................
.
. . . . ..... . . . . ..... . . . . . . . . ,. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.,.>. ...................................
. . . . . . . . . . . . . . . . . . . . . . . . . . .. :...
. . . . . .....:.:.::..:.::;:
. . . . . . ................
.................................
....ens p ~ r a m ~ ~ e. . 2. .r. ~. .:. .~.:. .;.~.,. .f.;...:.~,.. . i ;: : ,
7.4.5.3
; . ~p Cf i~:
~ m ?...............
~~r:~:;
QTYPJZTY P
Area identification
DBNR
DB number
QAN FJZANF
Area offset
QLAEJZLAE
Area length
(
Parameterization of Driver Functions for Direct Jobs
This subsection lists the driver functions you require for direct jobs and explains how
you must parameterize the driver calls for these functions.
Before calling a driver function you must assign parameters to the TCB as described
in Section 7.4.5.2.
O Siemens AG 1991 C79000-B8576-C294-01
Programming the CP 580 User Program
Log on job reception:
Application:
This function is used to register a TCB for reception of direct jobs. Your CP 580
program can only wait for one specific DHB job with one TCB. A job must only be
registered once.
Call parameters:
Register AX:
Register BX:
Register ES:
Function no. = 11H
TCB addressloffset
TCB addresstsegment
Condition codes:
Register AX:
0:
Negative:
function has been terminated successfully
function has been aborted following an error:
- 2: CPU is not synchronized
- 3: CPU number is incorrect
- 6 : DHB type is incorrect
- 7: TCB is already logged on
- 9: job number is too high
-10: job number is already in use
The registers which are not listed are not modified by the driver.
C
2 Siemens AG 1991 C79909-B8576-C204-01
Programming the CP 580 User Program
Iscan TCB status:
I
Application:
Once you have registered reception of a job in your CP 580 program, you must first
check (except wth RECEIVE-DIRECT) whether a direct job has arrived in order to
then send or receive data. The function "Scan TCB status" is available for this
purpose.
When handling a data transfer with RECEIVE-DIRECT, you must use the function
following provision of the data and setting of the status to scan whether the data have
been fetched by the CPU.
The driver checks the status of the defined TCB once the function has been called. If
a direct job has arrived, the driver provides more detailed information on the job in
AX.
The TCB addressed in the call must previously have been transmitted to the driver for
management using the function "Log on job reception".
Call parameters:
Register AX:
Register BX:
Register ES:
Function no. = 16H
TCB addressloffset
TCB addresslsegment
Condition codes:
Register AX:
Positive:
E
2 Siemens AG 1991 C79000-B8576-CX)4.01
10:
11:
12:
13:
14:
15:
16:
17:
18:
TCB waiting
SEND job has arrived
RECEIVE job has arrived
FETCH job has arrived
SEND job with RW parameters has arrived
FETCH job with RW parameters has arrived
SEND job with NN parameters
RECEIVE job with NN parameters
FETCH job with NN parameters
Programming the CP 580 User Program
Register AX:
Negative:
Function was aborted following an error:
TCB not logged on
-51: aborted by negative acknowledgement
-52: aborted because data area not accessible
-53: buffer too small
-54: aborted by SYNCHRON
-55: aborted by RESET
-56: unexpected response with FETCH
-57: unexpected response with RECEIVE-DIRECT
-58: unexpected response with RECEIVE-ALL
-59: unexpected response with SEND
-60: unexpected response with SEND-ALL
-61: aborted by timeout
- 5:
-80:
-81 :
-82:
-83:
-84:
-85:
aborted by parameter error
parameter invalid
DBIDX does not exist
area too small
area does not exist
status word error
The registers which are not listed are not modified by the driver.
Receive data used:
Application:
You must call this function in your CP 580 program if you wish to receive data from a
CPU with a job "SEND-DIRECT with separate data transfer".
You may only call the function if the program has previously received a
SEND-DIRECT job from the CPU.
The TCB addressed in the call must previously have been transmitted to the driver for
management using the function "Log on job reception".
O Siemens AG 1991 C?9C€C-B85?6-C2M-01
Programming the CP 580 User Program
Call parameters:
Register AX:
Register BX:
Register ES:
Register CX:
Function no. = 14H
TCB addressloff set
TCB addresslsegment
Timeout (see Section 7.4.6 "Read S5 area")
Condition codes:
Register AX:
0:
Negative:
function has been terminated successfully
function has been aborted following an error:
- 2: CPU is not synchronized
- 3: CPU number is incorrect
- 4: TCB being processed
aborted by negative acknowledgement
aborted because data area not accessible
buffer too small
aborted by SYNCHRON
aborted by RESET
unexpected response with FETCH
unexpected response with RECEIVE-DIRECT
unexpected response with RECEIVE-ALL
unexpected response with SEND
unexpected response with SEND-ALL
aborted by timeout
-80:
-81:
-82:
-83:
-84:
-85:
aborted by parameter error
parameter invalid
DBIDX does not exist
area too small
area does not exist
status word error
The registers which are not listed are not modified by the driver.
O Siemens AG 1991 C79000-B8576-CX)4-01
Programming the CP 580 User Program
Application:
You must call this function in your CP 580 program if you wish to send data to a CPU
with a job FETCH.
You may only call the function if the program has previously received a FETCH job
from the CPU.
Call parameters:
Register AX:
Register BX:
Register ES:
Register CX:
Function no. = 15H
TCB addressloffset
TCB addresslsegment
Timeout (see Section 7.4.6: "Read S5 area")
Condition codes:
Register AX:
0:
Negative:
function has been terminated successfully
function has been aborted following an error:
- 2: CPU is not synchronized
- 3: CPU number is incorrect
- 4: TCB being processed
aborted by negative acknowledgement
aborted because data area not accessible
buffer too small
aborted by SYNCHRON
aborted by RESET
unexpected response with FETCH
unexpected response with RECEIVE-DIRECT
unexpected response with RECEIVE-ALL
unexpected response with SEND
unexpected response with SEND-ALL
aborted by timeout
Q Siemens AG 1991 C79000-08576-C23-01
Programming the CP 580 User Program
Register AX:
Negative:
(continuation of condition codes)
-80: aborted by parameter error
-81 : parameter invalid
-82: DB/DX does not exist
-83: area too small
-84: area does not exist
-85: status word error
The registers which are not listed are not modified by the driver.
Iset job status:
/
Application:
You use this function at the end of a direct job to inform the S5 program via the status
word of the corresponding DHB that the job has been completely processed. At the
same time you inform the S5 program whether errors have occurred and which type
of errors have been detected.
With a RECEIVE-DIRECT job you must additionally inform the S5 program with this
function that data are ready for transfer on the CP 580.
The status of the TCB addressed by the function call must previously have been
scanned using the function "Scan job reception" (except with RECEIVE-DIRECT).
The TCB parameters are not changed.
Call parameters:
Register AX:
Register BX:
Register ES:
Register CX:
Function no. = 13H
TCB addressloffset
TCB addresslsegment
CH = 0, CL = status identification, see Section 7.4.4.4
O Siemens AG 1991 C79339-B8576-CX)4-01
Programming the CP 580 User Program
Condition codes:
Register AX:
0:
Negative:
function has been terminated successfully
function has been aborted following an error:
- 2: CPU is not synchronized
- 3: CPU number is incorrect
- 5 : TCB is not loggedon
The registers which are not listed are not modified by the driver.
Global scan of DHB job reception:
Application:
You can use this function to check the status of all registered TCBs for a CPU. If at
least one job is present, this is passed on to the calling program.
A TCB is not required for the function.
Call parameters:
Register AX:
Register CXY:
Function no. = 17H
CPU number
Condltion codes:
Register AX:
Positive:
30:
31 :
Negative:
- 3:
no job has arrived
at least one job has arrived, or a SYNCHRON
or RESET has taken place
CPU number incorrect
The registers which are not listed are not modified by the driver.
O Siemens AG 1991 C79000-B8576-CX)4-01
Programming the CP 580 User Program
/Log off job reception:
l
Application:
Before you terminate your CP 580 program, for example when data transfer has been
completed, you must use this function to remove a previously registered job from the
CPIDHB driver management again. The TCB of the job must previously have been
transferred to the driver for management using the function "Log on job reception".
Call parameters:
Register AX:
Register BX:
Register ES:
Function no. = 12H
TCB addressloff set
TCB addresslsegment
Condition codes:
Register AX:
0:
Negative:
function has been terminated successfully
function has been aborted following an error:
- 2: CPU is not synchronized
- 3: CPU number is incorrect
- 4: TCB is not logged on
- 8: TCB unknown
The registers which are not listed are not modified by the driver.
Caution
If you do not log off the used TCB before terminating your program,
the driver writes the CP 580 memory when a call occurs with the TCB
address known to it, and this can lead to data losses. Furthermore, the
corresponding S5 program is not informed that data transfer is not
currently possible.
O Siemens AG 1991 C79000-R8576-Cm-01
Programming the CP 580 User Program
7.4.5.4
Status Codes for Direct Jobs
You use the status code to inform the S5 program of the status of a direct job. The
code has 8 bits or 2 hexadecimal digits. The job status is stored in the right-hand
digit, an error number in the left-hand digit. The status code is stored in the 1st DHB
status word using the driver and the corresponding DHB:
Bit No. 15
12 11
8 7
0
4 3
l
ANZW
Ermr No.
Status
code
Status codes whose meanings are listed in the following Tables 7.13 and 7.14 are
defined for the transfer jobs SENDIFETCH and RECEIVE.
Error numbers from 6 to 15 (CP error 6 etc.) are provided in the status codes. You
must specifically assign these numbers for your application and interpret them
accordingly in your S5 program.
Table 7.13
7 - 70
Status codes for SENDIFETCH jobs
O Siemens AG 1991 C79999-06576-CX)4-01
Programming the CP 580 User Program
1) nnn = DHB errors 1 to 5
Table 7.14
I
/
I
I
Status codes for RECEIVE
06H
Job finished without error
0000
0110
OAH
Job finished with DHB error
Onnn
1010
6AH
Job finished with CP error 6
0110
1010
7AH
I Job finished with CP error 7
8AH
/ J O finished
~
9AH
AAH
with CP error 8
I Job finished with CP error 9
I Job finished with CP error 10
,
1
1
/
1
0111
1000
1001
1010
1
1
1
1
1010
1010
1010
1010
1
1
1
1
Programming the CP 580 User Program
EAH
Job finished with CP error 14
1110
1010
FAH
Job finished with CP error 15
1111
1010
03H
RECEIVE ready
clqqq
q q l l
L
l) nnn = DHB errors 1 to 5
2, qqq = original contents are retained
7.4.6
Data Transfer Without Direct Jobs
You can use the two driver functions "Read S5 area" and "Write S5 area" for
applications which need not be triggered via the S5 program.
Any data area (data blocks, flags, 110s etc.) can be read from a CPU or written into it
using these functions without a SEND-DIRECT, RECEIVE-DIRECT or FETCH
initiating the transfer procedure in addition.
Within the cyclic execution of the CPU, the CPIDHB driver only requires for these
functions one SEND-ALL for transmitting from the CPU to the CP 580 and one
RECEIVE-ALL for receiving.
O Siemens AG 1991 C79999-06576-CX)4-01
Programming the CP 580 User Program
TCB for transfer functions without direct jobs:
You must supply the TCB with the following parameters for transfer functions without
direct jobs:
DHB description: here you only need enter the number with which you wish to
transfer data.
Transmission parameters:
- Area identification
- DB No. (only with DBIDX)
- Area offset and area length of the source or destination data area in the CPU.
The pointer to the buffer area:
- Segment
- Offset
- Length.
Note
If the size of the area to be transmitted exceeds the transfer frame
size set using the DHB SYNCHRON, the CPIDHB driver automatically
divides the area into partial frames. The transmission then requires
several S5 cycles depending on the size of the area. Your CP 580
program is only continued once the complete area has been
transmitted.
Programming the CP 580 User Program
~ e a S5
d area:
I
Application:
You can use this function to read an S5 data area in a CPU and to transmit it to the
CP 580.
If your CP 580 program calls this function, it is only continued when the complete
data area specified in the TCB has been transmitted.
You must enter the following parameters in the TCB before calling the function (see
TCB description).
Call parameters:
Register AX:
Register BX:
Register ES:
Register CX:
Function no. = O1H
TCB addressloffset
TCB addresslsegment
Timeout in 55-ms units:
the function is aborted with an error report if the transmission
has not been terminated following the timeout.
Condition codes:
Register AX:
0:
Negative:
function has been terminated successfully
function has been aborted following an error:
- 2: CPU is not synchronized
- 3: CPU number is incorrect
- 4: TCB being processed
-51:
-52:
-53:
-54:
-55:
aborted by negative acknowledgement
aborted because data area not accessible
buffer too small
aborted by SYNCHRON
aborted by RESET
O Siemens AG 7991 C79000-B8576-Cm-O1
Programming the CP 580 User Program
Negative:
(continued)
-56: unexpected response with FETCH
-57: unexpected response with RECEIVE-DIRECT
-58: unexpected response with RECEIVE-ALL
-59: unexpected response with SEND
-60: unexpected response with SEND-ALL
-61: aborted by timeout
-80: aborted by parameter error
-8 1: parameter invalid
-82: DBIDX does not exist
-83: area too small
-84: area does not exist
-85: status word error
The registers which are not listed are not modified by the driver.
Application:
You can use this function to transmit data from the CP 580 to a CPU and to write in
an S5 data area.
If your CP 580 program calls this function, it is only continued when the complete
data area specified in the TCB has been transmitted.
You must enter the following parameters in the TCB before calling the function (see
TCB description).
O Siemens AG 1991 C79999-B8576-CX)4-01
Programming the CP 580 User Program
Call parameters:
Register AX:
Register BX:
Register ES:
Register CX:
Function no. = 02H
TCB addressloffset
TCB addresslsegment
Timeout in 50-ms units:
the function is aborted with an error report if the transmission has
not been terminated following the timeout.
Condition codes: as with "Read S5 area"
The registers which are not listed are not modified by the driver.
7.4.7
Other Driver Functions
pxzzu'i
Application:
You can use this function (e.g. after starting your CP 580 program) to scan whether
the CPIDHB driver is correctly synchronized with a CPU.
Call parameters:
Register AX:
Register CX:
Function no. = 30H
Number of CPU to be synchronized
Condition codes:
Register AX:
Positive:
Negative:
40:
41:
- 3:
CPU is synchronized
CPUisnotsynchronized
CPU number incorrect
The registers which are not listed are not modified by the driver.
O Siemens AG 1991 C79000-B8576-C2W-01
Programming the CP 580 User Program
Change interrupt for driver call:
If the preset interrupt INT-66H for calling the CPIDtiB driver is already used by other
applications in your CP 580 user system, you can assign a different software interrupt
to the driver.
This function cannot be activated via a driver call, but via the following command:
CPDHB-INTxx
where xx = hexadecimal value of new interrupt
The driver stores this value in the memory and can then only be reached via the new
interrupt.
7.4.8
MS-DOS Multiplexer interrupt (INT 2FH) of the CPlDHB Driver
The MS-DOS multiplexer interrupt (INT-2FH) is a special access to a TSR program.
If a program calls INT-2FH, all installed TSR programs are called in succession. A
special identification number (ID number) in the register AH determines which TSR
program is to be addressed. Register AL can inform the program on which function is
to be executed.
The CPIDHB driver provides only one function via INT-2FH: it checks whether the
driver is installed and simultaneously provides useful information on the driver.
Call parameters:
Register AL:
Register AH:
01H
EDH
O Siemens AG 1991 C79XX)-B8576-CX)4-01
Programming the CP 580 User Program
Condition codes:
Register AX :
Register BX:
Register CL:
Register DX:
Register EX:
if the driver is present and if the function
was executed
Driver version
Interrupt number for driver call
Used internally by driver
Used internally by driver
EDEDH
Function description:
The INT-2F function 01H checks whether the CPIDHB driver is present in the CP 580
memory. A copy of the ID number is supplied in AL if the driver is present. The driver
enters the current interrupt number for the job interface into CL since the preset
number can only be modified by a command to the driver (see Section 7.4.7). The
driver enters the release version of the driver software into BX.
Example of call of CPlDHB driver via multiplexer interrupt:
CPDHBID
MOV
MOV
INT
CMP
JNE
EQU OEDH
AL,OlH
AH,CPDHBID
2FH
AL,CPDHBID ;Driver present?
error
;Driver present!
error:
;Driver not present!
O Siemens AG 1991 C79000-BB576-C2W-01
Testing the Application
7.5
Testing the Application
7.5.1
Procedure
Proceed in the following steps to determine whether the S5 and CP 580 programs
you have produced correctly handled the desired communication between the CPU
and CP 580:
1. Make sure that no system programs for standard applications (process data
acquisition etc.) are active during the complete test phase, thus preventing
side-effects. You must remove the corresponding start commands from the
AUTOEXEC.BAT file for this purpose.
2. Always test you programs initially with one CPU, even if you wish to exchange
data later with several CPUs.
3. First test your S5 programs without the CP 580, then only with the driver, and
finally together with your CP 580 program (see Section 7.5.2).
4. First test your CP 580 program without the CPIDHB driver, then with the driver
but without the CPU and finally together with your S5 program on a CPU (see
Section 7.5.3).
5. Check that the data transferred between the CPU and CP 580 agree. Remember
to observe the different storage procedures of the various data fomats in the
CPU and CP 580 memories (see Section 7.5.3).
6. If data transfer with a CPU is executed correctly, you can incorporate further
CPUs into the sequence if this is required for your application and is permissible
with your programmable controller, or you can also activate the standard
application programs step-by-step.
Consider whether special coordination methods are necessary in this case. If so,
you must first implement these measures in your programs.
C
2 Siemens AG 1991 C79000-B8576.CX)4-01
Testing the Application
7.5.2
Testing the S5 Program
Online functions are available to test your S5 program on your programmer (see
Reference Literature).You can determine with these functions whether the DHB calls
are processed in your S5 program and what information is stored in the status word
of the DHB calls.
The individual procedure depends on your special application and cannot be
recommended universally. The sequence of basic steps listed in Section 7.5.1
(without CP 580, only with CPIDHB driver, then with CP 580 program) should be
observed, however.
Useful information for testing is stored in the status words. Section 7.3.6 shows you
the meaning of the various bits in the status word.
7.5.3
Testing the CP 580 Program
Before commencing the test of your CP 580 program, you must clarify which test aids
are available. This depends on the language in which you have written your program.
Irrespective of the programming language and the test aids, it is difficult to test a
program if another program is active simultaneously (CPIDHB driver).
Therefore initially test your program without real driver calls (you can simulate these
via an auxiliary subroutine, replace INT commands by subroutine calls) in order to
check the logical sequence.
If the program is executed correctly during this "dry test", you can call the CPIDHB
driver using correct INT commands in your program. A CPU should not yet be active.
Your program must be informed in this test step by the driver that the addressed CPU
is not synchronous (see driver status bits in Section 7.5.4).
If you then test the interaction with a CPU, the bits in the CPIDHB driver provide
valuable information on which logic errors have occurred.
0 Siemens AG 1991 C79CCQ-BB576-C2W-01
Testing the Application
In a test version of your CP 580 program you should therefore output the status bits
on the monitor or on a printer with a reference to the special call following each driver
call.
If your CP 580 program "crashes" during the interactions, you should perhaps carry
out a "mixed test" with real and simulated driver calls in which the simulated driver
calls are replaced step-by-step by real calls.
7.5.4
Representation of the S5 Data in the CP 580 Memory
Data are stored in the CP 580 in the lntel data format. This differs from the
representation of the S5 data in a CPU.
You must take this difference into consideration if you wish to check whether the data
transferred between CPU and CP 580 are correct.
The following Figs. show you how the various data formats are stored in the CPUs
and in the CP 580.
Hexadecimal
numbers
12
Rising
addresses
67
S5 format
Fig. 7.10
Data representation in S5 and lntel formats
Q Siemens AG 1991 C79909-08576-C294-01
F
3
89
lntel format
Testing the Application
S5 flag area
lntel
WORDn+2
FWn FDn
FAn
24 23
31
FAn
WORDn DWORDn
16 15
8 7
FAn+2
FAn+l
0
FAn+3
Representation in ACCU
Fig. 7.1 1
Data representation in S5 and lntel formats
S5 data block
1
lntel
24 23
31
DWLn
I
16 15
DWRn
I
8 7
DWLn+l
/
0
DWRn+l
l
Representation in ACCU
Fig. 7.12
7 - 82
Representation of S5 data block data in lntel format
C2 Siemens AG 1991 C79000-08576-Cm-01
Error Bits of the CP/DHB Driver
7.6
Error Bits of the CPlDHB Driver
The CPIDHB driver stores status bits in the 8086 register AX when the calling
program is continued. These indicators consist of a decimal number with sign and
provide you with information on the execution of the called function:
Values 2 0: function was terminated successfully.
Values < 0: function was aborted,
A negative execution of a function does not always mean that a serious error has
occurred.
The negative values are divided into three categories:
*
-1 to-49:
errors which occur immediately following calling of the function,
e.g. format error in TCP.
-50 to -79:
errors detected by the CPIDHB driver during transmission,
e.g. an unexpected response of the CPU.
-80 to -89:
errors signalled by the DHBs during transmission,
e.g. parameter with incorrect format (PAFE error 1).
Note
The ranges listed are not used completely.
Q Siemens AG 1991 C79990-BB576-CX)4-01
Error Bits of the CP/DHB Driver
Table 7.15
Error bits of the CPIDHB driverterror group - 1 to -49
PU number specified in the TCB has an incorrect
-4
FFFCH
TCB busy:
The specified TCB was previously set to a status by
another function which does then not permit processing
with the desired function.
-5
FFFBH
TCB is not logged on:
The specified TCB was not registered with the CPJDHB
driver; the desired function cannot be carried out.
-6
FFFAH
Wrong DHB type:
The DHB type code specified in the TCB has the
incorrect format. The format of the DHB type is checked
when registering a TCB.
-7
FFF9H
TCB already logged on:
The TCB is already in the management of the CPIDHB
driver and cannot be registered. This error message can
only occur when registering a TCB.
7 - 84
G2 Siemens AG 1991 C79000-B8576-CM4-01
Error Bits of the CP/DHB Driver
The CPIDHB driver has determined by means of the TC
status that the TCB is in its management.
-10
FFF6H
Job number already in use:
The job number specified in the TCB is already occupied
by another TCB.
To complete the information, Table 7.16 also contains error bits which really should
not occur. If one of these bits (-58 to -62) occurs nevertheless, please contact your
Siemens representative.
Table 7.16
Error bits of the CPIDHB driverterror group -50 to -79
t no. 7) is set in the
Error Bits of the CP/DHB Driver
TCB is too small for the length
The RECEIVE-DIRECT block has not reacted as
Error Bits of the CP/DHB Driver
The following errors in Table 7.17 are so-called DHB errors and are detected by the
DHB on the CPU. The reason for these errors is either incorrect parameterization of
the DHB on the CPU or faulty assignment of transmission parameters in the TCB.
Table 7.1 7
l
I
I
1
Error bits of the CPIDHB driverterror group -80 to -89
-80
FFBOH
Aborted - parameter error:
This error corresponds to "PAFE 0"
(is only signalled by certain CPUs).
-81
FFAFH
Parameter invalid:
The specified source/destination parameters
(transmission parameters) are faulty. This error
corresponds to "PAFE 1".
-82
FFAEH
DBIDX does not exist:
The specified data block DB or DX does not exist or the
number is illegal. This error corresponds to "PAFE 2".
-83
FFADH
Area too small:
The specified area is too small or the total of the initial
address and the length is too large. This error
corresponds to "PAFE 3".
-84
FFACH
Area does not exist:
The specified area does not exist or is illegal. This error
corresponds to "PAFE 4".
-85
FFABH
Status word error:
The address of the status word is within an unknown
S5 area or outside a permissible area. This error
corresponds to "PAFE 5".
Contents
Instructions
Contents, Page Overview
How to Use this Manual
C79000-58576-C204
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
Command Interpreter
6
Free Programming of the CP 580
7
Application Examples
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
Contents
Contents
8
Application Examples........................................................................ 8-3
8.1
Process Data Acquisition ................................................................. 8-3
8.1.1
8.1.2
8.1.3
8.1.4
TasWProblem .................................................................................... 8-3
8-4
Starting to Solve the Problem...............................................................
.............................................................................
Structure of Solution
8-5
Individual Working Steps ......................................................................
8-7
8.2
Mass Storage Functions................................................................
8.2.1
8.2.2
8.2.3
8.2.4
TasWProblem .................................................................................. 8-20
8-20
Starting to Solve the Problem............................................................
Structure of Solution ...........................................................................
8-21
Individual Working Steps ....................................................................
8-23
8.3
Command Interpreter.......................................................................8-32
8.3.1
8.3.2
8.3.3
8.3.4
TasWProblern .....................................................................................
8-32
Starting to Solve the Problem.............................................................
8-32
Structure of Solution...........................................................................
8-33
8-34
Individual Working Steps ....................................................................
8.4
Free Programming ...........................................................................8-41
O Siemens AG 1991 C79000-58576-C204.01
8-20
Contents
Q Siemens AG 1991 C79000-B8576-C204-01
Process Data Acquisition
8
Application Examples
This chapter describes the use of the CP 580 communications processor by means
of application examples. You learn:
How you can monitor the temperature variation of a process using the process
data acquisition function.
How you can use the mass storage functions to transfer data from the S5 CPU
to the CP and back again.
How you can use the command interpreter to output messages from the S5
CPU on a message printer using an MS-DOS command.
That you can run self-generated applications using the free programming
function.
8.1
Process Data Acquisition
You wish to monitor the temperature variation of a process using the CP 580
communications processor which is installed in the subrack of your S5-115U
programmable controller.
The measurement points are to be sampled 60 times per hour over a period of 12
hours, and the temperature values stored on the hard disk of the CP 580. The
process has 5 temperature measurement points. At the end of the 12 hours, the
values are to be evaluated using an MS-DOS user program (e.g. Lotus 1-2-3).
O Siemens AG 1991 C79000-B8576-C2W-01
Process Data Acquisition
8.1.2
Starting to Solve the Problem
The analog values measured at the measurement points must be standardized and
stored in the correct sequence in data block DB 10 from data word DW1 to data
word DW5.
S5 bus
S5 CPU
v
CP580
v
CPRECORD
Process data recording
P
Hard disk
Fig. 8.1
Transmission of measured values to the data block D0 10
The data are transferred to the hard disk of the CP via the data handling block
SEND with the function SEND-ALL in the OB 1 and via the CPRECORD program
for process data recording on the CP 580. The data can be called from the hard
disk by the evaluation program.
Process Data Acquisition
8.1.3
Structure of Solution
The data flow between the S5 CPU and the CP 580 is as follows:
S5 bus
S5 CPU
CP580
,
I
OB21,22
CPIDHB dnver
1
CPRECORD
Process data recording
DB l0
SEND ALL
Fig. 8.2
-
-
Data transfer between S5 CPU and CP 580 for process data acquisition
The FB SYNCHRON initializes the interface, and the frame size is agreed upon
between the interface and the S5 CPU.
The FB "Data conditioning" stores the measured data in standardized form in
the data block DB 10.
The FB SEND with the function SEND-ALL transfers the data from the DB 10 to
the hard disk of the CP via the S5 backplane bus and with the assistance of the
CPIDHB driver and the process data acquisition program. The configuration file
provides the parameters for the process data acquisition program.
MS-DOS user programs are used to evaluate the data on the hard disk.
O Siemens AG 1991 C79000-B8576-C2W-01
Process Data Acquisition
For this purpose you must carry out the following measures on the PG, CP 580 and
S5 CPU:
I.] Generate data blocks
Load S5 program into PLC
Fig. 8.3
l
1
Handling sequence for process data acquisition
8 Siemens AG 1991 C79X)OB8576-CC29-01
Process Data Acquisition
8.1.4
Individual Working Steps
The operations you must carry out on the programmer (PG), the communications
processor (CP) and the S5 CPU are explained in more detail on the following
pages.
Operations on the PG
Generation of data blocks
Generate the data block DB 10 such that 5 temperature values can be stored as
fixed-point numbers. The first value should be present in data word DW1.
* The data from data block DB 10 are transmitted to the CP via the DHB SEND
with the function SEND-ALL following triggering by the CP.
O Siemens
AG 1991 C790M).B8576-C204-01
Process Data Acquisition
Installation and parameterization of data handling blocks in S5 program
Assign parameter values to the DHB SYNCHRON and insert it into the restart
organization blocks OB 21 and 22 (the OB 20 is not present with the S5-115U).
SEGMENT 1
0000
0001
0002
0003 NAME
0004 REP
0005
0006
SEGMENT 1
0000
0001
0002
0003 NAME
0004 REP
0005
0006
0000
CP 580 SYNCHRONIZATION
WITH STOP + RUN
:JU FB 23
:SYNCP580
:
KF +3
REPETITION FACTOR
:BE
0000
CP 580 SYNCHRONIZATION
WlTH POWER RETURN
:JU
FB 23
:SYNCP580
:
KF +3
REPETITION FACTOR
:BE
O Siemens AG 1991 C79999-98576-C2O1-01
Process Data Acquisition
SEGMENT 1
0000
CP 580 SYNCHRONIZATION
NAME :SYNCP580
DECL :REP I/Q/D/B/T/C: D KM/KH/KY/KS/KF/KT/KC/KG: KF
0008
OOOA
OOOB
OOOC
OOOD
OOOE
OOOF
0010
0011
0012
0013
:L
:T
LOOP
NAME
SSNR
BLGR
PAFE
0014
0016
0017
0018
0019
001A
001B
001C
001 D
001E
001F END
KF +O
FW 14
:JU
FB 249
:SYNCHRON
:
KY 0,4
:
KY 0,6
:
FY 12
:L
FW 14
:I
1
:T
FW 14
REPETITION COUNTER
PRESET WITH 0
INTERFACE NUMBER
1= l 6 BYTE, 6 4 1 2 BYTE
LOOP COUNTER
KF +O
FY 12
EVALUATE PAFE
=END
SYNCHRON. SUCCESSFUL
FW 14
=REP
LOOP COUNTER
=LOOP
REPETITIONS COMPLETED
REPEAT SYNCHRONIZATION
ERROR REACTION STOP
* The FB 23 handles the assignment of parameters in the restart OB. The
different restart times of the S5 CPU and the CP are compensated by the
repetition factor for the FB SYNCHRON.
* The S5 CPU and the CP 580 are synchronized in "STOPIRUN mode" (OB 21)
and in "Automatic warm restart" (OB 22) of the programmable controller by
means of the DHB SYNCHRON in the restart OB.
@ Siemens AG 1991 C79000-88576-C204.01
8-9
Process Data Acquisition
Call the data handling block SEND with the function SEND-ALL in the organization
block OB 4 and assign its parameters.
OB 1
SEGMENT 1
0013
0014
0015
0016
0017
0018
0019
001A
0018
001C
NAME
SSNR
A-NR
ANZW
QTYP
DBNR
QANF
QLAE
PAFE
:JU
:SEND
:
:
:
:
:
:
:
:
FB244
DHB SEND (SEND-ALL)
KY 0,4
KY 0,O
FW 20
KS
KY 0,O
KF +O
KF +O
FY 13
INTERFACE 4
A-NR 0 = SEND-ALL FUNCTION
* The DHB SEND with the function SEND-ALL transfers the measured values
from the S5 CPU to the CP via the S5 backplane bus.
Loading the S5 program into the programmable controller
Set the programmable controller to STOP and load the S5 program into the PLC.
8 Siemens AG 1991 C79000-B8576-C2W-01
Process Data Acquisition
Operations on the CP 580
Setting and checking the switch and jumper settings
Set interface no. 4 and check the other switch and jumper settings (see Section
2.2.2).
Generation of configuration file
You can modify the CPRECORD.IN1 (D:\CP580) configuration file included in the
scope of delivery using any text editor.
It is better, however, to leave the supplied file unmodified for reference purposes
and to generate a new configuration file on the CP, e.g. using the text editor EDLIN.
Any name can be used for the file, but the file name extension must be .INI. You
must specify the name of the new configuration file when starting process data
acquisition.
The configuration file is searched for in the current directory and in the environment
path. If it is to be found in another path, you must specify this path and the name of
the configuration file when starting process data acquisition.
O Siemens
AG 1991 C79000-B8576-CX)4-01
Process Data Acquisition
The configuration file is as follows in our example:
.***CPRECORDconfiguration ............................................................
f
1
Data are read from CPU 1
SEND-ALL accepts the data from the S5 area DB
Number of the DB which contains the relevant data
Data offset in words with respect to start of DB
1;
5;
Data length
D:\EXAMPLE; Directory path in which the ASCll files are stored
(the directory must already have been created)
TXT ;
File name extension for the ASCll files, the file name
is assigned by CPRECORD (in this case 010DXXXX.TXT)
,
1;
Maximum number of files
720;
Maximum number of data records per file
Uniform fixed-point data format in DB
KF;
Delimiter between individual entries in ASCll file
(semicolon in this case)
60;
Acquisition cycle in seconds
Data recording is terminated when the
0;
defined number of files (1 in this case) is reached
,
Logging is to be carried out
1;
CP580.LOG; Destination file for the logged data (is generated in the current
,
directory; if you do not require this, you must specify the the
complete path)
Timeout in seconds, 1 to 3600 s is permissible
50;
1;
DB;
10;
* The configuration file contains the parameters with which the CPRECORD
program carries out the process data acquisition.
The configuration file is only evaluated when the CPRECORD program is
started, i.e. possible modifications of the configuration file only then become
effective when you restart the program.
Q Siemens AG 1991 C79000-B6576-Cm-01
Process Data Acquisition
Star! CP/DHB driver
When delivered, the CPIDHB driver call (CPDHB.EXE) is present in the
AUTOEXEC.BAT file, i.e. the driver is automatically started when the CP 580 is
switched on. If you have deleted the driver from the AUTOEXEC.BAT file, you can
also start it by entering the command CPDHB.
* The CPIDHB driver is loaded into the main memory (TSR program).
The AUTOEXEC.BAT file is as follows when delivered:
path c:\;c:\system;c:\cp580
REM ** Message file:
SET CP580=c:\Cp580\~p580.msg
KEYB GR,,c:\system\KEYBOARD.SYS
prompt $p$g
mode coml :9600,n,8,1 ,p
mode Iptl :=corn1
REM ** Loading CPIDHB driver:
cpdhb
REM ** Loading CPMASS driver:
cpmass
REM ** Loading command interpreter:
cpshell
Q Siemens AG 1991 C79909-B8576-C294-01
Process Data Acquisition
S5 CPU
Starting the S5 program
Start the S5 program by restarting the S5 CPU.
* OB 21 or 22 is executed depending on the restart mode. The DHB
SYNCHRON is activated, and the status word ANZW and the parameter error
byte PAFE are evaluated. In our example, the PLC is set to STOP if the S5
CPU and the CP 580 cannot be synchronized.
a
Process data acquisition can be started on the CP if the synchronization is
successful. An error message ("CPU not synchronized") is output if the S5
CPU and the CP are not synchronized.
Starting process data recording
Enter the CPRECORD command.
You can start the process data acquisition program either by entering the
CPRECORD command as required or by entering the command into the
AUTOEXEC.BAT file. In the latter case, process data acquisition is started
automatically when the CP 580 is switched on.
Process Data Acquisition
The program is started and outputs the following text:
CPRECORD data recording for CP 580 - version 1.O
Copyright (c) Siemens AG 1991
...........................
-----------------------v---
CPIDHB driver version = xx
CPIDHB interrupt number = OX66
CPRECORD installed...
'CPRECORD \?' indicates command syntax
Data recording started
* The program installs itself in the main memory as a TSR program.
a The configuration file is evaluated.
* The start message of the program is entered into the logging file together with
the date and time.
* The measured values are transferred to the hard disk of the CP 580.
* The CPRECORD program is executed in the background. Other programs can
be executed in the foreground; reaction times are influenced though.
Scan status of data recording
Press the key combination
(X]
and
B
3 The status of data recording is output during operation. It is displayed, for
example, that data recording is in operation, that the timer is at 32 seconds,
that data record 2 in file 1 is currently being processed and that the data
recording is not permanent:
I
Recording active = 1
Timer = 32
Data record = 2
File = 1
Permanent cycle = 0
Q Siemens AG 1991 C79000-08576-CM4-01
8 - 15
Process Data Acquisition
Interrupt and continue data recording
Press the key combination
0
SHIFT
(left) and
(F]
and
* Data recording is stopped. The program is still present in the main memory,
however, and data recording is continued when the key combination is entered
again.
Restarting data recording
Once the defined number of files has been reached, CPRECORD must first be
deinstalled before you can restart data recording.
Enter the CPRECORD /U command.
a The CPRECORD program is uninstalled from the main memory.
Enter the CPRECORD command.
* The CPRECORD program is started and installed in the main memory.
* The program always searches for the file with the latest date and generates a
follow-up file. The advantage of this procedure is that the old data are retained
and are not overwritten.
Reaction to power failure during data recording
If the CPIDHB driver and CPRECORD are entered in the AUTOEXEC.BAT file, the
data recording is automatically started when the power returns.
If this is not the case, load the two programs again by entering the commands
(CPDHB and CPRECORD).
Q Siemens AG 1991 C79WO-B8576-C204-01
Process Data Acquisition
* The program searches for the file with the latest date and generates the
follow-up file. Old data are not lost.
Logging of messages
Since you have selected logging in the configuration file, all messages from
CPRECORD are entered in the log file CP580.LOG which is also specified in the
configuration file. This applies both to error messages and to screen outputs
generated when starting or accessing the program.
You can also delete the log file again if necessary (e.g. if you no longer require old
messages). A new log file is generated automatically as soon as new messages are
output.
@
Evaluation of recorded data
The data stored in the file D:\EXAMPLE\OlODOOOO.TXT can be evaluated using an
MS-DOS program, e.g. Lotus 1-2-3, and output, for example, in the form of a
temperature curve.
The file D:\EXAMPLE\01OD0000.TXT contains the measured values as fixed-point
numbers:
Data record 1:
- - -+81; - - -+80; - - -+80; - - -+79; - - -+79;
- - -+79; - - -+79; - - -+79; - - -+78; - - -+78;
- - -+78; - - -+78; - - -+77; - - -+77; - - -+77;
Data record 720: - - -+80;
- - -+79; - - -+79; - - -+79; - - -+78;
Q Siemens AG 1991 C79999-B8576-C294-01
Process Data Acquisition
Transfer the above-mentioned file to your Lotus worksheet using the command
sequence "Transfer external values". Enter the times for the X-axis into column A
depending on the task. The worksheet then appears approximately as follows:
Q Siemens AG 1991 C79000.B8576-C204-01
Process Data Acquisition
You can generate XY diagrams using the command sequence "Graphic type XY"
For example, the temperature variation at a measurernent point in the process
(column 0 of the worksheet) appears as follows over a period of 1 hour:
4
0
~
I
I
~
~
I
6
Time
Fig. 8.4
Temperature variation at a measurement point, displayed using Lotus 1-2-3
O Siemens AG 1991 C79000-88576-CX)4-01
I
~
Mass Storage Functions
Mass Storage Functions
8.2
You wish to transfer large quantities of data from the S5 CPU to the CP 580
communications processor and bring the data back to the S5 CPU as required.
This may be necessary, for example, if process data are to be transferred from an
S5-115U to a master computer, and the master computer fails or the link is fautty. In
this case the process data are to be buffered on the hard disk of the CP to prevent
data losses. Once the master computer is available again, it can request
transmission of the buffered data from the CPU.
8.2.2
Starting to Solve the Problem
The following four functions of the CPMASS mass storage program are available to
solve the problem:
Preselect directory on CP 580
Transmit data from S5 CPU to CP 580
Transmit data from CP 580 to S5 CPU
Delete S5F files on CP 580.
Thus without further programming knowledge on the CP 580 side, and merely using
various data handling blocks which you installled in your STEP 5 user program,
- you can determine the directory in which the data to be transmitted are to be
stored,
- activate and execute data transmission and
- delete S5 files which are not required.
In the following description of how to solve the problem, the individual CPMASS
functions are triggered via inputs.
Q Siemens AG 1991 C79090-BB576-CX)4-01
Mass Storage Functions
Structure of Solution
8.2.3
The data flow between the S5 CPU and the CP 580 is as follows:
S5 bus
S5 CPU
v
0021,22
CP580
v
CPIDHB driver
SYNCHRON
DB 14
--
OB 1
SEND-DIRECT 1
Q NO. 39
CPMASS
Mass storage functions
A
F0244
h
IQ NO. 201
IQ N0.207
D 0 12
/
1
F 0 244
SEND-ALL
/
FETCH
F 0 245
RECEIVE-ALL
Fig. 8.5
-
Data transfer between S5 CPUs and CP 580 via S5 bus with mass storage functions
The FB SYNCHRON initializes the interface, and the frame size is agreed upon
between the interface and the S5 CPU.
The FB SEND with the function SEND-DIRECT and job no. 201 selects the
directory on the hard disk of the CP into which the data are to be transmitted. If
a directory is not preset, the data are stored in the directory C:\CPU1, C:\CPU2,
C:\CPU3 or C:\CPU4, with the S5-115U in C:\CPU1. These directories are automatically created if they are not present when CPMASS is started.
8 Siemens AG 1991 C79999-98576-C294-01
Mass Storaae Functions
-
The FB SEND with the function SEND-DIRECT triggers transmission of the data
to the CP.
The FB SEND with the function SEND-ALL transfers the data from the DB 12 to
the hard disk of the CP via the S5 backplane bus and with the assistance of the
CPIDHB driver and the CPMASS program.
The FB FETCH triggers transmission of the data to the S5 CPU.
The FB RECEIVE with the function RECEIVE-ALL transfers the data from the
hard disk of the CP to the DB 12 on the S5 CPU via the S5 backplane bus and
with the assistance of the CPMASS program and the CPIDHB driver.
The FB SEND with the function SEND-DIRECT and job no. 207 deletes the
directory specified in DB 14.
For this purpose you must carry out the following measures on the PG, CP 580 and
S5 CPU:
4
Start SS program
Fig. 8.6
l:!
Handling sequence for mass storage functions
@ Siemens AG 1991 C79999-B8576-CX)4-01
Mass Storage Functions
8.2.4
Individual Working Steps
The operations you must carry out on the programmer (PG), the communications
processor (CP) and the S5 CPU are explained in more detail on the following
pages.
Operations on the PG
Generation of data blocks
Generate the data block DB 14 and enter the target directory for the data you wish
to transmit from the S5 CPU to the CP 580.
* The path information in DB 14 is transferred to the CP via the DHB SEND with
the function SEND-DIRECT and job no. 201.
Generate the data block DB 12 with 2043 data words. It must contain the data you
wish to transfer from the S5 CPU to the CP.
LEN = 2048
0
1
2
3
: KH =
:KH=
: KH =
: KH =
AAAA;
0001;
0001;
0001 ;
@ Siemens AG 1991 C79909-08576-Cm-01
Mass Storage Functions
* The data from data block DB 12 are transmitted to the hard disk of the CP via
a DHB SEND with the function SEND-ALL following triggering by the DHB
SEND with the function SEND-DIRECT.
Installation and parameterization of data handling blocks in S5 program
Assign parameter values to the DHB SYNCHRON and insert it into the restart
organization blocks OB 21 and 22 (see Section 8.1.4 for listing).
a The S5 CPU and the CP 580 are synchronized in "STOPIRUN mode" (OB 21)
and in "Automatic warm restart" (OB 22) of the programmable controller by
means of the DHB SYNCHRON in the restart OB.
Call the data handling block SEND with the function SEND-ALL in the organization
block OB 1 and assign its parameters.
SEGMENT 1
0000
0001
0002
0003
0004
0005
0006 NAME
0007 SSNR
0008 A-NR
0009 ANZW
OOOA QTYP
0006 DBNR
OOOC QANF
OOOD QLAE
OOOE PAFE
OOOF
**+*++*+*+++++++++++++++++++++++++++++++++++
EX. OF MASS STORAGE FUNCTION
CP 58OlS5-115U
+*++++++++++*+++++*+++*+**+++++++++++++++++*
:JU
:SEND
:
:
:
:
:
:
:
:
FB 244
DHB SEND (SEND-ALL)
KY 0,4
KY 0,O
FW 100
KS
KY 0,O
KF +O
KF +O
FY 104
@ Siemens AG 1991 C79999-B8576-C294-01
Mass Storage Functions
* The DHB SEND with the function SEND-ALL transfers the data from the S5
CPU to the CP via the S5 backplane bus.
Call the data handling block RECEIVE with the function RECEIVE-ALL in the
organization block OB 1 and assign its parameters.
OOOF
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
001A
NAME
SSNR
A-NR
ANZW
ZTYP
DBNR
ZANF
ZLAE
PAFE
:JU
FB 245
:RECEIVE
:
KY 0,4
:
KY 0,O
:
FW 106
:
KS
:
KY 0,O
:
KF +O
:
KF +O
:
FY 110
DHB RECEIVE (RECEIVE-ALL)
* The DHB RECEIVE with the function RECEIVE-ALL transfers the data from
the CP to the S5 CPU via the S5 backplane bus.
Mass Storage Functions
Call the data handling block SEND with the function SEND-DIRECT in the
organization block OB 1 and assign its parameters.
001B
001C
001D
001 E
001F
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
002A
0028
002C
002D
002E
:A
:AN
.'-
:S
:AN
:R
:A
:JU
NAME :SEND
SSNR :
A-NR :
ANZW :
QTYP :
DBNR :
QANF :
QLAE :
PAFE :
1 12.0
M 11.0
M 11.1
M 11.0
112.0
M 11.0
M 11.1
FB244
KY 0,4
KY 0,39
FW 112
KS DB
KY 0,12
KF +O
KF +2043
FY 116
TRIGGER WRITING OF DATA
FROM DB 12 TO CP 580 FILE
DHB SEND (SEND-DIRECT)
INTERFACE 4
JOB NO. 39, PER. RANGE 1-99
SOURCE DB
NO. 12
INITIAL ADDRESS
NUMBER OF DATA WORDS
The DHB SEND with the function SEND-DIRECT activates the CP 580 and
transfers to it the address of the data to be transmitted to the CP.
The name of the destination file on the CP 580 is generated from the data
block number (DBNR) and the job number (A-NR). The destination file is
"012DB039.S5F in our example.
* In order to differentiate between the files during cyclic data recording of the
same DB, it is necessary either to increment the job number or to switch over
the directory.
Q Siemens AG 1991 C79000-E8576-C204-01
Mass Storage Functions
Call the data handling block FETCH in the organization block OB 1 and assign its
parameters.
002E
002F
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
003A
0038
003C
003D
003E
003F
0040
0041
:A
:AN
.._
:S
:AN
:R
NAME
SSNR
A-NR
ANZW
ZTYP
DBNR
ZANF
ZLAE
PAFE
1 12.1
M 11.2
M 11.3
M 11.2
112.1
M 11.2
M 11.3
:A
:JU
FB 246
:FETCH
:
KY 0,4
:
KY 0,39
:
FW 118
:
KS DB
:
KY 0,12
:
KF +O
:
KF +2043
:
FY 122
TRIGGER READING OF DATA
FROM CP AND STORE IN DB 12
DHB FETCH
INTERFACE 4
JOB NO. 39
DESTINATION DB
NO. 12
INITIAL ADDRESS
NUMBER OF DATA WORDS
* The DHB FETCH activates the CP 580 and transfers to it the address of the
data to be transmitted to the S5-CPU.
O Siemens
AG 1991 C79999-B8576-C294-01
Mass Storage Functions
Call the data handling block SEND with the function SEND-DIRECT and job number
201 in the organization block OB 1 and assign its parameters.
0042
0043
0044
0045
0046
0047
0048
0049
004A
0048
004C
0040
004E
004F
0050
0051
0052
0053
0054
0055
:A
:AN
.._
:S
:AN
:R
:A
:JU
NAME :SEND
SSNR :
A-NR :
ANZW :
QTYP :
DBNR :
QANF :
QLAE :
PAFE :
1 12.2
M 11.4
M 11.5
M 11.4
1 12.2
M 11.4
M 11.5
FB244
KY 0,4
KY 0,201
FW 124
KS DB
KY 0,14
KF +O
KF +7
FY 128
TRIGGER PRESELECTION OF
DIRECTORY ON CP 580
DHB SEND (SEND-DIRECT)
INTERFACE 4
JOB NO. 201, PRESELECT DIREC.
DIRECTORY AND PATH DATA
IN DB 14
INITIAL ADDRESS
NUMBER OF DATA WORDS
* If the DHB SEND with the function SEND-DIRECT and job number 201 is
called, it transfers a string to the CP which contains the path data of the
destination directory for the data transmission.
* If the string is larger than the set frame size, the DHB SEND with the function
SEND-ALL transmits the remaining data to the CP.
Q Siemens AG 1991 C79999-08576-C204-01
Mass Storage Functions
Call the data handling block SEND with the function SEND-DIRECT and job number
207 in the organization block OB 1 and assign its parameters.
0055
0056
0057
0058
0059
005A
0058
005C
005D
005E
005F
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
:A
:AN
.._
:S
:AN
:R
1 12.3
M 11.6
M 11.7
M 11.6
1 12.3
M 11.6
:A
M 11.7
:JU
FB 244
NAME :SEND
KY 0,4
SSNR :
KY 0,207
A-NR :
FW 130
ANZW :
KS DB
QTYP :
KY 0,14
DBNR :
QANF :
KF +O
QLAE :
KF +7
PAFE :
FY 134
TRIGGER DELETION OF
S5F FILES ON CP 580
DHB SEND (SEND-DIRECT)
INTERFACE 4
JOB NO. 207, DELETE S5F FILES
DIRECTORY AND PATH DATA
IN DB 14
INITIAL ADDRESS
NUMBER OF DATA WORDS
:BE
* All S5F files present in the specified directory are deleted if the DHB SEND
with the function SEND-DIRECT and job number 207 is called. The complete
directory is deleted if it only contains S5F files and no subdirectories. The
current directory and files with the attribute "Read only" are not deleted
(MS-DOS).
Only use the delete function of the CPMASS program if you are sure that
information you still require cannot be deleted by mistake.
O Siemens AG 1991 C79000-88576-C2W-01
Mass Storage Functions
s on the CP 580
Setting and checking the switch and jumper settings
Set interface no. 4 and check the other switch and jumper settings (see Section
2.2.2).
Switch on the device and check the AUTOEXEC.BAT file
When delivered, the CPIDHB driver and the CPMASS program are present in the
AUTOEXEC.BAT file (CPIDHB driver, CPMASS.EXE), i.e. they are automatically
started when the CP 580 is switched on. The directories C:\CPU1, C:\CPU2,
C:\CPU3, and C:\CPU4 are generated in addition.
Check whether the two programs are still present in the AUTOEXEC.BAT file. If this
is not the case, enter them again.
* The CPIDHB driver and the CPMASS program are loaded into the main
memory and started.
* The following message is output on the screen:
a
CPMASS Vxx
CPDHB Vxx
The CPMASS program is executed in the background. Other programs can be
started in the foreground, but the reaction times are influenced.
Q Siemens AG 1991 C79990-B8576-C294-01
Mass Storage Functions
Operations on the S5 C W
Starting the S5 program
Start the S5 program by restarting the S5 CPU.
* OB 21 or 22 is executed depending on the restart mode with the S5-115U.
The DHB SYNCHRON is activated, and the status word ANZW and the
parameter error byte PAFE are evaluated. In our example, the PLC is set to
STOP if the S5 CPU and the CP 580 cannot be synchronized.
a The mass storage functions are active if the synchronization is successful and
wait for the trigger for data transmission from the S5 CPU.
C3 Siemens AG 1991 C79000-B8576-C20d-01
Command Interpreter
8.3
Command Interpreter
You wish to output S5 CPU messages on a message printer via the command
interpreter of the CP 580 communications processor which is installed in the
subrack of your S5-115U.
8.3.2
Starting to Solve the Problem
The process alarms are acquired by the PLC via digital inputs and evaluated by the
user program.
The DHB SEND with the function SEND-DIRECT is called when an alarm appears.
A command line is stored in data block DB 15 for each alarm. The DHB SEND with
the function SEND-DIRECT transmits the corresponding command line to the CP.
This is transferred from there to MS-DOS by the CPSHELL command interpreter.
The operating system subsequently carries out the desired function.
A text file must be stored on the hard disk of the CP for each message and must
contain the text to be output on the printer. All text files are present in the directory
D:\MESS.
The connected printer can be e.g. a PT88. Section 2.2.4 provides you with
information on the printer settings required and on the connection cable.
The printer output must be routed to the COM1 interface.
8 Siemens AG 1991 C79000-08576-Cm-01
Command Interpreter
8.3.3
Structure of Solution
S5 bus
55 CPU
CP580
OB21,22
1
MS-DOS
COMMAND.COM
OB 1
v
FB 244
command
COPY
command
SEND-ALL
Printer
Fig. 8.7
-
-
Data transfer between S5 CPU and CP 580 when using the command interpreter
The FB SYNCHRON initializes the interface, and the frame size is agreed upon
between the interface and the S5 CPU.
The FB SEND with the function SEND-DIRECT transfers the command line to
CPSHELL.
If the command line is longer than the set frame size, The FB SEND with the
function SEND-ALL transmits the remaining data upon a request from the CP.
@ Siemens AG 1991 C79000-B8576-CZW-O1
8 - 33
Command Interpreter
-
The CPSHELL program transfers the command line to MS-DOS
(COMMAND.COM).
COMMAND.COM handles command processing under MS-DOS.
For this purpose you must carry out the following measures on the PG, CP 580 and
S5 CPU::
Generate data blocks
I!
[l. . . . . . . . . . . . . . . . . . . . . . . . . . .
[/ lnsen DHBs info S5 program
'1
I{
!M!
and arametenze
Fig. 8.8
8.3.4
Handling sequence when using the command interpreter
Individual Working Steps
The operations you must carry out on the programmer (PG), the communications
processor (CP) and the S5 CPU are explained in more detail on the following
pages.
Q Siemens AG 1991 C79000-68576-Cm-01
Command Interpreter
Operatiorts on the PG
Generation of data blocks
Generate the data block DB 15 and enter a COPY command for every message.
0
1
13
15
16
28
30
31
43
45
: KH =
: KS=
: KS =
: KH =
: KS =
: KS =
: KH =
: KS =
: KS =
: KH =
0000;
'COPY D:\MESS\MESS1.TXTL1;
'PT1';
0000;
'COPY D:\MESS\MESS2.TXT L';
'PT1';
0000;
'COPY D:\MESS\MESS3.TXT L';
'PT1';
0000;
* The COPY command relevant in each case is transmitted from the data block
DB 15 to MS-DOS (COMMAND.COM) via the data handling block SEND with
the function SEND-DIRECT.
lnstallati~nand parameterization of data handling blocks in S5 program
Parameterize the DHB SYNCHRON and insert it into the restart organization blocks
0 0 21 and 22 (see Section 8.1.4 for listing).
* The S5 CPU and the CP 580 are synchronized in "RUNISTOP mode" (OB 21)
and in "Automatic warm restart" (OB 22) of the PLC by means of the DHB
SYNCHRON in the restart OB.
O Siemens AG 1991 C79000-B8576-CX4-01
Command Interpreter
Call the data handling block SEND with the function SEND-DIRECT in the
organization block OB 1 and assign its parameters.
OB 1
SEGMENT 1
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
001A
0018
OOlC
001D
001 E
001F
0020
0021
:A
:AN
.._
:S
:AN
:R
NAME
SSNR
A-NR
ANZW
QTYP
DBNR
QANF
QLAE
PAFE
:A
:JU
:SEND
:
:
:
:
:
:
:
:
1 13.0
M 150.0
M 150.1
M 150.0
1 13.0
M 150.0
TRIGGER MESSAGE TEXT 1
M 150.1
FB 244
KY 0,4
KY 0,209
FW 30
KS DB
KY 0,15
KF +l
KF + l 5
FY 34
DHB SEND (SEND-DIRECT)
INTERFACE NUMBER
JOB NUMBER
STATUS WORD
SOURCE TYPE DATA BLOCK
DB NUMBER
START OF COMMAND LINE
DATA LENGTH
PARAMETER ERROR
* The DHB SEND with the function SEND-DIRECT transfers the command line
to the command interpreter on the CP.
Q Siemens AG 1991 C79999-B8576-C290-01
Command Interpreter
Call the data handling block SEND with the function SEND-ALL in the organization
block OB 1 and assign its parameters.
SEGMENT l
0024
0025
0026
0027
0028
0029
002A
0028
002C
002D
NAME
SSNR
A-NR
ANZW
QTYP
DBNR
QANF
QLAE
PAFE
:JU
:SEND
:
:
:
:
:
:
:
:
FB 244
DHB SEND (SEND-ALL)
KY 0,4
KY 0,O
FW 20
KS
KY 0,O
KF +O
KF +O
FY 13
3 The DHB SEND with the function SEND-ALL is only required if the command
line in the DHB SEND with the function SEND-DIRECT is longer than the set
frame size. In this case the DHB SEND with the function SEND-ALL transmits
the remaining data which could not be transmitted "directly".
Loading the S5 program into the programmable controller
Set the programmable controller to STOP and load the S5 program into the PLC.
O Siemens AG 1991 C79999-B8576-C294-01
Command Interpreter
Setting and checking the switch and jumper settings
Set interface no. 4 and check the other switch and jumper settings (see Section
2.2.2).
Storage of message texts in files on hard disk
Create a file with the corresponding message text for each message in the directory
MESS on drive D:\ of the CP 580.
* The message text is output on the printer if a process alarm is present and if
the COPY command required is transmitted from the command interpreter to
MS-DOS.
Diversion of printer output
Enter the following information into the AUTOEXEC.BAT file (if not already
included):
MODE COM1:9600,n,8,1 ,P
MODE LPT1:=COM1
a The printer output is diverted to the COM1 interface.
O Siemens AG 1991 C7W00-68576-CX)4-01
Command Interpreter
Starting the CP/DHB driver
Start the CPIDHB driver by switching on the CP 580.
When delivered, the CPIDHB driver (CPDHB.EXE) is present in the
AUTOEXEC.BAT file. If you have deleted the driver from this file, you can also start
it by entering the CPDHB command.
a
The CPIDHB driver is loaded into the main memory (TSR program).
Operatrons an the S5
Starting the S5 program
Start the S5 program by restarting the S5 CPU
a OB 21 or 22 is executed depending on the restart mode. The DHB
SYNCHRON is activated, and the status word ANZW and the parameter error
byte PAFE are evaluated. In our example, the PLC is set to STOP if the S5
CPU and the CP 580 cannot be synchronized.
* The command interpreter can be started if the synchronization is successful.
O Siemens AG 1991 C79000-B8576.C204-01
Command Interpreter
Starting the command interpreter
Enter the CPSHELL command.
* The command interpreter is started. The following start message is output on
the screen:
CP 580 S5 command interpreter Vx.x
Copyright (c) Siemens AG 1991
.CPSHELL ready
* Any S5 messages are output on the printer.
Terminating the command interpreter
Press the key
(F)
* The CPSHELL program is terminated.
Q Siemens AG 1991 C79990-B8576-C204-01
Free Programming
8.4
Free Programming
The CP 580 communications processor provides you with the possibility for
executing self-generated application programs in the PLC.
The S5 bus driver interface of the CP 580 is available for free use. You can call the
CPIDHB driver from your application program using an adjustable software interrupt
(INT66H).
You need not use a specific programming language. The language must only
provide the facility for transferring software interrupts and accessing CPU registers.
An example of free programming is the CPSHELL command interpreter application
program. The listing of the C program for the command interpreter can be found in
the directory C:\CP580\SRC on the hard disk of the CP 580.
C
3 Siemens
AG 1991 C79000-B8576-C2Ol-Ol
Contents
Instructions
Contents, Pa e Overview
How to Use t is Manual
1
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
7
Application Examples
8
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
15
Contents
Contents
...............................................9-3
9
Reference Section for System Software
9.1
SETUP (Setting of Device Configuration in the Software)................... 9-3
9.1.1
9.1.2
9.1.3
Restart with Preset Device Configuration for the CP 580 Basic Version .. 9-3
CP 580 Restart with Modified Device Configuration ...............................
9-4
.
.
...........................................
9-8
Setting the Date and Time ........................
9.2
Data Handling Blocks
.............................................................................. 9-9
Summary of DHBs with the CP 580 ..........................................................
9-9
DHB SYNCHRON ...................................................................................
9-11
DHB SEND ..............................................................................................
9-12
DHB SEND-DIRECT ...............................................................................
9-12
DHB SEND-ALL ...................................................................................... 9-13
DHB FETCH ............................................................................................ 9-14
DHB RECEIVE .....................................................................................
9-15
DHB RECEIVE-DIRECT .........................................................................
9-15
DHB RECEIVE-ALL ................................................................................ 9-16
DHB CONTROL ....................................................................................
9-17
DHB RESET ......................................................................................... 9-18
Status Word ............................................................................................. 9-18
Parameter Assignment Error Bits ............................................................ 9-20
9.3
Process Data Acquisition ...................................................................
9.3.1
9.3.2
9.3.2.1
9.3.2.2
9.3.3
Parameters for the Configuration File (Process Data Acquisition) .......... 9-22
Error Messages of the CPIDHB Driver and the CPRECORD Program .. 9-26
Error Messages of the CPIDHB Driver ................................................... 9-26
Error Messages of the CPRECORD Program.........................................9-27
Hotkeys for CPRECORD .......................................................................9-30
9.4
Mass Storage Functions
9.4.1
9.4.2
Data Handling Blocks for the Mass Storage Functions ...........................9-32
Error Bits of CPMASS Program ............................................................. 9-33
O Siemens AG 1991 C7900O-B8576-C204-01
9-22
...................................................................... 9-32
9-1
Contents
.
.
.
.......................................9-35
9.5
Command Interpreter ..........................
9.5.1
9.5.2
.
........9-35
Data Handling Blocks for the Command Interpreter................. .
Error Bits of CPSHELL Program ............................................................9-36
O Siemens AG 1991 C79099-08576-C204-01
SETUP (Setting of Device Configuration in the Software)
Reference Section for System Software
9
This chapter provides you - mainly in tabular form - with a complete summary of the
permissible parameters, the error bits and the error messages. The first section deals
with storage of the device configuration in the software (SETUP). This is followed by a
summary of the data handling blocks and their parameterization as used with the CP
580 for the various functions. The error bits and error messages are also listed for the
process data acquisition, mass storage and command interpreter functions.
9.1
SETUP (Setting of Device Configuration in the Software)
9.1.1
Restart with Preset Device Configuration for the CP 580 Basic Version
The CP 580 in the basic version starts up without a manual SETUP.
Please refer to Section 2.3.2.
Diskette A:
Diskette B:
Hard Disk 1:
Hard Disk 2:
Base Memory:
Extended Memory:
Video Card:
Keyboard:
CPU Speed:
Fig. 9.1
3,5 ", 1,44 MB
Not lnstalled
Type l 7
Not Installed
640 KB
XXXX KB*
VGAIEGA
Not Installed
Fast
Default SETUP for the basic configuration
1024 KB for 2-Mbyte DRAM
3072 KB for 4-Mbyte DRAM
7168 KB for 8-Mbyte DRAM
O Siemens AG 1991 C79000-B8576.C204-01
\II
Numlock on at boot:No
SETUP (Setting of Device Configuration in the Software)
9.1.2
CP 580 Restart with Modified Device Configuration
The device configuration of your CP 580 is preset. You may only carry out
modifications using the SETUP program if:
the CCIEU was without an operating voltage for longer than approx. 15 minutes
and the central back-up battery of the CCIEU is flat
a fault occurs when switching on, or
you wish to adjust the hardware clock of the CP 580.
The SETUP program is used to inform the system of device components such as
memories, drives or graphic interfaces. It is also used to adjust the time of the clock
component.
ci>
If you wish to select the SETUP program during normal operation,
e.g. in order to set the date and time, press the following key
combination:
cCTRL> <ALT> <S or +>
Certain operating systems and user programs reject the above key
sequence.
Press the RESET key of the CP 580 and wait for the memory test.
Abort this using the space bar. Now you can start the SETUP
program before loading the operating system by simultaneously
pressing the three keys
cCTRL> <ALT> CS or +>
C
3 Siemens AG 1991 C79999-B8576-C204-01
SETUP (Setting of Device Configuration in the Software)
Execute the SETUP as follows:
1. When you switch on the programmable controller, the CP 580 tries to run up. If
the SETUP data do not agree with the default values, the following message
appears on the screen:
-
"Invalid configuration run SETUP program Press the F1 key to continue, F2
to run the SETUP utility"
Now press function key F2 in order to start the SETUP program.
2. A form now appears on the screen in which the SETUP data to be set are listed.
Press any key to continue the SETUP program.
3. A form appears on the screen on which you can carry out the SETUP settings.
Fig. 9.2 shows you the basic settings when the form appears.
O Siemens AG 1991
C79900-B8576-CZC4-01
SETUP (Setting of Device Configuration in the Software)
Phoenix SETUP Utility (Version 1.00) 03
(c) Phoenix Technologies Ltd 1985,1991 All Rights Reserved
Page 1 of 2
Standard System Parameters "
System Time
System Date
:
Diskette A
Diskette B
Hard Disk 1
Hard Disk 2
Base Memory
Extended Memory
Video Card
Keyboard
CPU Speed
:
:
:
:
:
:
:
:
:
:
00:W:W
Jan:01,1991
3.5", 1.44 MB
Not Installed
Type 17
Not installed
640 KB
XXXX KB'
VGAIEGA
Not installed
Fast
Cyll HD Pre U Sec
977 5
300 977 17
Size
40
Num Lock on at boot: NO
ESC
F1
F2
34
+/-
Menu
Help
Sys lnfo
Field
Value
Fig. 9.2
Pg Up/Dn
Page
SETUP screen form
1024KB for 2-Mbyte DRAM
3072KB for 4-Mbyte DRAM
7168KB for 8-Mbyte DRAM
You can move the cursor using the arrow keys.
You can make settings using the +l- keys or the numeric keys.
Use the Pg UpIDn key to move one page forwards (or backwards) to access "Page 2
of 2" for setting the shadow RAM.
You need not make any settings here, however.
C
2 Siemens AG 1991 C79000-B8576-C2W-01
SETUP (Setting of Device Configuration in the Software)
4. Set the current time and the current date in the SETUP form using the numeric
keys.
5. Once you have made the settings, press the ESC key.
Fig. 9.3 shows the form which now appears on the screen.
Phoenix SETUP Utility (Version 1.00) 03
(c) Phoenix Technologies Lid 1985,1991 All Rights Reserved
I
Page 1 of 2
" Standard System Pal
System Time
System Date
:
:
0O:W:OO
Jan : 01,1991
Diskette A
Diskette B
Hard Disk,l
Hard Disk 2
Base Memory
Extended Memory
Video Card
Keyboard
CPU Speed
:
:
:
:
:
:
:
:
:
3.5", 1.44 M 6
Not Installed
Type17
Not Installed
640
XXXX KB
VGUEGA
Not Installed
Fast
ESC
Continue with SETUP
m
1
Save values, exit
Load default values
for all pages
Abort SETUP wlthout
F4
Continue
Fig. 9.3
,
Exiting SETUP "
Save
F5
F6
Defaults
Abort
Enter SETUP data
6. Press function key F4 to enter the new SETUP data and to reboot.
The CP 580 now runs up to the operating system level. "C:\>", the prompt of
the MS-DOS operating system, appears on the monitor.
O Siemens AG 1991 C79000-B8576-C204.01
SETUP (Setting of Device Configuration in the Software)
9.1.3
Setting the Date and Time
You are prompted by a form in the SETUP program in order to set the date and time.
Please refer to Section 9.1.2.
O Siemens AG 1991 C79000-B8576-C204-01
Data Handling Blocks
Data Handling Blocks
9.2
This section provides you with a summary of the functions and parameters of the data
handling blocks (DHB) used for the CP 580.
You can find detailed descriptions of the data handling blocks in the corresponding
documents. These are available as individual descriptions for the S5-135U and
S5-155U programmable controllers. The description of the DHB for the S5-115U
programmable controller is included in the S5-115U manual (see Reference
Literature):
9.2.1
Summary of DHBs with the CP 580
The following table provides a summary of the DHBs used with the CP 580.
Summary of DHBs
Table 9.1
Functlo n
DHB
I
SYNCHRON
1
l
/
I
Synchronizes CP 580 and CPU
-
SEND-DIRECT
SEND-ALL
SEND-A
Activates the CP 580 and transfers the
address of the required data with
CPMASS
Transfers the data from the CPU to the
CP 580 with CPRECORD and with
CPMASS
l)
Special SEND-ALL FB for S5-135U and
S5-155U
. -
FB
244
120
I 1 FB-I
244
FB
120
-
FB
126
r
Activates the CP 580 and transfers the
address of the required data with
CPMASS
Data Handling Blocks
-
F6
127
FB
127
FB
247
F6
123
FB
123
CONTROL-DIRECT Updates the status word
FB
247
FB
123
FB
123
RESET-ALL
Completely resets the CPIDHB driver
FB
248
FB
124
FB
124
RESET-DIRECT
Resets the CPIDHB driver only for one
specific job
FB
248
FB
124
FB
124
REC-A
2,
CONTROL-ALL
Special RECEIVE-ALL FB for S5-135U
and S5-155U
Indicates which job is currently being
executed
l) The function block SEND-A differs from the function block SEND in that the parameters
QTYP, DBNR, QANF and QLAE are omitted.
*) The function block REC-A differs from the function block RECEIVE in that the parameters
ZTYP, DBNR, ZANF and ZLAE are omitted.
The following applies to both function blocks:
In cases where these parameters are irrelevant (e.g. SEND-ALL function,
RECEIVE-ALL function), use of these blocks saves memory space as well as writing
and increases the program transparency.
C
2 Siemens AG 1991 C79000-B8576-CZO4-01
Data Handling Blocks
Note
3
9.2.2
In the SS-115U programmable controller, the DHBs are present in the
operating system of the CPU. In the S5-135U programmable controller
(CPU 922, CPU 928 and CPU 928B), the DHBs are present in the
operating system of the CPU. The block headers are present on
floppy disks and must be loaded into the CPU.
In the SS-155U programmable controller, the DHBs are present as a
STEP 5 program on floppy disks and must be loaded into the CPU.
DHB SYNCHRON
The DHB SYNCHRON synchronizes the interface between the CPU and CP 580 with
a cold restart (OB 20), a manual warm restart (OB 21) or an automatic warm restart
following a power failure (OB 22). You must call the DHB SYNCHRON in the restart
OB of the CPU for each interface of the CP 580.
Table 9.2
Format and meaning of parameters of DHB SYNCHRON
l
Patameter Klnd Type Meaning
SSNR
D
KY
Interface number
BLGR
D
KY
Frame size
PAFE
Q
BY
Parameter error bits
O Siemens AG 1991 C79000-B8576-C294-01
Data Handling Blocks
9.2.3
DHB SEND
The DHB SEND has two modes
SEND-DIRECT (job number # 0)
SEND-ALL (job number = 0)
9.2.3.1
DHB SEND-DIRECT
You require the DHB SEND-DIRECT if you wish to send data from the CPU to the CP
580 e.g. with the mass storage function. By calling the DHB SEND-DIRECT you
activate the CP 580 and transfer to it the address of the data to be sent by the CPU.
Table 9.3
Format and meaning of parameters of DHB SEND for the SEND-DIRECT function
SSNR
D
KY
Interface number
A-NR
D
KY
Jobno.
ANZW
I
W
Status word
QTY P
D
KS
Data type of source
DBNR
D
KY
Number of data block if source is data block
QANF
D
KF
Offset of first item of data to be read in the data area
QLAE
D
KF
Number of data units to be read (words or bytes)
PAFE
Q
BY
Parameter error bits
G2 Siemens AG 1991 C79909-B6576-CX4-01
Data Handling Blocks
9.2.3.2
DHB SEND-ALL
You require the DHB SEND-ALL in order to carry out the data transmission to ihe CP
580 e.g. with the mass storage function (CPMASS). With the CPRECORD program,
you must call the DHB SEND-ALL in each cycle of the CPU.
Table 9.4
Format and meaning of parameters of DHB SEND for the SEND-ALL function
SSN R
D
KY
Interface number
A-NR
D
KY
Jobno.
ANZW
I
W
Status word
QTY P
D
KS
DBNR
D
KY
These parameters are irrelevant with the function
SEND-ALL; they must be specified for format
reasons, however
QANF
D
KF
QLAE
D
KF
PAFE
Q
BY
Parameter error bits
O Siemens AG 1991 C79000-88576-Cm-01
Data Handling Blocks
9.2.4
DHB FETCH
You require the DHB FETCH if you wish to send data from the CP 580 to the CPU
e.g. with the mass storage function (CPMASS). By calling the DHB FETCH you
activate the CP 580 and transfer to it the address of the data to be sent to the CPU.
Table 9.5
1
1
I
Format and meaning of parameters of DHB FETCH
SSNR
D
KY
Interface number
A-NR
D
KY
Jobno.
ANZW
I
W
Status word
ZTYP
DBNR
I
I
D
D
/
1
KS
KY
l Data type of destination
I Number of data block if destination is data block
IDI I
KF
ZANF
-
1
1
Offset of first item of data to be written in the
destination
(
ZLAE
1
D
(
KF
/ Number of data units to be written (words or by-tes) 1
I
PAFE
I
Q
I
BY
l Parameter error bits
I
O Siemens AG 1991 C79000-B6576-C294-01
Data Handling Blocks
9.2.5
DHB RECEIVE
The DHB RECEIVE has two modes
RECEIVE-DIRECT (job number # 0)
m
RECEIVE-ALL (job number = 0)
9.2.5.1
DHB RECEIVE-DIRECT
You require the DHB RECEIVE with the function RECEIVE-DIRECT to send data
from the CP 580 to the CPU with a specific job number (application with "Free
programming"). The direct mode is called, amongst others, in the cyclic part of the
CPU program. The block can also be called during interrupt or alarm processing, but
the status word is then not updated cyclically. This task must then be handled by the
CONTROL block.
Table 9.6
Format and meaning of parameters of DHB RECEIVE for the RECEIVE-DIRECT function
................ ......... .. . .. ::.:.:...:.:.:.:..
.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . ... .. .. ..................... ......' ...... ... .......................
...... .. .. .. .. .. .. .. ................
. . . . . . . . .:.::. .....
. . :..... ......................
..........................................
. . . . . .:.:....................
. .. . .. . .7.1:.:. . . . . . .
. ....... . . .
.......
.
Klhd
.
.
.
.. ... ... . .. .. .. . .. ......................................................................
. .
. . . . . . . . . . .. . . ... .... ,:~iif~g:;,,l:Ijj~:jj:Ij::~~$$:':::::::ii:ii~;:
. ... . . . . . .... .
. . . . . . . .. . . . . . . . .. . . . . . . . . . . . . .
:I : fiiTyp&:;:
:ilPafamakr
SSNR
D
KY
Interface number
A-NR
D
KY
Jobno.
ANZW
I
W
Status word
ZTYP
D
KS
Data type of destination
DBNR
D
KY
Number of data block if destination is data block
ZANF
D
KF
Starting address of destination
ZLAE
D
KF
Number of data units to be read (words or bytes)
PAFE
Q
BY
Parameter error bits
I
O Siemens AG 1991 C79000-B8576-C204-01
Data Handling Blocks
9.2.5.2 DHB RECEIVE-ALL
You require the DHB RECEIVE with the function RECEIVE-ALL in order to carry out
the data transmission from the CP 580 to the CPU e.g. with the mass storage
function.
Table 9.7
Format and meaning of parameters of DHB RECEIVE for the RECEIVE-ALL function
.......................................................................................................................
.............................
.
.
.
.
.... ....................... ......................:.:.:.:.:
.............................................................................
:::.:..................................................
.........................
...
.: :.............
. . . . . . . :::.::.:::.,., ...........................
.........................
. . . . . . . . . . . .<.:.:.:
. ...
...........................
.........
:,::p&2$m#fg~
$:w#!jd:;q,pg;
/,.
...............................................................................................
:...:.: . . . . . . .
;::::
.....................
..................
.j
..
...:,.....
..........................................................................
........................................................................
:
;;;:::;::.::m;$;
j;;jjiii:j::li:::,;~jj::j:,~;;:::~;:.j~:;,~~:;j::.j.~,.:~~
i:i,ililiii;;
.:...:.:.:.:.:..............I.......
' : :.:....:::::::
-... . .:.' ... . . . ... . . ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
SSNR
D
KY
Interface number
A-NR
D
KY
Jobno.
ANZ W
I
W
Status word
ZTYP
D
KS
DBNR
D
KY
These parameters are irrelevant with the function
RECEIVE-ALL; they must be specified for format
reasons, however
ZANF
D
KF
ZLAE
D
KF
PAFE
Q
BY
Parameter error bits
O Siemens AG 1991 C79999-BE57E-CX)4-01
Data Handling Blocks
9.2.6
DHB CONTROL
You can use the DHB CONTROL to scan status information of the interface. The
block has two modes
CONTROL-ALL (job number = 0)
CONTROL-DIRECT (job number # 0)
CONTROL-ALL:
The CONTROL-ALL function indicates in the Low byte of the ANZW which job is
currently being processed by the CP 580.
CONTROL-DIRECT:
A so-called job status exists in the interface for each job. This is managed by the
interface and indicates e.g. whether a job is (still) running, whether it has been
terminated without errors or terminated with a particular error. The
CONTROL-DIRECT function transfers the job status selected by the parameter A-NR
into the status word.
Table 9.8
Format and meaning of parameters of DHB CONTROL
......
. . . . .. . . . . . . . . . . . .
::::.........................
::;::'::::.:::.:
..::j:jj:;:j::.:.........................
. . ... ............................................
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .................................
. . . . . . . . . .:.:.:
. . . ..::.
. :...:.::.:;:.:.':::;:I.:::':fifl:::.:':::::I:.:
.........
:.... . . . . . .
....A
cKJfid:;;
.,.,::.:::: ........................................................... ;,: . . . . '. . . C. >.
.............A......
i::::@F
,i.:P~ameteiji:
~ ' ' ' . . ..;. ...:.. .;.....i.......i... .., ..~... .., ..~.........................................................
. . .. . ... . ..... ... .. ... . .. . . . . . .. .. .... .... ... ............j....{.. ..~.. ..f.. .~
.:. .: : :. . . . . . . . . . .:. . . . . . . . . ... . ..... . ..... . ...
. .... .. ~.. ...n.. .[. ~. . @
..$.. ..~. .. $.. .. [email protected]
.. .. .j. ..j. .. :.. .~.. .. j..':;$;:!
~
SSNR
D
KY
Interface number
A-NR
D
KY
Job no. of job to be monitored
ANZW
I
W
Status word: contains result of scan
PAFE
Q
BY
Parameter error bits
C2 Siemens AG 1991 C79000-B8576-C294-01
2
,
~
:
:
~
;
~
~
~
~
Data Handlina Blocks
9.2.7
DHB RESET
The DHB RESET has two modes
RESET-ALL (job number = 0)
RESET-DIRECT (job number # 0)
The RESET-ALL function (job number = 0) resets all jobs of the CP 580 interface.
With the RESET-DIRECT function (job number # 0),only the specified job of the CP
580 interface is reset.
Format and meaning of parameters of DHB RESET
Table 9.9
. xyp&
. . . ................................................
. . . . . . . . . . . ..:::::::.:::.:::.::
. . . . . . :..;:.:::::::
. . :,:,.
. . :.,. ...........
. . . . . .:............................
.:.,:. ..... :-..
. . ..:.......
. . :..
. ..:........
. ..:.::..........
::::.;:;:.:,::,;,;, .......................
.. . . . . . . . . . .:!>,
:': ":':':':': :.::. ........."..
. : ........
'."
.................................
..:.;:'.:.*:.c.c:.:
; c ..:':'
:.. ...:':..
...........................
.,.,:,:,:,,,.......
::...:::.:.:.:.:
...................
..................................................................
.: ::.:.: . :.:.:.:........
:,:,: ................... ..............................
...
:P&fgMetB#:ki3K(nd
~
~
~
f
"
@
~
j
j . . ... .j..
.................................................................
.::::::;:.,,:>.. ....... : ....................................
. . . . . . . . . . . . . . . . . . . i. .,.: ......................
. . . .....
. . .:.>.::.:.:.,.:...
. . . . . . . . . .....................
. . . . . . . . . . . . . . . . . . . ..... . . ..... . .:.:. ....
.............. :.;.::..::,. ..... : . ..:..:
....
../
....
SSNR
D
KY
Interface number
A-NR
D
KY
Job no, of job to be reset
PAFE
Q
BY
Parameter error bits
9.2.8
Status Word
Information on the status of job processing is stored in the status word. You define
the address of the status word when parameterizing. The information can then be
read and evaluated from here.
The status word is part of a doubleword which is addressed by the parameter ANZW.
The second part of the doubleword is the so-called length word.
O Siemens AG 1991 C7W00-88576-C2W-01
j
:
~
Data Handling Blocks
-
4 C
Bit NO.
n
1 Word n+l
15
12 11
8 7
0 0 0 0 .... ... . : . . . . . .. '. . .
1 1 1 1
\
V
,
A
Not used
' , ,
V
4
I I
3
Length word
0
j
Status word
1l
/
Error No.
1' IRECElYE readv for cornrnunic.
I I / 1 / I / with errors or not vet started
l l I l l/ 1 - '
1
1
*
1 SENDIFETCHIREC. ready with errors
0 SENDIFETCHIREC, running or ready
ll
( with errors or not yet started
" Error No. provides
I
1 I Data transfer disabled
0 I Data transfer enabled
Fig. 9.4
;
further information
on cause of error
Fcrrnat of DHB status words
Please note:
Assign a new status word to each job used.
If you must send two DHB calls in succession for a job (SEND - SEND-ALL,
FETCHIRECEIVE - RECEIVE-ALL), individual status words must always be
provided for each call since these are managed separately by the specified DHB.
D Siemens AG 1991 C79M)O-B8576-C2W.O1
9-19
Data Handling Blocks
Following synchronization, the CPJDHB driver initializes the status word with
0006H. This value is retained until an application (e.g. CPMASS) logs on for a
specific job number with the CPIDHB driver. The status word is then 0 (with
SEND) or 1 (with RECEIVE) until the first job has been processed.
You cannot send jobs to the CP 580 for the respective job number as
long as 0006H is present in the status word. Observe this response
when restarting the S5 program.
9.2.9
Parameter Assignment Error Bits
All data handling blocks check the transferred parameters for syntax errors and logic
errors when they are called. They also check the addressed interface to establish
whether it is available for the triggered function.
Whether parameter errors have occurred, and if so which ones, can be observed in
the status byte whose address you have defined by means of the parameter PAFE
when calling the DHB.
Table 9.10 shows a summary of the parameter error bits.
Table 9.10
Parameter error bits
~-
0 Siemens AG 1991 C79999-B8576-C294-01
Data Handling Blocks
I
I
PAFE
value Cause of error
I Continuation of Table 9.10
1
I
/
1
1
41H
1 Area does not exist or is illegal (with QTYPlZTYP
I
= AS, QA. I
51H
Status word (address) faulty
61H
Dependent on CPU
71H
lnterface does not exist
81H
lnterface not ready
91 H
lnterface overloaded
A1H
Dependent on CPU
B1H
Job number illegal or frame size (SYNCHRON) illegal
C1H
D1H
E1H
F1H
I
Interface does not react, or interface does not react at correct time, or
interface rejects job
I Dependent on CPU
1 Dependent on CPU
1 Dependent on CPU
A
Process Data Acquisition
9.3
Process Data Acquisition
9.3.1
Parameters for the Configuration File (Process Data Acquisition)
Refer to Section 4.3.2 for how to edit the configuration file supplied on the CP 580
according to the desired data transfer.
Table 9.11 shows you the meaning of the various parameters and the permissible
values.
Table 9.1 1
Parameters in the configuration file
RS for RS word
DB for data block DB
DX for data block DX
IA for input area
FA for F flag area
PY for I t 0 area
TA for timer cell area
CA for counter cell area
IA,
FA,
PY ,
TA,
CA
3
Block No.
Number of data block DB or DX on the
CPU if the data source is a data block; this
parameter has no significance for the other
data (the parameter line must still be
present, however!)
Dependent
on CPU
4
Offset
(QANF)
Number of 1st data unit to be read in the
S5 area
Dependent
on data
type and
CPU
Q Siemens AG 1991 C79999-B8576-C204-01
Process Data Acquisition
r
1
Line
No.
Parameter
Meaning
Permtssible
vabes
Continuation 1 of Table 9.1 1 :
Number of data units (words or bytes)
which are to be read from the S5 area
starting at "Offset"
6
7
/
8
1
Dependent
type and
MS-DOS
syntax
Destination
path
Path name for ASCll files
Extension
File name extension
Number of
files
Maximum number of ASCll files for
process data recording
Number of
data records
Maximum number of data records per
ASCll file
Format
MS-DOS
"Individual conversion:
Path and file name for format file or (only
syntax,
file name:
with DBIDX) for file with preheader data
"??????ST
.S5DWor
"+.FMT";
? = letter/
number or
1 to
10 000
@,
+
= max.
8 letters1
numbers
Process Data Acquisition
KS for 2character constant
KF for fixed-point number
KG for floating-point number
KH for hexadecimal number
KM for bit pattern
KT for timer value
KC for counter value
KY for 2-byte decimal number
KB for l-byte decimal number
(only meaningful for data areas IA, QA,
PY and FA)
KB
11
Field delimiter Characters by means of which the
individual data of a data record are to be
separated in the ASCll files (preset value:
space)
ASCll
characters
12
Acquisition
cycle
Cycle time in seconds in which the process
data are to be read by the CPU
1 to
11 799 360
13
Acquisition
mode
0: recording is terminated once the defined
0 and 1
Message
mode
CPRECORD can store error messages in
a logbook file:
0 = store no messages
1 = store messages
14
9 - 24
file number has been reached
1: "permanent" recording;
the oldest file is deleted when the
defined file number has been reached
and is then overwritten (similar to cyclic
mode)
O Siemens
0 and 1
AG 1991 C79999-98576-Cm-01
Process Data Acquisition
ont~nuation3 of Table 9.1 1 :
O Siemens AG 1991 C7~-B8576-C2W-01
Process Data Acquisition
9.3.2
Error Messages of the CPIDHB Driver and the CPRECORD Program
If special events are detected during process data acquisition, you can enter these
events as messages in a logbook file. You must have entered the name of this
logbook file in the configuration file. Please refer to Section 4.3.2.4.
Messages are sent by the CPIDHB driver and the CPRECORD program. The two
following tables show which messages can occur and what they mean.
9.3.2.1
Table 9.12
Error Messages of the CPIDHB Driver
Messages of the CPIDHB driver
O Siemens AG 1991 C79000-BB576-C204-01
Process Data Acquisition
9.3.2.2
Table 9.13
Error Messages of the CPRECORD Program
Messages of the CPRECORD program
Invalid output drive
MS-DOS output
Insufficient drive capacity
(<Actual value> <Required value>)
MS-DOS output
CPRECORD file cannot be removed from memory
MS-DOS output
Unknown option
Incorrect parameter in
CPRECORD command
S5D file: could not be opened
MS-DOS output
S5D file: read error
MS-DOS output
C
2 Siemens AG 1991 C79990-98576-C2C4-01
Process Data Acauisition
Format error, <Number> =
incorrect block number
S5D file:
wrong block no. in
DV preheader <Number>
S5D file:
DV preheader address too large (>4095) Format error
S5D file:
format error, first format = empty
Output drive full
MS-DOS output
Error when writing output file
MS-DOS output
Output directory not found
MS-DOS output
Configuration file: unknown S5 area
Insufficient number of available DOS clusters
(<Actual value> <Required value>) ')
CPRECORD.INI not found in current directory
C2 Siemens AG 1991 C79999-08576-C204-01
Process Data Acquisition
Remarks
Message
I Continuation 2 of Table 9.13:
!/
1
<Config file> = name of
configuration file
Configuration file extension is not ".INI":
<Config file>
CPiDHB driver not loaded
1
1
l
FMT file:
could not be opened
<FMT file>
MS-DOS output
<FMT file> = name of
format file
FMT file:
unknown format in line <n>
(<Format>)
<n> = line No.,
<Format> = incorrect
format
FMT file:
format error in line cn>
(<Format>)
<n> = line No.,
<Format> = incorrect
format
FMT file:
too long in line <n> onwards
(<Format>)
<n> = line No.,
<Format> = incorrect
format
S50 file format is permissible only with S5 area DB
or DX
Error when opening log file <Log file>
'l
Cluster = associated logic memory area on drive.
<Log file> = name of
logbook file
Process Data Acquisition
9.3.3
Hotkeys for CPRECORD
Hotkeys are key combinations with which a program executed in the background can
be accessed.
The background program constantly monitors the keyboard inputs and carries out the
desired function when the corresponding key combination is pressed.
The initiation of functions by hotkeys may fail if you have started a
in the foreground which frequently accesses the system
"Ote
program
programs.
O Siemens AG 1991 C7W-BB576-Cm-01
Process Data Acquisition
Table 9.14 shows you the hotkey functions.
Table 9.14
Hotkey functions for CPRECORD
current cursor position
CPRECORD outputs the status variables of
process data acquisition on the screen starting
at the current cursor position
Press keys
Interrupt or continue process data acquisition
(left key)
m
and
B
@ Siemens AG 1991 C79000-68576-C204-01
Mass Storage Functions
9.4
Mass Storage Functions
9.4.1
Data Handling Blocks for the Mass Storage Functions
Use the DHBs SEND-DIRECT and FETCH to trigger data transfer between the CP
580 and CPU.
The actual transfer of the useful data is carried out using SEND-ALL and
RECEIVE-ALL.
You can additionally use the DHBs CONTROL and RESET.
Table 9.15
Data handling blocks for the mass storage functions
CONTROL
-
No function
0
Indicates which job is currently being executed
A-NR
RESET
0
A-NR
FETCH
SYNCHRON
9 - 32
Updates the status word
Completely reset CPIDHB driver
Reset CPIDHB driver only for one job
1..g9 Trigger for reading a data area
of useful data to CP)
-
(-Ptransmit
address
Synchronize CP and CPU
Q Siemens AG 1991 C79000-B8576-C204-01
Mass Storage Functions
9.4.2
Error Bits of CPMASS Program
If the CPMASS program determines when processing a job from a CPU that the job
cannot be handled without errors, it sets error bits in the first status word of the two
words of the CPU addressed by ANZW (bit nos. 8 to 11).
Table 9.16 shows you the error bits which can occur when executing the mass
storage functions.
Table 9.16
Error bits of CPMASS program
C
2 Siemens AG 1991 C79009-08576-Cm-01
Mass Storage Functions
Q Siemens AG 1991 C79000-B8576-CM4-01
Command lnterpreter
9.5
Command lnterpreter
9.5.1
Data Handling Blocks for the Command lnterpreter
If you wish to transmit a command from a preset data block to the CP 580, you must
call the DHB SEND twice in the STEP 5 program, once with the function
SEND-DIRECT and then with the function SEND-ALL.
Table 9.17
Data handling blocks for the command interpreter
.................................................................................................................................
: ;.j..........................................
...: ...:.: ............................................:................
.:.:.:.:.:.::.;,, j:::
...,::
.. .::
:.:::::
:
:.:.:.::::.'
::
:':::::j.l:j
::".:'
'iow::il'[email protected];
..;:.:i:ii:':'j:::i.jj:;:g:$::jjljjl;:jj
jij::.~;:;:j::,j.ij$;:;:j~ 2.;
...........................................................................................
.....................................................
..:
SYNCHRON
SEND
-
Synchronize CP and CPU
209
Transfer of address of command to be sent
from the CPU to the CP 580 (SEND-DIRECT)
0
SEND-ALL function for triggering transmission
of the command to the CP 580 (SEND-ALL)
Command Interpreter
9.5.2
Error Bits of CPSHELL Program
If the CPSHELL command interpreter determines when processing a command from
a CPU that the command cannot be handled without errors, it sets error bits in the
first status word of the two words of the CPU addressed by ANZW (bit nos. 8 to 11).
Table 9.18 shows you the error bits which can occur when processing a command.
Table 9.18
I
Error bits of the CPSHELL command interpreter
floppy disk in the drive, or the printer is not ready
l
O Siemens AG 1991 C79000-B8576-C2W-01
Contents
Instructions
Contents, Page Overview
How to Use this Manual
C79000-88576-C204
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
7
Application Examples
8
Reference Section for System Software
Reference Section for Hardware
Technical Data
Reference Literature
Abbreviations
Index
Ordering Information
10
Contents
Contents
10
Reference Section for Hardware ........................................................10-3
10.1
Mechanical Construction of CP 580 ..........................
.
.
.. . . . . . . .10-4
10.1.1
Mechanical Construction of Basic Board...............................................
10-6
10.1.2
Mechanical Construction of Expansion Board..................................... 10-8
10.1.3
Pin Assignments of Backplane Connectors ....................................... 10-10
10.1.4
Controls and Displays .........................................................................
10-13
Switch and Jumper Settings on the Basic and Expansion Boards ...... 10-18
10.1.5
10.15.1 Switch and Jumper Settings on the Basic Board ................................ 10-18
Base Interface Number ...................................................................
10-19
10.1 .5.1 .1
Setting the Base Window Address ..................................................
10-20
10.1 5.1 .2
Enabling or Disabling of the Interprocessor Communication Flags 10-21
10.1S.1.3
10.15.1.4
Switching Between Page and Linear Addressing ........................... 10-22
10.1 S.2 Fixed Jumpers ...................... ........... ....................................................
10-22
10.1 5.3 Switch Settings on the Expansion Board ...........................................10-23
........................................................
10.1.6
CP 580 Drives .......................
.
10-25
10.1.6.1 Floppy Disk Drive ................................................................................
10-26
...................................................10-26
10.1.6.2 Hard Disk Drive ...................... .
.
.
10.1 .7
Extension Using Device Options ....................................................... 10-26
10.2
Connection of Devices..................................................................
10.2.1
10.2.2
10.2.3
10.2.3.1
10.2.3.2
10.2.4
10.2.5
10.2.6
Connection of a Keyboard ...................................................................
10-27
Connection of a Monitor ......................................................................
10-27
.......................
Connection of PT88N/PT89N, PT88SIPT89S Printers
10-28
Setting the Coding Switches on the Central Controller ....................... 10-28
Setting the Coding Switches on the Interface Adapter ........................ 10-29
Connection of PT10 Laser Printer ....................................................
10-34
..................
Selection of Cable Connectors for the Printer Connection
10-34
Connection of a Mouse ..................................................................... 10-37
Q Siemens AG 1991 C79000-B8576-C2W-01
10-27
Contents
Connector Interfaces of the CP 580 .................................................10-38
Serial Interface COM 1 ....................
..........
.
...................................10-39
Serial Interface COM 2 ........................................................................
10-40
10-41
Keyboard Interface KBD......................................................................
Serial Interface IF1 (COM 3) ..............................................................10-42
Serial interface IF2 (COM 4) ...............................................................
10-43
Video Outputs .....................................................................................10-44
Memory Division and Hardware Interrupts of the CP 580 ............. 10-45
Memory Division ..................................................................................
10-45
10-48
Hardware Interrupts.............................................................................
Conversion and Repairs ...................................................................10-49
D Siemens AG 1991 C79000-58576-C294-01
10
Reference Section for Hardware
This chapter provides you with detailed information on the hardware design of the CP
580.
You can read:
How the CP 580 is constructed, and what meaning the switch and jumper settings on the basic and expansion boards have
Which devices you can connect, and how you must set up a connected printer
How the CP 580 interfaces are assigned
What the memory and hardware interrupt assignments of the CP 580 are.
63 Siemens AG 1991 C79000-B8576-C204.01
Mechanical Construction of CP 580
10.1
Mechanical Construction of CP 580
The CP 580 is of double Eurocard format and thus suitable for the ES 902 modular
packaging system. The front panel width, including the integrated floppy disk and
hard disk drives, is 5 113 standard slots (approx. 80 mm) wide and thus occupies four
S5 slots in the main frame of the programmable controller.
The device comprises:
-
the basic board
- the expansion board
- the 3.5-inch floppy disk drive
- the 3.5-inch hard disk drive
The front panel contains the displays and controls as well as the interfaces to the
operation and peripheral devices. Fig. 10.1 shows you the design of the CP 580.
O Siemens AG 1991 C79000-B8576-CZM-C?
Mechanical Construction of CP 580
STW
IF2
cau
Fig. 10.1
L
Mechanical construction of CP 580
O Siemens AG 1991 C79000-B8576-C204.01
Mechanical Construction of CP 580
10.1.l Mechanical Construction of Basic Board
The basic board comprises:
- Two 48-pin backplane connectors of series 2 for connecting the CP 580 to the
-
S5 bus (backplane bus) of the programmable controllers (backplane connectors
1 and 2)
One 25-way female connector (Cannon plug) for connection of a printer (COM 1)
One 9-way female connector (Cannon plug) for connection of the optical mouse
(COM 2)
One 7-way round socket for connection of the PG 750 keyboard (KBD)
One 128-way plug connector for connection of the expansion board
One 96-way plug connector for connection of an expanded memory
One 68-way socket for connection of an arithmetic processor
One RUNISTOP switch for selection of the mode
Diagnosis LED; RUNISTOPIFAULT LED; RESET key.
O Siemens
AG 1991 C79000-88576.C204-0:
Mechanical Construction of CP 580
\
/
RUNISTOP switch
Backplane connector 1
Connection for expansion
Socket for arithmetic
\
-COM 1 interface
Backplane
connector 2
--
\
-COM 2 interface
L-
-KBD interface
\
Fig. 10.2
Right-hand side of basic board
C
3 Siemens AG 1991 C790OO-B8576-C294-01
/
Mechanical Construction of CP 580
10.1.2
Mechanical Construction of Expansion Board
The expansion board comprises:
-
-
-
-
One 48-pin backplane connector of series 2 for connecting the CP 580 to the S5
bus (backplane bus) of the programmable controllers (backplane connector 3)
One 15-way female connector, IF1 interface (COM 3)
One 15-way female connector, IF2 interface (COM 4)
Three coaxial sockets for connection of the monitor
One 128-way plug connector for connection of the basic board
One 34-way plug connector for connection of the floppy disk drive
One 40-way plug connector for connection of the hard disk drive
Two 4-way plug connectors for the power supply to the floppy disk and hard disk
drives
One LED "HD busy".
C
2 Siemens AG 1991 C79000-B8576-C294-01
Mechanical Construction of CP 580
Fig. 10.3
Right-hand side of expansion board
8 Siemens AG 1991 C79000-B8576-C204-01
Mechanical Construction of CP 580
10.1.3
Pin Assignments of Backplane Connectors
The CP 580 is connected to the wiring backplane of the programmable controller via
three 48-pin backplane connectors of series 2. The pin assignments of these three
connectors are shown in the following tables.
Pin assignments of backplane connector 1 (top of basic board)
Table 10.1
d
2
b
z
Ground
+5V
4
UBATT
6
ADB 12
ADB 0
CPKL
8
ADB 13
ADB 1
/MEMR
10
ADB 14
ADB 2
/MEMW
12
ADB 15
ADB 3
/RDY
14
ADB 4
DB 0
16
ADB 5
DB 1
18
ADB 6
DB 2
20
ADB 7
DB 3
22
ADB 8
DB 4
24
ADB 9
DB 5
26
ADB 10
DB 6
ADB 11
DB 7
28
/DSI
30
32
Ground
O Siemens AG 1991 C7900O-B8576-C204-01
Mechanical Constructior~of CP 580
Most of the bus signals are connected to backplane connector 1 of the basic board,
the module power supply is additionally connected via backplane connector 2 of the
basic board and backplane connector 1 of the expansion board.
Table 10.2
Pin assignments of backplane connector 2 (bottom of basic board)
O Siemens AG 1991 C79000-B8576-C2W-01
Mechanical Construction of CP 580
Table 10.3
Pin assignments of backplane connector 1 (top of expansion board)
d
2
b
z
Ground
+5V
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
Ground
Mechanical Construction of CP 580
10.1.4
Controls and Displays
Fig. 10.4 shows you the positions of the controls and displays on the front panel
Fig. 10.4
Position of controls and displays on the front panel of the CP 580
O Siemens AG 1991 C79MX)-B8576-C2W-01
Mechanical Construction of CP 580
Controls:
-
- RUNISTOP
Switch
Switching from RUN to STOP:
Bus communication at the S5 interface is disabled.
A RESET-ALL is triggered at the CP 580 end and completely
resets the CPIDHB driver. (This corresponds to triggering of a
RESET-ALL by the corresponding DHB at the CPU end.)
Switching from STOP to RUN:
Data transfer at the S5 interface is enabled again.
-
-
-
Key
RESET
Pressing this key completely resets the board.
Displays:
The displays are divided into:
Operation displays
Fault displays
Access displays for the drives.
Operation displays:
- Green LED
RUN
Signals the status "S5 interface in operation"; the LED can
only light up if the mode switch is set to RUN and if at least
one CPU is synchronized.
-
- Red LED
-
-
-
STOP
Continuous light signals the status "S5 interface out of
operation" if the mode switch is set to STOP.
Flashing signals the status "Mode switch at RUN", but no
CPU synchronized.
O Siemens AG 1991 C79000-B8576-C2~%-01
Mechanical Construction of CP 580
- Red LED (small)
-
-
FAULT
This LED goes off due to the BlOS during the CP restart if
the S5 interface hardware is ready.
The following table shows you the meaning of the displays (assuming the CPIDHB
driver is loaded):
Table 10.4
Operation and fault displays on the LEDs RUNISTOP and FAULT
RUN LED
STOP LED
0
0
0
0
0
1
(continuous)
RUNISTOP switch in STOP position.
0
0
Flashing
RUNISTOP switch in RUN position.
CP 580 ist not synchronized with any
CPU.
0
1
FAULT LED
*
0
Meaning
CPIDHB driver was correctly installed
in main memory.
RUNISTOP switch in RUN position.
At least one CPU is synchronized.
The FAULT LED goes off during the restart.
If this LED does not go off, please contact your Siemens representative.
O Siemens
AG 1991 C79090-08576-C204-01
Mechanical Construction of CP 580
Fault displays:
- Row of green LEDs
DIAG
When the CP 580 is switched on, the ROM BlOS carries out
a power-on selftest. If an error occurs at the beginning of the
selftest, the error code is displayed on the diagnosis LEDs via
port 80H in hexadecimal format and the screen remains dark.
If the selftest has continued further, an error message
appears in addition on the screen.
The significance of the diagnosis display must be interpreted
as follows:
-
-
LED off = 0
LED on = 1
Error messages > 32H are internal displays of the BlOS and are
of no significance to the user.
Exception:
57H appears if the CP 580 has run up correctly and MS-DOS
was started.
Q Siemens AG 1991 C79OOO-BB576-C2Ol-O1
Mechanical Construction of CP 580
The error codes of the fault display on the diagnosis panel have the following
meaning:
Table 10.5
Display
01H
02H
03H
04H
05H
06H
08H
09H
OAH
OBH
OCH
ODH
1OH
11H
12H
13H
14H
15H
16H
17H
18H
19H
1AH
1BH
1CH
1DH
1EH
1FH
20H
21H
22H
23H
25H
27H
28H
29H
2BH
2CH
2DH
2EH
30H
31H
32H
57H
O Siemens
Meaning of error codes on the diagnosis panel
Error description
CPU register test running
CMOS readkrite error
ROM BlOS checksum error
Programmable timer interval error
DMA initialization error
DMA page register read/write error
Error when checking the RAM refresh
First 64K RAM test running
64K RAM chip or data line error (multi-bit error)
64K RAM oddleven logic error
64K RAM address line error
64K RAM parity error
64K RAM error bit 0
64K RAM error bit 1
64K RAM error bit 2
64K RAM error bit 3
64K RAM error bit 4
64K RAM error bit 5
64K RAM error bit 6
64K RAM error bit 7
64K RAM error bit 8
64K RAM error bit 9
64K RAM error bit A
64K RAM error bit B
64K RAM error bit C
64K RAM error bit D
64K RAM error bit E
64K RAM error bit F
Slave DMA register error
Master DMA register error
Master interrupt register error
Slave interrupt register error
Interrupt vector is loaded
Error with keyboard controller test
CMOS error, checksum is generated
CMOS is configured
Error when initializing screen
Error during display repetition test
Check whether video ROM present
Video ROM is started
Assumption that screen is ready
Assumption that black-and-white screen is ready
Assumption that color monitor (40 columns) is ready
No error
AG 1991 C79000-68576-Cm-01
10 - 17
Mechanical Construction of CP 580
Access displays for the drives
Access to the drives is signalled by LEDs:
- Display for floppy disk access on the floppy disk drive
- Display for hard disk access above the interface IF1.
10.1.5
Switch and Jumper Settings on the Basic and Expansion Boards
Please refer to the installation and commissioning part in Section 2.2.2 of this Manual
for the basic settings for operation of the CP 580. Figs. 10.5 and 10.8 show you the
positions of the coding switches and jumpers on the basic and expansion boards.
The following sections provide you with further information on the coding switches
and plug-in jumpers.
-
10.1.5.1 Switch and Jumper Settings on the Basic Board
Base window
Interface number (0 set here)
I
Used internally (must be
set to "OFF")
I
I
assembly 3
Interprocessor
Not
used
I
OFF means away from the PCB.
The significance of the switches
is shown in the following Figs.
Fig. 10.5
10 - 18
OFF ON
Position of coding switches and jumpers on the basic board
Q Siemens AG 1991 C79000-08576-C2M-01
Mechanical Construction of CP 580
The coding switches and plug-in jumpers are located along the top edge of the basic
board. You can make the following settings on the basic boards:
- Setting of base interface number
-
Setting of base window address
- Enabling or disabling of communication flags
- Switching from page addressing to linear addressing.
10.1.5.1 .l Base Interface Number
Refer to Section 2.2.2.1 in the installation and commissioning part of this Manual for
the setting of the base interface number.
O Siemens AG 1991 C79000-68576-C2W-01
Mechanical Construction of CP 580
10.1.5.1.2 Setting the Base Window Address
A
Caution
The data handling blocks supplied by Siemens are matched to the
specified delivery state. The factory assignments must therefore not
be changed.
When selecting a page using the page selection register, this page is set into a
so-called address window with a size of 1 kbyte. This is positioned as standard at
F400H (61K) in the address area of the central processing unit of the programmable
controller. It can be set to any other 1-K limit, however, using assembly 2 of the
coding switches (see Fig. 10.6).
Not used
Significance:
Switch assembly 2
OFF means away from the PCB.
OFF: significance = l
The address can be set in steps of 1K. This results in the above significance
of switches 1 to 6 (switch 1 is assigned address 15).
Fig. 10.6
Setting of base window address
Q Siemens AG 1991 C79000-B8576-C2M-01
Mechanical Construction of CP 580
10.1.5.1.3 Enabling or Disabling of the lnterprocessor Communication Flags
All interprocessor communication flags are disabled i n the factory settings
since the supplied software of the CP 580 dQeS not currently use
communication flags. You can address the communication flags by means of
free programming, however.
The interprocessor communication flag area comprises 256 communication flag bytes
(= 2048 communication flags). The communication flags are transferred cyclically
between the CPU and the communications processors and can be used for
coordination.
The same applies to multi-processoroperation with several CPUs in the S5-135U and
S5-155U programmable controllers.
You can enable or disable the communication flags in groups of 32 flag bytes using
assembly 3 of the coding switches.
- Switch ON means area enabled
- Switch OFF means area disabled.
Switch assembly 3
OFF means away from the PCB.
OFF ON
Fig. 10.7
All areas are disabled in the
factory setting1
Assignment of area
O Siemens AG 1991 C79909-B8576-C204-01
Mechanical Construction of CP 580
10.1S.1.4 Switching Between Page and Linear Addressing
This jumper must always be inserted when using the data handling blocks.
You can select the respective addressing mode using the plug-in jumper "Pagellinear
addressing" (see Fig. 10.5).
-
Page addressing - jumper inserted
- Linear addressing - jumper open
10.1.5.2 Fixed Jumpers
All plug-In jumpers are Inserted when the CP 580 is delivered and must not be
changed.
The basic and expansion boards contain a number of plug-in jumpers which are only
used for diagnostic purposes in a test bay.
O Siemens AG 1991 C79000-58576-C204-01
Mechanical Construction of CP 580
10.1.5.3 Switch Settings on the Expanslon Board
The coding switches are already factory-set for normal operation and must not
be changed.
The coding switch assembly is on the top side of the expansion board.
The following settings can be made on the expansion board:
-
Address switchover of serial interfaces IF1 and IF2 (COM 3 and COM 4)
Interrupt switchover of serial interfaces IF1 and IF2 (COM 3 and COM 4)
Common interrupt processing
Information for the system via the hard disk drive.
Fig. 10.8 shows you the position of the coding switch assembly on the expansion
board.
The switch settings have the following meanings:
- Switches 1 and 2 are for test purposes and must always be set to "ON" for
normal operation
- Switch 3 (SEL1) is used for address switchover for the serial interfaces IF1 and
IF2 (COM 3 and COM 4)
-
Position OFF: IF1 is at address 03E8h - 03EFh
IF2 is at address 02E8h - 02EFh
-
Position ON:
IF1 is at address 01 BOh - 01B7h
IF2 is at address 01B8h - 01BFh
- Switch 4 (SEL2) is used for interrupt switchover for the serial interfaces IF1 and
IF2
Position OFF: IF1 and IF2 use interrupt 10 (common interrupt)
Position ON: IF1 and IF2 use interrupt 5 (common interrupt)
Mechanical Construction of CP 580
-
Switch 5 (SEL3)
The interrupts of the serial interfaces IF1 and IF2 are applied to a common
interrupt (IRQ5 or IRQ10).
Hardware support can be activated to process several interrupt requests should
they occur simultaneously.
Position OFF: without hardware support
The interrupt service routine must ensure complete processing of all existing
interrupts. The interrupt is blocked if an interrupt request is not processed. No
further requests can then be placed by either of the two interfaces.
Position ON: with hardware support
An existing request is recognized following processing of an interrupt, and a
further interrupt triggered. This is repeated until no further requests are present.
Note that the hardware for recognizing further requests must be reactivated each
time an interrupt is processed. This is achieved by writing and reading address
288H with any data.
- Switch 6 informs the system that the hard disk drive has a capacity of 40 Mbyte.
Switch 6 must always be set to ON.
-
Switches 7 and 8 are reserved and must be set to OFF.
Must be set
Backplane connector 1
Top edge of PC6
OFF means away from the PCB.
Front panel
The switches are factory-set as shown above.
Fig. 10.8
OFF ON
Coding switch assembly on the expansion board
C 3 Siemens AG 1991 C79000-08576-C2C.-Ol
Mechanical Construction of CP 580
10.1.6
CP 580 Drives
The CP 580 is equipped with mass storage floppy disk and hard disk drives to store
system programs, user programs and process data for subsequent evaluation. Fig.
10.9 shows you the drive positions.
LED for access to hard disk
Floppy disk eject button
@RUN
@STOP
FAULT
Q
. Floppy disk drive
DlAG
RESET
a
LED for access to floppy disk
Hard disk drive
l
Fig. 10.9
KEYBOARD
Drive positions on the CP 580
O Siemens AG 1991 C79000-06576-Cm-01
Mechanical Construction of CP 580
10.1.6.1 Floppy Disk Drlve
The floppy disk must not be removed when the drive lamp (LED) is on.
The 3.5-inch floppy disk drive of the CP 580 is connected to the disk interface of the
37C65 floppy controller via a 34-pin plug connector. Double-sided 3.5-inch floppy
disks (80 tracks per side) can be used, either high density with 1.44 Mbytes or normal
density with 720 Kbytes. The drive is automatically adapted to the type of disk by
checking the HD opening on the disk.
10.1.6.2 Hard Disk Drive
The hard disk drive autornatlcally moves into the transport position when
switched off.
The 3.5-inch hard disk drive of the CP 580 is connected to the AT bus via a 40-pin
plug connector. The HD is equipped for this purpose with a PCIAT interface.
The hard disk has a total storage capacity of 40 Mbytes.
Logical drives can be produced using the operating system. Please refer to the
description of your operating system.
The LED on the front panel of the CP 580 lights up when the hard disk drive is
accessed.
10.1.7
Extension Using Device Options
There are currently no extension options.
Q Siemens AG 1991 C79000-88576-C204-01
Connection of Devices
10.2
Connection of Devices
This section describes any special considerations to be made when connecting
devices, e.g. the setting of the coding switches with certain printers and selection of
the printer cables.
10.2.1
Connection of a Keyboard
We recommend the connection of a PG 750 keyboard. Connect the keyboard to the
KBD interface.
10.2.2
Connection of a Monitor
We recommend a monitor where the video ground is isolated from the protective
ground.
It is essential to obsetve the installation and connection guidelines for
monitors in Section 2.2.4.2!
Q Siemens AG 1991
C79000-B8576-C204-01
Connection of Devices
10.2.3
Connection of PT88N/PT89N, PT88SlPT89S Printers
Recommended printers are the PT88N/PT89N, PT88S/PT89S printers or the PT10
laser printer. The PT88N/PT89N, PT88SlPT89S are connected to the CP 580 via a
V.24 or TTY (20-mA current loop) interface adapter (see Section 10.2.4 for the PT10).
The printer parameters of the CP 580 are set as follows during the start-up by means
of an AUTOEXEC.BAT file already contained in the standard delivery:
-
Printer interface is COM 1 (the instruction C:MODE LPT1:=COM 1: is present in
the AUTOEXEC.BAT file)
- Printer parameters: 9600 baud, no parity, 8 data bits, 1 stop bit, p (the instruction
C:MODE COM 1:96,n18,1,p is present in the AUTOEXEC-BATfile).
p means: A printer with a serial interface is connected.
Before you connect the printer to the CP 580, you must set the coding switches on
the central controller of the printer or on the interface adapter.
Refer to the description of your printer for more details on the meaning of the switch
positions.
10.2.3.1 Setting the Coding Switches on the Central Controller
With the PT88NlPT89N and PT88SlPT89S printers you can select certain standard
functions and the character set.
Use a coding switch for this purpose. The coding switch is accessible by opening the
front flap of the housing. Two coding switches are present here in the PT88SIPT89S
printers.
Figs. 10.10 and 10.11 show you how to set the coding switches.
O Siemens
AG
1991 C79000-B8576-C2M-01
Connection of Devices
ON OFF
(German keyboard, LF = CR + LF , CR = CR,
form length 12", line teed 1/6", 80 character/line)
Fig. 10.10 Coding switches on the central controller with PT88NIPT89N
Not used
n
(German keyboard, CR = CR, letter spacing 1/10", normal character font,
number 0 printed without slash, form length 12", line feed 1/6",
no paper teed at end of defined tonn length, printer always selected,
8th bit = 1; bit 8 is evaluated)
ON
OFF
Fig. 10.1 1 Coding switches on the central controller with PT88S/PT89S
10.2.3.2 Setting the Coding Switches on the lnterface Adapter
The following interface adapters are available since the printers can be connected
either via a V.24 or TTY interface using the serial interface COM 1 of the CP 580.
- lnterface adapter SAP-S1 (V.24lV.28)
- lnterface adapter SAP-S2 (TTYl20 mA)
- lnterface adapter SAP-S3 ( m 2 0 mA; V.24)
O Siemens AG 1991 C79000-08576-C204-01
Connection of Devices
Interface adapter SAP-S1 (V.24N.28)
The mode switches S1 and S2 on the interface adapter SAP-S1 must be set as
follows for the PT88NtPT89N and PT88SlPT89S printers. Refer to Fig. 10.12.
S1: 9600 baud, operation with BUSY signal
S2: Busy at pin 25, negative potential
ON
OFF
Fig. 10.12 Setting of mode switches
Fig. 10.13 shows you the position of the mode switches on the interface adapter
SAP-S1.
- -
S22767 B1 A1 00
S2
S1
32
Pin 1
I
Fig. 10.13 Mode switches on !he interface adapter SAP-S1
10-30
@ Siemens AG 1991 C79000-B8576-C2W-01
Connection of Devices
Interface adapter SAP42 (TTYI2O m A)
The mode switches S1 and S2 on the interface adapter SAP-S2 must be set as
follows for the PT88NlPT89N and PT88SlPT89S printers. Refer to Fig. 10.14.
S2
S1
S1: 9600 baud, operation with BUSY signal
S2: internal supply
ON OFF
Fig. 10.14 Setting of mode switches
Fig. 10.15 shows you the position of the mode switches on the interface adapter
SAP-S2.
- -
S22767 B2 A1 00
32
Fig. 10.15 Mode switches on the interface adapter SAP-S2
O Siemens AG 1991 C79000-BB576-C2C4-01
Pin 1
Connection of Devices
Interface adapter SAP-S3 (TTYI2O mA; V.24)
The mode switches S1 to S4 on the interface adapter SAP-S3 must be set as follows
for the PT88NlPT89N and PT88S/PT89S printers. Refer to Fig. 10.16.
S4 in position 1 = V.24
2
3
4
5
6
7
ON
8
OFF
S l : 9600 baud, BUSY signal on pin 25, BUSY means negative potential
Note:
The mode switches S2 and S3 are only
significant with TTY operation
S4 in position 2 = TTY
ON
OFF
Sl:9600 baud, BUSY with current
1
1
2
3
4
1
ON
OFF
S2 and S3: internal supply
Fig. 10.16 Setting of mode switches
Q Siemens AG 1991 C79999-B6576-C204-01
Connection of D e v l ~ e s
There are two different settings:
Mode switch S4 in position 1 = V.24 interface
Mode switch S4 in position 2 = TTY interface
Mode switch S4 - setting of interface version (see Table 10.6)
Table 10.6
Interface
Position
RS-232-C (V.24lV.28)
Fig. 10.17 shows you the position of the mode switches on the interface adapter
SAP-S3.
- -
S22767 B3 A100
S3
S2
32
------
Pln l
I
Fig. 10.17 Mode switches on the interface adapter SAP-S3
E2 Siemens AG 1991 C79999-B8579-C204-01
Connection of Devices
10.2.4
Connection of PT10 Laser Printer
You can connect the PT10 laser printer to V.24 interface of COM 1. It is set using the
menu key in the offline status.
Further information is contained in the instructions for your printer.
Recomrnmended printer setting:
SYMSET= ROMAN 8
AUTO CONT= OFF
I/O= SERIAL
BAUDRATE= 9600
ROBUST XON= OFF
DTR POLARITY= HI
10.2.5
Selection of Cable Connectors for the Printer Connection
Standard cable connectors available with a variable length can be used for
connecting the printer.
Note the maximum cable length with the V.24 and TTYl20-mA interface versions.
Refer to Section 2.2.4.5.
O Siemens AG 1991 C79000-08576-C2M-01
Connection of Devices
Example of a simple null modem cable for connection to the V.24 interface of the
COM 1 of the CP 580.
CP 580
Cable
Cannon plug connector,
25-pin
PT88IPT89, PT88StPT89S
Cannon plug connector,
25-pin
1
1 Connector housinglscreen
RxD
3
2 TxD
Tx D
2
3 RxD
Connector housingtscreen
4 RTS
5 CTS
6 DSR
DTR
22 RI
Signal GND
7
RTS
4
CTS
5
DSR
6
RI
7 Signal GND
25 DTR
22
Fig. 10.18 Null modem cable for connection to the V.24 interface of COM 1
O Siemens AG 1991 C79000-B8576-CX)4-01
Connection of Devices
Example of a cable for connection to the TTY interface of the COM 1 of the CP 580.
CP 580
Cannon plug connector,
25-pin
Connector housinglscreen 1
Cable
PT881PT89, PT88SlPT89S
Cannon plug connector,
25-pin
l Connector housing/screen
Fig. 10.19 Printer cable for connection to the TTY interface of COM 1
O Siemens AG 1991 C79000-BB576-C2M-01
Connection of Devices
10.2.6
Connection of a Mouse
The CP 580 software supplied does not use a mouse!
You can nevertheless use a mouse if this is supported by the MS-DOS programs
which you use on the CP 580.
We recommend the PG 750 mouse with board. The cursor on the screen follows the
movement of the mouse on the board. Thus individual operations and functions can
be selected and executed simply (by clicking). To ensure that the mouse movements
are converted correctly to cursor movements, the board must be positioned sideways
underneath the mouse.
Refer to Fig. 10.20.
Grid
Board
Fig. 10.20 Position of optical mouse on the board
O Siemens AG 1991 C79000-BB576-C2W-01
Mouse
Connector Interfaces of the CP 580
The mouse can be connected to your CP 580 in the following manner:
-
Via the serial interface COM 2 on the front panel of the CP 580
Via the mouse plug fitted on the side of the PG 750 keyboard.
You must only use one of the two Interfaces, since the COM 2 interface is also
occupied when the PG 750 keyboard is connected!
r,
Other pointing devices can also be connected to the interface COM 2 .
If you wish to connect a mouse from another manufacturer, note that
not every make can be used at the keyboard interface!
10.3
Connector lnterfaces of the CP 580
The interfaces on the front panel of the CP 580 are used to connect all operation and
peripheral devices.
Observe the following when connecting the devices:
- The interfaces COM 1 and COM 2 have locking screws to secure the plug
contacts.
-
The interfaces IF1 and IF2 have a sliding lock to secure the plug contacts.
The interfaces IF1 and IF2 (COM 3 and COM 4) are not supported by the CP
580 software.
Q Siemens AG 1991 C79000-B8576-CPU-01
Connector Interfaces of the CP 580
10.3.1
Serial Interface COM 1
The 25-pin plug designated COM 1 has the standard pin assignments of the V.24
transmission signals plus the signals for active TTY operation (20 mA). The COM 1
interface is compatible with the industrial standard. It can be used to connect printers
with serial interfaces.
The control signals required for modem control are present on the 25-pin plug.
Table 10.7
Pin assignments of serial interface COM 1, V.24tTTY assignment
1
Screen
2
TXD (D11103)
3
RXD (D2)
4
RTS (S21105)
5
CTS (M2)
6
DSR (M11107)
,7
GND (E2)
8
DCD (M51109)
,9
11
TTY
10
TTY
- RxD
18
ll-Y
+ TxD
20
22
24
DTR (SI)
+ RxD
12
13
14
15
17
16
19
21
+24V floating
TTY - TxD
23
25
O Siemens AG 1991 C790W-B8576-C204-01
RI (M3)
Connector Interfaces of the CP 580
10.3.2
Serial Interface COM 2
The 9-pin plug designated COM 2 also has pin assignments for signals to the V.24
standard. Like COM 1, the interface is compatible with the industrial standard. The
interface which is usually for connection of a mouse has modem control signals in
addition to the V.24 data, transmit and receive lines.
Table 10.8
Pin assignments of serial interface COM 2, V.24 assignments
8 Siemens AG 1991 C79000-08576-C204-0:
Connector Interfaces of the CP 580
10.3.3
Keyboard Interface KBD
A 7-pin round socket is provided to connect a PG 750 keyboard. As an extension to
the 5-pin standard, it is additionally fitted with the data lines for connecting a mouse.
Table 10.9
Pin assignments of serial interface KBD, l T L assignments
1
Clock
2
3
Data
Ground (+S V)
4
Ground (+5 V)
5
+5 v
TxD (mouse1COM 2)
RxD (muse1COM 2)
6
7
O Siemens AG 1991 C79000-B8576-C2W-01
Connector Interfaces of the CP 580
10.3.4
Serial Interface IF1 (COM 3)
This interface is not supported by the software.
The 15-pin plug designated IF1 is designed as a serial, asynchronous TTY interface
(20-mA current loop) and conforms with the special SlMATlC requirements (pin
assignments).
Table 10.10
Pin assignments of serial interface IF1, l T Y assignments
O Siemens AG 1991 C79000-08576-C204 01
Connector Interfaces of the CP 580
10.3.5
Serial Interface IF2 (COM 4)
This interface is not supported by the software.
The 15-pin plug designated IF2 is designed as an X.27 (RS 422) interface.
Table 10.11
Pin assignments of serial interface IF2, X.27 (RS 422) assignments
O Siemens AG 1991 C79000-B8576-C2W-01
Connector Interfaces of the CP 580
10.3.6
Video Outputs
The three coaxial sockets on the front panel of the CP 580 are used to connect a
monitor via double-screen coaxial cables (triax cables). They are assigned the
following signals:
-
Red (R)
GreenISYNC signal (G/S)
- Blue (B)
A
Caution
The sockets are non-floating.
O Siemens AG 1991 C79000-88576-C204-01
Memory Division and Hardware Interrupts of the CP 580
10.4
Memory Division and Hardware lnterrupts of the CP 580
10.4.1
Memory Division
In the assignment of the address areas, a differentiation is made between
- the memory address area and
- the I10 address area.
FFFFOOOO
FFFFFF
I
AT BlOS
FFOOOO
I
800000
Extended
100000
AT BlOS
VGA BlOS
0C0000
OAOOOO
OOOOOO
P=-l1
1
Conventional
Fig. 10.21 Assignment of memory address area
O Siemens AG 1991 C79000-B8576-CX4-01
Size depends on
memory configuration
Memorv Division and Hardware lnterru~tsof the CP 580
Table 10.12
Assignment of I10 address area
Hardware
interrupt
used
110 address
assignment
Cornponent/module
0000H-001FH
0020H-0021H
0040H-005FH
0060H&0064H
0061H-006FH
DMA controller 1 (8237)
interrupt controller 1 (masterl8259A)
Timer (8254)
Keyboard controller (8042)
Port B : timer/loudspeaker/parity system bus/
RAM
Real-time clock, NMI enable
DMA page register
PORT A: configuration
Interrupt controller 2 (slavel8259A)
DMA controller 2 (8237)
Configuration ASlCs
Numeric processor (80387 SX)
Reserved (SINEC H1 interface)
Not used
Reserved (Winchester controller 2)
Not used
Winchester controller 1
Reserved (game 110)
Reserved (e.g. RAM page)
Reserved (parallel interface 2)
Reserved (e.g. RAM page)
Reserved (color graphics 2lEGA)
Reserved
0070FH-007FH
0080FH-008FH
0092H
00AOH-00BFH
00COH-00DFH
00EOH-00EFH
bOOFOH-OOFFH
0100H-010FH
01 1OH-016FH
0170H-0177H
0178H-01EFH
01 FOH-01FFH
0200H-020FH
021OH-0277H
0278H-027FH
0280H-02AFH
02BOH-02DFH
02EOH-02F7H
IRQ 0
IRQ 1
NMI
IRQ 8
IRQ 2
IRQ 13
IRQ 12
IRQ 14
O Siemens AG 1991 C79000-B8576-C2M-01
Memory Division and Hardware Interrupts of the CP 580
I10 address
assignment
Component/module
02E8H-02EFH
02F8H-02FFH
0300H-031FH
0320H-033FH
0340H-035FH
0360H-036FH
0370H-0377H
0378H-037FH
0380H-038FH
0390H-039FH
03AOH-03AFH
03BOH-03BFH
03COH-03CFH
03DOH-03DFH
03EOH-03EFH
03E8H-03EFH
03FOH-03F7H
03F8H-03FFH
0400H-4FFFH
.5000H-55FFH
5600H-FFFFH
IF2 presetting (switch 3)
Serial interface 2 (COM 2)
Reserved (prototype card)
Not used
Reserved (HIGRAPH (CPU) host interface)
Reserved (IBM PC NET)
Reserved (floppy controller 2)
Reserved (parallel interface 1)
Reserved
Reserved (SINEC H2 interface)
Reserved
B/W monitor interface or EGANGA
Color graphics interface EGANGA
Color graphics interface CGAfEGAIVGA
Not used
IF1 presetting (switch 3)
Floppy controller
Serial interface 1 (COM 2)
Reserved
S5 interface
Reserved
O Siemens AG 1991 C79000-08576-C2W-01
Hardware
interrupt
used
IRQ10
IRQ 3
IRQ 11
IRQ 7
IRQ 12
IRQ 9
IRQ 10
IRQ 6 DRQIDACK 2
IRQ 4
IRQ 15
Memory Division and Hardware Interrupts of the CP 580
10.4.2
Hardware Interrupts
Table 10.13
Summary of hardware interrupts
NMI
RAM parity; I10 channel pariiy, mains failure
IRQ 0
82 C 84 timer 0
IRQ 1
Keyboard controller
IRQ 2
Interrupt controller 2
IRQ 3
Serial interface 2 (COM 2)
IRQ 4
Serial interface 1 (COM 1)
IRQ 5
free
IRQ 6
Floppy controller 1
IRQ 7
Parallel interface 1
IRQ 8
Clock, internal to 110 controller
IRQ 9
EGAIVGA
IRQ 10
Serial interface 3 (IF1) 1 serial interface 4 (IF2)
IRQ 11
Reserved (HIGRAPH)
IRQ 12
Reserved (LAN AS)
IRQ 13
Numeric processor
IRQ 14
Winchester controller 1
IRQ 15
S5 coupling
O Siemens AG 1991 C79000-B6576-C204-01
Conversion and Repairs
10.5
Conversion and Repairs
Note
Do not carry out any conversions!
Conversions must only be carried out by Siemens or by
companies authorized by Siemens.
L
O Siemens AG
1991 C79000-88576-C2W-O1
Contents
Instructions
Contents, Pa e Overview
How to Use t is Manual
\
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
7
Application Examples
8
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
Contents
Contents
11
Technical Data of CP 580
...................................................................
11-3
Devicespecific Data .........................................................................11-3
.
.
.
.............................................................
Power Supply................
11-3
Current Consumption .........................................................................
11-3
Safety
.....................................................................................................11-4
Electromagnetic Compatibility (EMC) ................................................11-4
Climatic Conditlons..............................................................................
11-4
Mechanical Environmental Conditions ..............................................
11-5
Logic Parameters
.................................................................................
O Siemens AG 1991 C79000-B8576.C204-01
11-5
Contents
O Siemens AG 1991 C79999-B8576-C2C4-01
Device-specific Data
11
Technical Data of CP 580
11.l
Device-specific Data
Weight
approx. 3 kg
Module format
Double Eurocard format
(160 mm X 233.4 mm)
Front panel width
81.28 mm (5 113 standard slots)
Four S5 slots
Backplane connector
ES 902, series 2, 48-pin
Front plug
COM 1
COM 2
KBD
IF1 (COM 3)
IF2 (COM 4)
VIDEO
Female connector, 25-pin
Male connector, 9-pin
Round socket, 7-pin
Female connector, 15-pin
Female connector, 15-pin
3 X coaxial sockets (color)
11.2
Power Supply
Supply voltages
11.3
+5 V, tolerance k5 %
+24 V, tolerance +25 O/d-15 1
'0
Current Consumption
Current consumption
Back-up current (min. 2.7 V)
Q Siemens AG 1991 C79000-B8576-CX)4-01
+5 V: typ. 5.5 A
max. 7 A during restart (approx. 5
+24 V: max. 0.1 A
(without peripheral devices)
typ. 0.03 mA
S)
Safety
11.4
Safety
VDE regulations
IEC 950 = EN 60 950
= DIN VDE 0805
Degree of protection
IP 00 to IEC 529
11.5
Electromagnetic Compatibility (EMC)
Radio interference suppression
Limit class
To ClSPR 11
A
Noise immunity:
on signal cables
To DIN VDE 0843 Part 4 =
lEC 65(C0)39-1985(TC65)
To IEC 801-4 (burst): 1 kV
Noise immunity to discharges
of static electricity
To IEC 801-2 (ESD): 4 kV
Noise immunity to external fields
To IEC 801-3: 3 Vlm
Conducted interference
11.6
Climatic Conditions
Temperature:
Operation
Storageltransport
Tested to DIN IEC 68-2-112
+5 to +50 'C (+41 to +l22 OF)
- 20 to +60 'C (- 4 to +l40 OF)
Temperature gradient:
Operation
Storageltransport
max. 10 K/h
max. 10 Klh
Relative humidity:
Operation
Storageltransport
8 to 80 '10at 25 'C (+77 OF),
no condensation
8 to 80 % at 25 'C (+77 OF),
no condensation
O Siemens AG 1991 C79000-88576-Cm-01
Mechanical Environmental Conditions
Altitude (referred to mean sea level):
Operation
Storageltransport
11.7
Mechanical Environmental Conditions
Oscillations:
Operation
Transport
Shock:
Operation
Transport
11.8
-50 m to +2500 m
Up to 10000 m
Tested to IEC 68-2-6
10-60 Hz: amplitude 0.035 mrn;
60-500 Hz: acceleration 4 m/s (0.4 g)
5-9 Hz: amplitude 3.5 mm
9-500 Hz: acceleration 20 m/s2 (2 g)
'
Tested to IEC 68-2-27
Half-sine: 50 m/s 5 g , 11 ms
Half-sine: 500 mls (50 g), 11 ms
'1
Logic Parameters
Processors:
32-bit microprocessor
Coprocessor
System controller
ISA bus controller
80386SX, 20 MHz
80387SX, 20 MHz
VL 82C320
VL 82C331
Memory configuration:
Main memory configuration
also available as version with
and
Q Siemens AG 1991 C7W-58576-C%-01
2-Mbyte DRAM (withhithout coprocessor)
4-Mbyte DRAM (withhithout coprocessor)
8-Mbyte DRAM (withhithout coprocessor)
Logic Parameters
Mass storage:
Hard disk drive
Capacity
Mean access time
MTBF
STARTISTOP
40 Mbyte
typ. 28 rns
typ. 20000 h
> 10000 cycles
Floppy disk drive
Capacity
MTBF
3.5 "11.44 Mbyte
10000 h
Contents
Instructions
Contents, Page Overview
How to Use this Manual
C79000-88576-C204
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
7
Application Examples
8
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
Reference Literature
Reference Literature
111
MS~~-DOS
Operating System
for SICOMP PC and SlMATlC S5
Description
Order No. C79000-G8776-C426
121
Brian W. Kemighan
Dennis M. Ritchie:
The C Programming Language
Englewood Cliffs: Prentice Hall 1988
131
Hans Berger:
Automating with the SlMATlC S5-135U
SIEMENS AG
ISBN 3-8009-1562-6
141
Programmable Controllers
Basic Concepts
SIEMENS AG
ISBN 3-8009-8032-0
L
3 Siemens AG 1991 C79090-B9576-C204-01
Reference Literature
151
[email protected] Basic Package
Manual
Order No. 6ES5 998-OSC21
I61
Catalog ST 59:
SlMATlC S5
Programmers
Order No. E 86060-K4659-A101-A1-7600
l71
Catalog ST 54.1 : SS-135U, S5-155U and S5-155H
Programmable Controllers
Order No. E 86010-K4654-A111-A6-7600
I81
S5-115U
Programmable Controller
Manual
Order No. 6ES5 998-OUF22
191
SlMATlC S5
S5-135U (CPU 9288)
Programmable Controller
Manual
Order No. 6ES5 998-2UL21
Q Siemens
AG 1991 C79000-88576-C2M-01
Reference Literature
/l01
SlMATlC S5
S5-155U
Programmable Controller
CPU 9461947
Manual
Order No. 6ES5 998-OUM22
/ ll /
S5-135 U Programmable Controller
Handling Blocks for R Processor and
CPU 928
Order No. C79000-G8576-C366
1121 Handling Blocks
Standard Function Blocks
CPU 9461947
S5-155U Programmable Controller
Order No. C79000-G8563-C572
1131 Catalog ST 52.3: S5-115U and S5-115H
Programmable Controllers
Order No. E 86010-K4652-A431-A1-7600
G3 Siemens AG 1991 C79000-B8576-C2W-01
Reference Literature
4!
Catalog ST 80:
COROS
Operator Control and
Process Monitoring Systems
Order No. E 86060-K4680-A101-A1-7600
I151 Ray Duncan:
Advanced MS-DOS
Redmond, Wash.: Microsoft Pr. 1986
O Siemens
AG 1991 C79000-B8576.C204-01
Contents
Instructions
Contents, Page Overview
How to Use this Manual
C79000-88576-C204
Introduction to Working with the CP 580
1
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
6
Free Programming of the CP 580
7
Application Examples
8
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
Reference Literature
12
-
Abbreviations
Index
Ordering Information
13
14
Abbreviations
Abbreviations
A-NR
Job number
ANZW
Status word
BlOS
Basic input output system
BLGR
Frame size
CP
Communications processor
CPIDHB driver
Driver for data handling blocks
CPU
S5 CPU
DHB
Data handling block
DMA
Direct memory access
DPR
Dual-port RAM
EMC
Electromagnetic compatibility
FD
Floppy disk
HD
Hard disk
INTxx
Software interrupt interface to CPIDHB driver
IRQxx
Hardware interrupt
KBD
Keyboard
NN
Sourceldestination parameter of CP
PAFE
Parameter assignment error display
O Siemens AG 1991 C79999-B8576-CX)4-01
Abbreviations
PLC
Programmable controller
PG
Programmer
RW
Readlwrite
SSNR
Interface number
TCB
Transfer control block
TSR program
Terminate and stay resident program
XX
Indirect parameter assignment
lndex
lndex
A
A-NR,7-11
Access displays, 10-18
Adapter casing, 2-18
Ambient conditions, 11-5
ANZW, 7-11,7-22,7-70,9-18
Application examples, 8-3
command interpreter, 8-32
mass storage functions, 8-20
process data acquisition, 8-3
ASCll file (for process data), 4-34
AUTOEXEC.BAT, 8-13
B
Back-up floppy, 2-31
Backplane connector, 10-10, 10-11,
10-12
Base interface number, 2-8,2-9,2-12,
4-6,5-9,6-6,lO-19
Base window address, 2-13, 10-20
Basic board, 2-7, 10-6, 10-18
BLGR.7-14
C
Cable connectors for printer, 10-34
Climatic conditions, 11-4
Clock, 2-31
Coaxial cable, 2-17
Coding switches, 2-9, 10-18
setting, 2-7,2-12,2-14
significance,2-11
Command interpreter, 2-30
application example, 8-32
applications, 1-5,6-3
data handling blocks, 9-35
handling sequence, 8-34
O Siemens AG 1991
C79)(X-BB576-CCX)-Ol
procedures, 6-5
start, 8-40
storing commands, 6-9
terminate, 8-40
working steps, 8-34
Configurationfile, 4-11,8-11
output parameters, 9-31
parameters,9-22
replacelmodify,9-31
Configurations, 2-4
CONTROL,7-36,9-17
Controls, 10-14
Conversion of process data, 4-7, 4-36
Conversion using preheader data, 4-10
Conversion, 10-49
CP 580
definition, 1-3
facilities, 1-3
operating system, 1-3
possible applications, 1-4
CPIDHB driver, 3-6,7-39,10-15
call, 7-40
deregister job reception, 7-69
DHB description, 7-44
error bits, 7-83
error messages, 9-27
functions, 7-51
installation,7-40
modify interrupt for driver call, 7-77
parameterization,7-41
read S5 area, 7-74
receive useful data, 7-64
register job reception, 7-62
register set, 7-42
scan driver status, 7-76
scan TCB status. 7-63
Index
set job status, 7-67
start, 8-13
transmission parameters, 7-45
transmit useful data, 7-66
universal scanning of DHB job
reception, 7-68
write S5 area, 7-75
CPMASS
error bits, 5-36
preselect directory, 5-28, 8-28
start, 5-30,8-30
CPRECORD
commands, 4-44
error messages, 9-26
hotkeys, 4-45,9-29
information, 9-31
logging messages, 8-17
output status, 9-30
remove from memory, 4-44,9-31
start message, 8-15
start, 4-26,8-14
CPRECORD.IN1,4-11,8-11
CPSHELL
error bits, 6-26, 9-36
start, 6-21,8-40
CPU summary, 3-3
Current consumption, 11-3
D
Data handling blocks, 3-6
parameters, 7-9
summary, 7-8,9-9
Data transfer with direct jobs, 7-50,
7-54
Data transfer without direct jobs, 7-50,
7-22
DBNR,7-13
DefaultSETUP, 9-3
Delivery versions, 0-15
Device options, 10-26
Device-specific data, 11-3
Diagnostic panel (DIAG), 2-33,10-16
Displays, 10-13
Divert printer output, 8-38
Dual-port RAM, 3-5,7-7
E
EMC, electromagnetic compatibility,
2-24,11-4
Equipotential bonding, 2-17, 2-24
Error numbers, 7-25
Evaluation of process data, 4-32
Expansion board, 2-14, 10-8, 10-23
Expansion units, 2-20
F
Fan subassembly, 2-18
Fault displays, 10-16
Fault signals, 2-15,2-17
FETCH, 5-18,7-34,9-14
call in application example, 8-27
Floppy disk drive, 10-4,10-26,11-6
Floppy disks, 10-26
Free programming, 7-3,8-41
applications, 1-5, 7-3
procedure, 7-4
Front panel, 2-22
G
Grounding rail, 2-17
H
Hard disk drive, 10-26, 11-6
Hardware
design, 2-15
interrupt, 10-45,lO-48
Q Siemens AG 1991 C79000-B8576-C20d-01
Index
I
Indirect parameterization, 5-25,7-16
Installationguidelines, 2-15
Interactionbetween CPU and CP 580,
procedures, 5-8
start, 8-30
working steps, 8-23
Mechanical environmental conditions,
3-7
Interface
COM 1,2-23,10-39
COM 2,2-23,lO-40
lF1,2-23,lO-42
lF2,2-23,lO-43
KBD, 2-23,10-41
m,2-28,10-36
V.24,2-28,lO-35
VIDEO, 2-23,10-44
Interface number, 2-10
lnterprocessor communication flag,
2-12,lO-19,lO-21
J
Job status bits, 5-35,6-25
Jumper settings, 2-12
11-5
Memory configuration, 1 1-5
Memory division, 10-45
Module address, 2-9
Monitor, 2-24,10-27
monitor cable, 2-24,2-28
monitor housing, 2-24
office monitors, 2-27
Mouse, 2-28,10-37
MS-DOS acknowledgement bits, 6-27
Multi-processoroperation, 2-10,3-4,
1 0-21
Multiplexer interrupt, 7-77
N
Normal restart, 2-31
0
K
Key RESET, 10-14
Keyboard, 2-24,10-27
OB 21/22,8-8
Operating modes, 3-4
Operational components, 3-5
L
Length word, 7-26
Linear addressing, 2-13,10-22
Logic variables, 1 1 -5,11-6
P
PAFE, 7-15,7-27
Page addressing, 2-13,3-6,10-22
Page, 2-10,3-5,7-7
Parameter error bits, 4-28,5-33,6-23,
M
Mass storage functions, 2-30,8-20
application example, 8-20
applications, 1-5,5-3
data handling blocks, 9-31
handling sequence, 8-22
PLC rack, 2-21
Peripheral devices, 2-6,2-22,2-28
Plug interfaces, 10-38
Plug-injumpers, 2-9,2-14,
10-22
Power supply, 2-18,11-3
7-27,9-20
O Siemens AG 1991 C79999-08576-CX)4-01
Index
Printer
coding switches, 10-28,10-29
interface adapter, 10-29,10-30,10-31,
10-32,lO-33
PT10,10-34
PT88N/PT89N, 10-28
PT88S/PT89S, 10-28
Process data acquisition
application example, 8-3
applications, 1-4,4-3
description of ASCll files, 4-33
display operating status, 4-46, 8-15
evaluation using Lotus 1-2-3,8-17
handling sequence, 8-6
interrupt and continue, 4-46,9-31
new start, 4-44
procedures, 4-5
start message, 8-15
start, 8-14
status messages, 4-40
working steps, 8-7
Processors, l1-5
R
READMEfile,0-15
RECEIVE, 9-15
call in application example, 8-25
RECEIVE-ALL, 5-20, 7-32
RECEIVE-DIRECT, 7-33
Repair,10-49
Representation of S5 data, 7-81
RESET,7-37,9-18
Restart
13 - 6
defaultSETUP, 2-30
with manual SETUP, 9-4
without manual SETUP, 9-3
S
S5 area, 4-12,4-15,7-74,7-75
S5F files, 5-3,5-22,5-30
Safety, l1-4
Scope of delivery, 2-3
SEND-ALL,4-21,5-16,6-16,7-29,9-13
call in application example, 8-10, 8-24
SEND-DIRECT,5-15,6-14,7-30,9-12
call in application example, 8-26, 8-28,
8-29,8-36
Setting the date and time, 9-7, 2-32
SETUP
basic setting, 9-6
defautt SETUP, 2-30
execution, 9-5
start, 9-4
Single processor operation, 2-10
Slots, 2-18,2-19,2-20
SSNR,7-10
Status bits, 7-23
Status codes, 7-70
Status displays, 10-14
Subrack, 2-18,2-19,2-20
Switch RUNISTOP, 10-14
SYNCHRON, 4-19,5-12,6-11,7-38,
9-11
call in application example, 8-8
T
Technical data, l1-3
Terminating command interpretation,
6-27
Transfer control block (TCB), 7-43,
7-60,7-73
O Siemens AG 1991 C79000-B8576-CX)4-01
Transport position, 10-26
Triax cable, 2-24, 14-3
v
Vector register, 3-5, 7-7
z
ZANF, 7-13
ZLAE,7-14
ZTYP,7-12
Q Siemens AG 1991 C79000-B8576-C204-01
Index
5 Siemens AG
1991
C79999-B8576-C204-01
Contents
Instructions
Contents, Pa e Overview
How to Use t is Manual
\
introduction to Working withthe CP 580
Installation and Commissioning of the CP 580
2
Operation of the CP 580 in the S5 Programmable
Controllers
Process Data Acquisition
4
Mass Storage Functions
5
Command Interpreter
Free Programming of the CP 580
7
Application Examples
8
Reference Section for System Software
9
Reference Section for Hardware
10
Technical Data
11
Reference Literature
12
Abbreviations
Index
Ordering Information
14
Ordering Information
14
Ordering Information
In this chapter
you can find the Order Nos. of the products mentioned or described in this Manual.
CP 580 configurations
Language-specific Order Nos. of the CP 580 Manuals
Q Siemens AG 1991 C79999-B8576-C294-01
Ordering Information
SS-1 15U programmable controller
- For supply voltage AC 1151230 V
- For supply voltage DC 24 V
6ES5 981-0HB11
6ES5 981-0HB21
Fan subassembly for CR 700-3 subrack:
- For supply voltage AC 1151230 V
For supply voltage DC 24 V
Monitors
ou must also order:
Ground clamping strip
ES5 981-0HA11
ES5 981-OHA21
Ordering Information
Monitor cable
Length codes for cable 6ES5
O Siemens AG 1991 C79999-B8576-CX)4-01
...
Ordering lnformation
Note
9
You can obtain more information from the Catalogs ST 52.3, ST 54.1
and ST 80 and in the Manuals for the respective programmable
controllers. (See Reference Literature.)
O Siemens AG 1991 C79009-BB576-CX)4-01
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertisement