SIEMENS
SIMATIC S5
1P
281
Equipment Manual
m
Table of Contents
I
I
ESD Guidelines
Notes on Safety
Warning
Table of Contents
Introduction
General
Function Description
Hardware Settings
Software Settings
Interrupt Processing
Commissioning
the
Counter Module
Operating Modes
and Functions
Programming Example
Technical Specifications
Release
01
Order No: 6ES5998–0KP21
Definition of Terms
Index
1
2
3
4
5
6
7
8
9
10
SIMATIC
is a trade mark of
Siemens.
Subject to change without prior notice.
Siemens
Aktiengesellschaft
Although the contents of this publication have been checked for agreement with the hardware
and software described, we do not accept liability for total agreement since differences cannot
be completely excluded. The information in this publication is checked at regular intervals and
necessary corrections included in the next release. Your suggestions for improving this publica-
tion are welcome.
I
@
Copyright
Siemens
AG 1992 All Rights Reserved
I
Passing on and reproduction of these documents, and utilization and disclosure of their con-
tents is prohibited unless specifically authorized. Violations shall be cause for damage liability.
All rights reserved, particularly in the event a patent is issued or a utility model patent is regis-
tered.
ESD
Guidelines
Guidelines for Handling Electrostatic Sensitive
Devices
(ESD)
1
What Does
ESD
Mean?
Almost all SIMATIC–TELEPERM modules contain many integrated blocks or elements which use
MOS technology. The technology used makes these electronic components very sensitive to
overvoltages
and thus to electrostatic discharge.
The German abbreviation for such modules is
“EGB”:
Elektrostatisch
(2efahrdeten
Elauelemente
EJaugruppen
Next to this abbreviation you will often find the common international abbreviation
“ESD”: Electrostatic Sensitive
!2evice
When found on cabinets, module
subracks
or packaging, the symbol shown below indicates that
electrostatic sensitive components have been used in this device and the module is thus sensitive
to touch.
A
ESDS can be destroyed by voltages and energies far below those perceived by humans. Such
voltages can even occur when a component or a module is touched by a person who is not statical-
ly discharged. Components which have been subjected to such
overvoltages
can usually not be
immediately identified as defective since a malfunction may not occur until the module has been in
operation for a longer period of time.
To be perceived by humans, the following minimum voltages are required:
– To be felt – 3500 volts
– To be heard – 4500 volts
– To be seen – 5000 volts
But a fraction of this voltage can already damage or destroy electronic components.
Components which have been damaged, overloaded or weakened by static discharge can
mal-
function temporarily when average technical specifications are deviated from. A few examples are
listed below.” -
Temperature changes
Impact
Jarring
Changes in stress
Only through rigorous use of protective measures and careful adherence to the handling guide-
lines can malfunctions and downtime of
ESD
modules be effectively prevented.
@
Siemens AG
E–1
ESD
Guidelines
2
When Does a Static Charge Occur?
You can never be absolutely certain that you yourself or the materials and tools you are using are
not electrostatically charged.
Small charges of up to 100 V are common but these can increase to 35,000 V in a very short time!
Examples:
– Walking on carpeting
– Walking on plastic -
flooring
– Sitting on upholstered
chair
– Unsoldering device
made of plastic
– Plastic coffee cups
– Plastic covers
– Books and pads with
synthetic binding
up
to
35000 v
up
to
12000 v
up
to
18000 V
up
to
8000 V
up
to
5000 v
up
to
5000 v
up
to
8000 V
3
4
9
Important Protective Measures Against Static Charging
Since most plastics have a strong tendency to charge, it is imperative that they be kept away
from sensitive components.
Be sure to provide good grounding of people, your workplace and the packaging when working
with electrostatic sensitive components.
Handling
ESD
Modules
As a matter of principle, electronic modules should not be touched unless the work to be per-
formed on them makes this absolutely necessary.
Components should not be touched unless
– you are continuously grounded with an
ESD
bracelet
or
– you are wearing
ESD
shoes or
ESD
shoe protective
grounding strips on an
ESD
floor.
Before touching an electronic module, your own body must be discharged. The easiest way to
do this is to touch a conductive, grounded object (e.g., blank metal parts of switching cabinets,
water pipes, etc.) immediately prior to touching the component.
Modules should not come in contact with chargeable and highly insulating materials (e.g., plas-
tic foil, insulating tabletops, synthetic fiber clothing).
Modules should only be placed on conductive surfaces (e.g., table with
ESD
covering, conduc-
tive
ESD
foam,
ESD
packaging bag,
ESD
shipping container).
Do not allow modules in the vicinity of CRTs, monitors or television sets (minimum distance to
the screen
>10
cm).
E – II @ Siemens AG
ESD
Guidelines
Required
ESD
protective measures are shown in the figure below.
o
f
5
b
t
a
a Conductive floor
b
ESD
table
c
ESD
shoes
d
ESD
shop coat
e
ESD
bracelet
f Grounding connection of the
cabinets
Measuring and Modifying
ESD
Modules
Measurements may not be performed on the modules unless
– the measuring device is grounded (e.g., with protective conductor)
or
– the measuring head is briefly discharged (e.g., touching blank metal part
of the controller housing) prior to measuring when using a floating mea-
suring device.
For soldering use only a grounded soldering device.
6Shipping
ESD
Modules
As a matter of principle, modules and components must always be stored or shipped in conduc-
tive packaging (e.g.,
metallized
plastic boxes, metal cans).
When packaging is not conductive, the modules must be wrapped in conductive material prior to
packaging. For example, conductive foam rubber,
ESD
bags, household aluminum foil or paper
can be used (never use plastic bags or foil).
Be sure that the conductive packaging of modules with built–in batteries does not touch or short
circuit the battery connections (if necessary, cover the connections with insulating tape or material
beforehand).
@
Siemens AG
E – Ill
Notes
on
Safetv
Notes on Safety for the User
1
General Information
This manual contains information required for operation of the described products in accordance
with their intended applications. The manual is written for qualified personnel who have received
special training or have adequate knowledge of measuring, and closed and open loop control
technology (subsequently called automation technology).
Safe installation and commissioning, and safe operation and maintenance of the described pro–
ducts are dependent on a knowledge of the safety notes and warnings contained in this manual
and correct observation of same. Only qualified personnel as described in item 2 have the special-
ized technical knowledge required to fully understand the safety notes and warnings as stated in
this manual, to interpret this information correctly in concrete situations, and to put this informa-
tion to use in actual practice.
This manual is a permanent part of the scope of delivery even if a separate order is required for
logistics reasons.
Forclarity’s
sake, this manual does not contain all details concerning all models
of the described product, and cannot cover every conceivable setup, and type of operation or
maintenance. Contact your local
Siemens
office if you desire additional information or if special problems arise which are not
co–
vered in sufficient detail by this manual.
In addition, be aware that the contents of this product documentation do not constitute a part of a
previous or existing agreement, promise or a legal relationship, and are not intended to alter same.
All obligations on the part of
Siemens
are based on the respective purchase order which also con-
tains the complete and solely valid warranty provisions. The information in this manual neither
wi–
dens nor restricts these contractual warranty regulations.
2
Qualified Personnel
Unqualified work on the device/system or noncompliance with warning notes contained in this
manual and warnings posted on the device/system cabinet can cause severe personal injury or
property damage. For this reason, only sufficiently qualified personnel may perform work on this
device/system.
The following personnel are considered qualified for the purposes of the safety-related notes in
this manual or on the product itself:
. Either programming personnel familiar with the safety concepts of automation technology
Oroperating personnel who have been instructed in the handling of devices used in automation
technology, and who are aware of the portions of this manual covering operating
Or maintenance and service personnel who have been trained to make repairs on devices used
in automation technology, and are authorized to commission, ground and label electrical cir-
cuits and devices/systems in accordance with safety standards.
~
Siemens
AG s–l
Notes
on
Safety
3
Notes Concerning Danger
The following warnings are provided for your personal safety and for the prevention of damage to
the described product or connected devices.
Notes on safety and warnings to avoid endangering the life and health of users or maintanence
personnel and to prevent
prope~
damage are indicated as shown below. The terms used in this
manual and the notes on the products themselves have the following meaning:
CEEl
Indicates that loss of life, severe per-
sonal injury or substantial property
damage
W
result if proper precau-
tions are not taken.
Indicates that minor personal injury or
property damage can result if
proper precautions are not taken.
I
Attention
I
DiEEl
indicates that loss of life, severe per-
sonal injury or substantial property
damage
cm
result if proper
precau–
tions are not taken.
I-!w_l
Important information concerning
the product, handling of the product
or that part of the manual which re-
quires particular attention.
Corresponds to the above definition
for “note” or “caution” when used in
this manual for information concerning
safetv.
.
s –
II
@ Siemens AG
Notes
on
Safetv
4
Operation in Accordance with Intended Use
9
The device/system and/or the system components may only be used for the applications con-
tained in the catalog and technical specifications, and only in combination with devices or com-
ponents of other manufacturers which have been recommended and/or approved by
Siemens.
The described
rxoduct
has been
develo~ed,
manufactured, tested and documented in com-
pliance with applicable safety standards:
Under normal circumstances, the product will not
damage human health or property if the described handling regulations and safety notes con-
cerning programming, installation, operation in accordance with intended use, and
mainte-
nance
are adhered to.
A
!
Warning
/
.
\
When the housing or the protection against accidental contact is removed,
or when the system cabinet is opened, certain parts of these devices/sys-
tems which can contain dangerous voltages become accessible.
Work on this device/system may only be performed by appropriately quali-
fied personnel.
This personnel must be thoroughly familiar with all sources of danger and
maintenance measures as specified in this manual.
Correct and safe operation of the product requires proper shipment, stor-
age, setup and installation, and careful operating and maintenance.
5
Notes on Programming and Installing the Product
Since the
Droduct
is
normallv
used as a
Dart
of a
larger
svstem or plant, these notes are intended as
a guide to safe integration of the product into its
e;virofiment.
The following facts require particular attention.
A
!Note
Even when devices of automation technology are designed to provide maximum
conceptual
safe~
(e.g., multi–channel setup), it is still absolutely essential to ad-
here precisely to the instructions in this manual since safety measures built into
the device/system to prevent dangerous errors can be rendered useless by im-
proper handling; incorrect handling can also create additional danger sources.
@
Siemens
AG
s –
Ill
Notes on
Safetv
Notes on installation and maintenance of the product – based on the application – are listed be-
low.
A
, Warning
a
The safety and accident prevention regulations applicable to the specific appli-
cation must be adhered to.
Built–in devices for housings or cabinets may only be used and operated when
completely installed in the housing or cabinet; desktop or portable models may
only be used and operated when the housing is closed.
A power disconnector switch or a fuse must be provided in the building installa-
tion for facilities with a fixed connection (stationary devices/systems) without
all–pole power disconnector switches and /or fuses. The facility must be con-
nected to a protective conductor.
The grounded protective contact electrical outlet for devices/systems with per-
manently connected, non–removable connection lines and without all–pole
power disconnector switches must be installed near the device and be easily
accessible.
Before commissioning devices operated with power network voltage, check to
determine whether the set nominal voltage range matches the local power
vol–
tage.
When a 24–V supply is used, a reliable electrical separation of extra low
vol–
tages
must be provided. Use only powerpacks manufactured in accordance
with
IEC
364–4–41 or HD 384.04.41
(VDE
0100, part 410).
Fluctuations or variations of the power voltage from the nominal value may not
exceed the tolerance ranges stated in the technical specifications. Otherwise
the occurrence of malfunctions and dangerous states on the electrical module
systems cannot be excluded.
Measures must be provided by which an interrupted program can be properly
restarted aftera drop in voltage or a power loss. This must not cause dangerous
operating situations even for short times. If necessary, “emergency OFF” must
be forced.
“Emeraencv
OFF”
svstems
in accordance with EN 60204
IEC
204
(VDE
01 13)
must r~mai;
effectiv;
in all operating modes of the automation
syste’m.
Releas~
ing the “emergency OFF” system must not cause uncontrolled or undefined re-
starts.
Caution
. Installation of connection and signal lines must be such that inductive and
capacitive interferences do not affect the automation functions.
Installation of automation systems and their operating components must be
such that they are sufficiently protected against accidental activation.
. Appropriate safety measures must be provided on the 1/0 coupling of the
hardware and software to prevent a line or wire break from causing undefined
states in the automation system.
s –
Iv
@ Siemens AG
Notes
on
Safetv
6Active and Passive Errors of an Automation System
Depending on the task to be performed by an electronic automation system, both active and
passive errors can bedangerous errors. In a drive control system, for example,
theactive
error
is usually dangerous since it can cause the drive to be switched on. In contrast, a passive error
in a message function can prevent a dangerous operating state from being reported.
The distinction between possible errors and their classification as dangerous or not dangerous
based on their task is
impottant
to all safety measures concerning the-delivered product.
A
!
Warning
Everywhere where errors in the automation system can cause substantial pro–
petty damage or even personal injury (i.e., can be dangerous errors), additional
external measures must be taken or systems created which will ensure or force
safe operation when an error occurs (e.g., with an independent limit value
switch, mechanical locks, etc.).
7Maintenance and Repair Procedures
When measurements or tests must be performed on an active device, the specifications and in-
structions contained in accident prevention regulation VBG 4.0, and
58
“Permissible Deviations
during Work on Active Parts” in particular, must be complied with. Suitable electrical tools must be
used.
A
, Warning
/
6
\—
Repairs on an automation system may only be performed by Siemens Service
personnel or by repair shops authorized by
Siemens.
When replacing parts
or components, use only parts contained in the spare parts list or listed under the
section on spare parts in this manual. Unauthorized opening and faulty repairs
can result in death or severe personal injury, and substantial property damage.
Before opening the device
always
pull the power plug or open the disconnection
switch.
When replacing fuses, use only the types specified in the technical specifications
or the maintenance instructions of this publication.
Do not throw batteries in an open fire and do not perform soldering on the body of
the battery. Danger of explosion (maximum temperature of 100° C). Do not
open or recharge lithium batteries or batteries containing mercury. When replac-
ing, use only the same types.
Always dispose of batteries or accumulators at a special waste collection point.
Use of monitors:
Faulty work (particularly changes in the high–voltage or installation of another
type of picture tube) can result in increased emission of X–rays. A device which
has been thus modified no longer meets certification criteria and may not be op-
erated.
-1
Theinformation
inthis manual
ischecked
atregular
intervals toensurethatdata
iscurrent
and correct.
Theinformation
can be
changed at anytime without special notification. The manual contains information which is protected by copyright. Repro-
duction or translation into other languages is prohibited without prior written permission from
Siemens.
@
Siemens
AG s–v
ENVIRONMENTAL
PROTECTION
IN ACTION
Information Concerning
Packaging Material/Notes on Disposal
Dear Customer !
Our high–quality products cannot reach you safely without effective protective packaging. The size of
the packaging is kept to an absolute minimum.
All our packaging materials are harmless to the environment and can be disposed over without danger.
Wood is not chemically treated.
Cardboard is made primarily of waste paper which can then be torn up and given to a waste paper col-
lection.
Sheeting is made of polyethylene
(PE),
tapes of polypropylene (PP) and CFC–free padding of foamed
polystyrene
(PS).
These materials are pure hydrocarbons and can be recycled. Please dispose of these valuable secon-
dary raw materials at a recycling center.
Recycling saves raw materials and cuts down on the amount of refuse.
Ask your city administration for the address of the recycling center nearest you to dispose of packing
materials and discarded devices.
Thank you for your help !
SIEMENS
Warning
Risks involved in the use of so–called SIMATIC-compatible modules of non–Siemens manu-
facture
“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 in-
clude parts supplied by other vendors. Accordingly, the manufacturer is obliged to observe and recog-
nize 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 SIMATIC products not to install
so-called SIMATIC–compatible modules of other manufacture in the form of replacement or
add-on modules in SIMATIC 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 so–called 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 to by us. Where so–called
SIMATIC–compatible
modules of non–Siemens manufacture are combined with our
SIMATIC
automation systems, we have a case of our product being used contrary to recommendations. Because
of the variety of applications of our
SIMATIC
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 SIMATIC– compatible modules checked for their effect on our
SIMATIC
products. If the use of so–called SIMATIC– compatible modules leads to defects in a
SIMATIC
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 SIMATIC–compatible modules,
Siemens
is not liable since we have taken timely action in warning users of the potential hazards in-
volved in so–called
SIMATIC–compatible
modules. ”
R 11/92
Table of Contents
Table of Contents
1
1.1
1.2
1.3
1.4
1.5
2
2.1
2.2
2.3
3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
4
4.1
4.2
4.3
4.4
4.5
4.6
5
5.1
5.2
5.3
5.4
5.5
5.6
General Function Description
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-1
Short Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1
Application Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –2
HardwareDescription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –3
Process Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –12
CommunicationwiththeSIMATIC S5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –22
Hardware Settings
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2-1
Location ofthe Setting Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1
Settingthe
DILSwitches
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–3
Settingthe
Plug-lnJumpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–7
SoftwareSettings
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3–1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1
Select Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–4
Load Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–5
Interrupt Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–7
CounterVaiueRegister(CVR)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–9
lnterruptEnable Register (lFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–11
lnterruptlnformationRegister(llR)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–12
Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–14
Parameter Registersand Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–16
Overviewofthe
RegisterAddresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–18
Interrupt Processing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4–1
Whatlslnterrupt Processing? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–1
Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–2
Reaction Times During Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–4
InterruptSources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–6
GuidelinesforlnterruptProcessing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–8
Hysteresisofthe lnterruptValue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–9
CommissioningtheCounter Module
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-1
Commissioning Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–1
Startup Behaviorofthe Counter Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–3
RESET Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–4
Evaluation ofthe Status Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–5
Changing the Direction
ofCounting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–8
Overviewofthe
Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–9
IP281 EquipmentManual
@SiemensAG 1992, OrderNo: 6ES5998-0KP21
Tab/e
of
Contents
R 11/92
6
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
7
7.1
7.2
7.3
7.4
7.5
8
8.1
8.2
8.3
8.4
8.5
8.6
8.7
Operating Modes and Functions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6-1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–1
CounterSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–2
Autonomous Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–7
CombinationOperating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–17
Handling theCounters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–23
Gate Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–30
Method ofOperation of the Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–34
Block Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–40
Programming Example
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7–1
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–1
Startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–4
Cyclic Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–5
InterruptProcessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–6
Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–7
Technical Specifications
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8-1
CounterInputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–1
Counting Frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–2
PowerSupply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–3
Environmental Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–4
lnWhich
Slots CantheCounter Module Be Operated? . . . . . . . . . . . . . . . . . . . . . 8–5
Connection
Cablesfor
incremental Encoders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–6
Requirements onthelnputSignals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–10
Definition ofTerms
Index
II
lP281 EquipmentManual
@SiemensAG1992, 0rderNo:6ES5 998-0KP21
.
.
E- I
Guidelines for Handling Electrostatic Sensitive
Devices (ESD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E–I
.
.
S- I
Notes on SafetyfortheUser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
s–I
Introduction
Setup of the Manual
This equipment manual is intended as an aid to installing and operating the
1P
281 module.
Before starting to work with the module, take thetimeto Iookthrough this equipment manual. You
can start by looking up passages which are of particular interest to you. The goal is to obtain an
overview of the information provided.
The individual sections are self–contained and provide blocks of information on the following sub-
jects,
– Installation
– Commissioning
– Handling
Sections 2,3 and 6 contain information on special tasks which you will have to perform when pre-
paring the module for operation.
Abbreviations
Abbreviations which are not part of everyday usage are written out in full the first time they appear.
In addition, a list of all abbreviations is provided in the “Definition of Terms” at the end of the manual.
Cross References
Cross references to parts of other sections are not made unless the repetition of facts would re-
quire too much space and it can be assumed that the description at another location is sufficient.
Only the applicable subsection number is given for cross references to parts of other sections.
Example:
(+
section 2.1)
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5 998-0KP21
Principle of Operation of a Counter Module
Counting is primarily the acquisition and summation of events. In the world of electronics, this is
the summation of pulses. Two directions of counting are available.
Counting up
Binary
(Decimal =4)
When counting up, the pulses are added (to a start value in some cases).
This can be used, for example, for simple acquisition of a piece count.
Counting down
Starting with a start value which you have stored in a register (memory loca-
tion) of the
1P
281, the counter is decremented by the number of input pul-
ses.
I
I
Down
counter
m
5 input pulses
WI
000011111
I
I
(Decimal = 15)
2
Binary
L
0001 0100
(Decimal = 20)
This can be used, for example, to count out an exact number of pieces and
then package them. The counter is provided with an output signal here
which can be used, for example, to close a valve when counter status zero
is reached,
1P
281 Equipment Manual
@SiemensA(31992, order No: 6ES5998-0KP21
Counting with
It
is often necessary to link the pulses (depending on other input variables)
software start
starting at a defined point in time, and then use this group information to
(or software stop)
start or stop the counter.
Input pulses
up
counter
t
J
software start
(Decimal =2)
This can be used, for example, if you know that the characteristics (differ-
ences in shape, color, material or other differences) of the first products will
be different from the serial product.
Counting with
If a hardware signal is to start a high–speed counting procedure directly
hardware
from the system (i.e., from the process), this signal is best applied directly to
gate control
the gate of the counter. This permits the counter to be started without
loading the S5 cycle.
Input pulses
1
Counter
A
::’~5
‘ATE
Binary
0000
0011
signal
(Decimal =3)
A defined stop of the counting procedure can also be performed with the
gate.
1P
281 Equipment Manual
@ Siemens
AG
1992,
order
No:
6E.S5
998-I)KP21
3
Application Areas of the
1P
281
The
1P
281 counter module permits the acquisition and conditioning of counting pulses up to a
counting frequency of 250
kHz.
Why is such a conditioning module required when
STEP5
programmable counters are already
available for all programmable controllers?
These software counters have limits. To count 50 Hz pulses, for example, the programmable con-
troller must process the counter program portion at time intervals of less than 10
msec.
(Twice
the “processing frequency” is required since the software counter must also acquire the falling
edge of the counting signal in order to be able to recognize the rising edge.)
– Multiple calling of the counter program portion (with direct access to the periphery)
– Counting input as interrupt input
When a software counter is used as an interrupt program, the sampling time limit of the signal
is shortened to the run time of the longest individual block. This applies particularly to the use of
input module 432. The delay time of the input filter of this module can be shortened to 0.3
msec.
Theoretically, this makes it possible to acquire frequencies up to approximately
1.5
kHz.
However,
the operating system cannot recognize the pulses since the interval between two signal edges is
too small (i.e., all counting pulses are not acquired).
Considering the above arguments, software counters and the
1P
281 conditioning counter module
can be used for the following application areas.
Low frequencies are counted with software counters.
Higher frequencies (up to 250
kHz)
are
counted with special counter modules such as the
1P
281.
There is no
clearcut
boundary between the two methods (between 50 Hz and several 100 Hz).
4
1P
281 Equipment Manual
@
Siemens
AG 1992, Order No: 6ES5
998-0KP21
The
1P
281 offers additional advantages which speak for the use of this module.
Depending on the degree of expansion, the module is equipped with one or two counters. The
counters can be used together or separately.
The external addressing of counting gate inputs offers additional ways to start and stop the
counters.
Start values can be specified for the counters by the S5 program. The point in time at which
these values are loaded in the counters can be specified by the S5 program or directly by the
external signals.
Each counter can report events (e.g., overflow or end of counting). This message can be both
an interrupt to the programmable controller, and an external hardware output.
The counter module is used as the connecting element between high–speed events in the pro-
cess, and the program in the programmable controller.
Use of the
1P
281 counter module requires that the following steps be performed.
1. Analysis of
the counting
task
c
2. Hardware
settings (jum-
pers and
DIL
switches)
9
3.
Parame–
Process
1P
281 Equipment Manual
@
.%TIWflS
AG 1992, Order No: 6ES5
998-0KP21
Analysis of the Counting Task
There are many ways to adapt the
1P
281 to the counting task. The following questions must be
answered by the analysis of the counting task.
.
Which encoder is to be used?
What counting range is required?
What counting frequency is required?
Is this a one–time counting procedure or is the counting procedure repeated continuously?
Is the counting procedure to be controlled by a hardware or software gate?
Are reactions outside the module to be triggered when certain values are reached?
Is the combination of two counters useful?
Is the counting procedure to begin at a certain value?
Is the counting procedure to stop at a certain value?
After all these questions have been answered, the module can then be set for your particular ap-
plication as shown below.
– Hardware settings
and
– Parameterization
6
1P
281 Equipment Manual
@
siOIIWflS
AG 1992, Order No:
6ES5
998-0KP21
Hardware Settings
El
1
.
.
.
.
The
1P
281 counter module is equipped with one or two counters. Each counter can be set sepa-
rately.
The hardware settings described in section 2 are used to adapt the counter module to specific
counting applications.
Plug connectors on the front of the module are used to connect the encoder inputs, the digital in-
puts and the digital outputs. It is easiest to use prefabricated cables.
The conditions described in section 8.7 concerning the time relationships of the input signals (e.g.,
pulse widths and pulse sequences) must be adhered to.
Parameterization
The
1P
281 counter module is set via various registers for the counting task. The registers are writ-
ten via the programmable controller S5 commands.
1P
281 Equipment Manual
@
Siemens
AG
1992,
order
No:
6ES5
998-I)KP21
R11192
General Function Description
1
General Function Description
1.1
1.2
1.3
1.3.1
1.3.2
1.3.3
1.3.4
1.4
1.4.1
1.4.1.1
1.4.1.2
1,4.2
1.4.3
1.4.4
1.5
Short Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –
1
ApplicationArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –2
HardwareDescription . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –3
Mechanical Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –3
DiagnosticLEDs
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –5
Plug ConnectorAllocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –7
Functional
Setupofthe
Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –10
Process Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –12
EncoderInterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 13
24 VEncoderlnterface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 14
5VEncoderlnterface inAccordancewith RS422 . . . . . . . . . . . . . . . . . . . . . . . . . 1 –17
Digital lnputs(Dl) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –19
Digital Output (DQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –20
Voltage Supply forlncremental Encoders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –21
CommunicationwiththeSIMATIC S5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 –22
IP281 Equipment Manual
@.SiemensAG 1992, @derNo: 6ES5998-0KP21
l–l
R 11192
General Function Description
1General Function Description
1.1
Short Description
The
1P
281 is a counter module for use in
SIMATIC
S5 controllers. It is modular in design. The
IP281
consists of a basic module with a counter for direct connection of incremental encoders,
and an optional plug–in
submodule
containing a second counter with the same specifications.
Use of the second counter increases the range of applications.
The
1P
281 is a hardware module with a complex gate array in which all counting functions and
the bus interface are integrated. It is operated in the 1/0 area of the
SIMATIC
S5. Access times
are very short since the S5 uses simple transfer commands to access all registers of the
1P
281
directly. For example, a 16–bit counter value can be read by the CPU 9446 in less than 5.6
psec.
This makes the
1P
281 also suitable for rapid, closed–loop control applications among other
things.
The
1P
281 is equipped with the following features.
9
One–time, two-time and four–time evaluation of the encoder signals
Operation in 16 or 32–bit mode
Choice of positive or positive and negative counting range
Loading the counters with defined, initial values
Comparison per counter with an interrupt value (comparator)
Transfer of values from counter 1 to counter 2 as interrupt or load value
Gate control
Gate start, gate stop and setting via digital inputs
Direct triggering of control procedures outside the module via digital outputs
Possible connection of incremental, 24 V encoders or 5 V (RS 422) encoders with two pulse
trains displaced by 90”
Possible connection of directional encoders
Encoder supply via the module (24 V standard, 5.2 V optional)
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No:6ES5998-OKP21
1–1
General Function Description
R 11/92
1.2
Application Area
The
1P
281 module is designed for use in
SIMATIC
S5 systems, and can be used in the following
programmable controllers.
PLC
S5–115U
(CPUS
941 A/Bto 944A/B)
PLC
S5–135U
(CPUS
922, 928A and
928B)
PLC
S5–155U
(CPUS
922, 928A,
928B,
946 and 947)
PLC
S5–115H (CPU 942H)
PLC
S5–155H (CPU
946R/947R)
Ordering notes
The
1P
281 counter module is available under the following order numbers.
1P
281 counter module with 24 V encoder supply:
6ES5 281–4UA11
1P
281 counter module with 24 V and 5.2 V
encoder supply:
6ES5
281–4UP11
1P
281 plug–in
submodule
for counter 2: 6ES5
281–4UB11
1–2
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-0KP21
R 11/92 General Function Description
1.3
Hardware Description
1.3.1
Mechanical Setup
Cover from Front plate Cover from
soldered side component side
Figure 1.1: Setup of the
1P
281
The
1P
281 consists of a basic module and a plug–in
submodule
available as an optional expan-
sion.
Basic Module
Double Europe format: 233 mm x 160 mm
Mounting width: 1
1/3
SEP
Front plate: plastic with diagnostic LEDs and connector elements
Plastic covering on both sides
Counter 1 is included on the basic module.
Plug–in Submodule
– Dimensions: 90 mm x 90 mm
Counter 2 is included on the plug– in
submodule.
IP
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-OKP21 1 –3
General Function Description
R 11192
Mounting the Make the required hardware settings on the plug– in
submodule
prior to
plug–in submodule installation (-t section 2.3).
The plastic covering must be removed (four screws) before the plug–in
submodule
can be installed.
The plug–in
submodule
is equipped with four plastic distance pins. When
inserting the
submodule,
all pins must snap into place in the receptacle
holes.
The plug–in
submodule
can be removed manually from the basic module.
1–4
A
! Caution
To avoid damaging the module, do not use tools to remove
the plug–in
submodule.
After installation, replace plastic coverings and screw down.
1P
281 Equipment Manual
@
Siemens
AG
1992,
Order No: 6ES5998-0KP21
R 11/92
General Function Description
1.3.2 Diagnostic
LEDs
Eight (8)
LEDs
are installed on the front plate.
Readiness indication for the module
Indications for counter 1
Figure 1.2:
Front plate with indication and connector elements
1P
281 Equipment Manual
@
Siemens
AG
1992,
Order No: 6ES5998-OKP21
Error indication for the module
Counter running indication
Direction indication
Status indication for digital output
Indications for counter 2
Encoder interface
Counter 2
Digital inputs
Digital output
Counter 2
Encoder interface
Counter 1
Digital inputs
Digital output
Counter 1
24 V
SUp@y
1–5
General Function Description
R 11/92
Description of the Diagnostic
LEDs
RUN
LED(Running)
These two
LEDs
indicate that the module is ready for operation or that
ERR LED (Error) malfunctions have occurred.
Indication
Meaning
RUN
I
ERR
o
Voltage supply error (of S5)
o
:
RESET is active.
Module is operating correctly.
Parameterization error or wire break
CR
LED This LED indicates the status of the applicable counter.
(Counter running)
Indication
I
Status of the Counter
DIR LED
(Direction)
SO LED
(Status output)
1-”
*
CRS
= 1 or
CRS
changing very quickly; counter is counting at high speed.
t
o
I
CRS
= O (RESET status)
1
Flashing CRS
changing; counter is counting at low speed.
This LED indicates the direction of counting. When the encoder is
stationary, the direction which was last indicated is retained.
Indication Direction of Counter
*
p
(LED for counter 2 goes on even when the plug–in
submodule
is not in-
serted.)
1
t
0
Down
This LED indicates the status of the digital output.
Indication
I
Status of the Digital Output
1
*
Active (24 V on the digital output)
(LED for counter 2 goes on even when the plug–in
submodule
is not in-
serted.)
10
I
Inactive (O V on the digital output)
I
1–6
IP
281 Equipment Manual
@ Siemens AG 1992, Order No: 6ES5998-OKP21
R 11/92 General Function Description
1.3.3
Plug Connector Allocation
S5 interface, basic The basic plug connector (48–way, multi–pointterminal strip, DIN41612,
plug connector Xlmodel F) is located on the back of the module. Its allocation is shown
below.
d
bz
Signal Signal Signal
2Ml 5V
4
PESP
6
ADB
O
RESET
8
ADB
1
10 ADB
2
hkM~
12 ADB
3
m
14
I
m
I
ADB
4
I
DB
O
I
16
TFiE
ADB
5
DB
1
18
IUc
ADB
6
DB
2
20
m
ADB
7
DB
3
22
ADB
8
DB
4
24
ADB
9
DB
5
26
ADB
10
DB
6
28
ADB
11
DB
7
30
BASP
32
Ml
I
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-0KP21 1–7
General Function Description
R 11/92
Encoder inputs, Type of plug connector: 15–way, sub D socket with screw lock The pin
plug connectors
allocations of plug connectors X5 (for counter 1) and X7 (for counter 2)
X5 and X7
are identical.
1
@
15
;
;
8
~o
~o
~o
90
1
s
5 V Encoder Signals in Accordance with RS 422
Pin
Designation
Meaning
6
5.2 V 5.2 V encoder supply (option)
~1
GND Reference potential of the module (S5 bus)
10
N
Zero marking pulse (N)
11
N
Zero marking pulse (~)
12
E
Counting signal (track
B)
13
B
Counting signal (track B)
14
x
Counting signal (track Z)
15
A
Counting signal (track A)
24 V Encoder Signals
Pin
1
4
5
7’
8
9
Designation
A*
B*
24 V
GND
N*
RE
Meaning
Counting signal (24 V, track A*)
Counting signal (24
v
track B*)
24 V encoder supply
Reference potential (24
~
Zero marking pulse (24
~
Load resistance for A*, B* and N*
1 Change the jumper so that the reference potential on pin 7 corresponds
to the-connected encoder
(+
sections 1.4.1 and 2.3).
Pins 2 and 3 are not used.
1–8
IP
281 Equipment Manual
@
Siemens AG 1992, Order No:
6ES5998-0KP21
R
11/92
General Function Description
Digital inputs and
outputs, plug con-
nectors X4 and X6
24 V Sllppiy,
f.?hlg
connector X3
Type of plug connector: 8–way, pin plug connector with screw connection
for the individual leads.
The pin allocations of plug connectors X4 (for counter 1 ) and X6 (for counter
2) are identical.
1
2
3
4
5
6
7
8
Designation Meaning
STA
Gate
starl
input
o
Vefiol
Reference potential for digital input
STO Gate stop input
o
Vefiol
Reference potential for digital input
SET
Set input
o
ve~,
Reference potential for digital input
DQDigital output
O
v@oQ
Reference potential for digital output
Type
of plug connector: 2–way, pin plug connector with screw
con–
nection for the individual leads
Designation Meaning
D
ml
24
Veti
24 V supply voltage
2
o
vem4
External reference potential
IP
281 Equipment Manual
@ Siemens AG 1992, Order No: 6ES5998-OKP21 1–9
General Function Description
R 11/92
1.3.4
Functional Setup of the Module
The
1P
281 module provides the hardware for counting with one or two counters. It operates with-
out a separate processor and represents only a slight load for the
SIMATIC
S5. The
necessaty
logic and the two, 16/32–bit counters are
implemented
in
a
gate
array
(AW.
Encoder
input
RS 422
\
Zero mark. pulse
+
+
+
N~
Encoder
input
24 V
Digital
inputs
Digital
output
f
Count. signal
A*
*
+-<
7
f
Set input
SET
*<
=
B
I
Digital
d
~++
output
DQ
-
,———————————————.
.———
Encoder
input
RS 422
II
3
a)
,.
I
I
I
Digital
I inputs
I
I
.
.
1
Dlgltal
output
(
Set input
+<
SET
~
m
b
*;
:
Gate start
input
STA
~
Z*
{
Gate stop
input
STO
*
+“<
Digital
4
>4+
output
DQ
-
L——————
——————————.
.
Figure 1.3: Function elements of the
1P
281
1
10
Counter
1
———.
Counter
2
.———
-
Jr
S5
interface
F
Data
8 bits
>
Plug–in submodule (optional)
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-OKP21
R
11/92
General Function Description
The following flowchart shows the principle of operation of a counter. It indicates the most impor-
tant hardware components and how the registers affect the counter, See section 6.8 for a detailed
diagram.
S5 bus
I
*
STA
STO Digital
SET
inputs
L
,
Figure 1.4: Principle of operation of a counter in the
1P
281
1
l-h
Control DQ
digital
output
1P
281 Equipment Manual
@
Siemens
AG
1992,
(Jder
No:
6Ef35
~8-of(p21
1 – 11
General Function
DescriLXion
R
11192
1.4
Process Interfaces
Each counter is equipped with the following inputs and outputs as the interface to the process.
Encoder interface
The encoder interface can be set to 24 V connection or to 5 V connection
(RS 422). This is perfromed with plug–in jumpers
(+
section 2.3 for the hardware settings).
The foIlowing signals are evaluated.
AXor A* Counting pulse train, track A
A* for 24 V signals
BE
or B* Counting pulse train, track B
B* for 24 V signals
N~ or N* Zero marking pulse N,
N* for 24 V signals
Digital inputs
Three digital inputs separated by optocouplers are available.
STA
Gate start input
This input is also used during level control to stop the counter
(-+
section 6.6.3).
STO
Gate stop input
This input must be low for level control
(+
section 6.6.3).
– SET Set input (preliminary contact) (e.g., proximity switch)
Digital output
DQ
24 V digital output
1 – 12
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-OKP21
R 11192 General Function Description
1.4.1
Encoder Interface
Theencoderinterface can be operated with either24V level
or5Vlevel
(RS
422). Plug–injumpers
X35 (counter 1 ) and X 45 (counter 2) are used to make the switch–over.
A
x
RS 422
:
input
:
GND
I
11’-
Multiplexer
0+0
0
A
L
0
0
A,
B* 24 V
input
X35/x45
N*
B
N
GND
o?
h
X391X49
1
23
Reference
potential
Counter 1
Counter 2
Allocation
Selected Interface
x35 x45 1–2
For 24 V encoder
x35 x45 2–3
For 5 V encoder in accordance
with RS 422
The 5 V area and the 24 V area are free–floating. To insure that this separation is retained, the
corresponding reference potential must be circuited on pin 7 of the encoder interface depending
on
the”encoder
selected (-t section 2.3, selecting the reference potential).
Counter 1
Counter 2
Allocation
I
Reference Potential
x39 x49 1–2
For 24 V encoder
x39 x49 2–3
For 5 V encoder
(RS
422)
A
! Caution
Incorrectly inserted jumpers (e.g., S5 reference potential for 24 V encoders) can lead
to interference caused by grounding loops. In addition, potential isolation between
the 24 V encoder inputs and the S5 backplane is lost.
Status on delivery: Jumper 1–2 inserted
+
reference potential for 24 V encoder
1P
281 Equipment Manual
@
Siernens
AG
1992,
@jer
No:
6E&jgg8-r)Kp21 1 – 13
General Function Description
R 11/92
1.4.1.1 24
V Encoder Interface
The 24 V encoder interface includes the inputs for the three counting signals A*, B* and N*, a con-
nection for load resistances and the encoder supply.
Signal inputs
The inputs are potentially isolated from the
S5
bus and the digital inputs via
optocouplers.
The three encoder inputs are non–floating relative to each
other. Encoders with two pulse trains (A* and B*) displaced by 90° can be
connected.
Each input is equipped with an
RC
filter for the suppression of interferences.
Plug–in jumpers (--t section 2.3) can be used to set this filter to three limit
frequencies
@
250
kHz,
s 50
kHz,
s 1
kHz).
~
Whenthe module isoperated onthe24Vencoder interface, there-
ference potential GND must be set for 24 V
(+
section 2.3) and the
wire break recognition must be switched off.
Input
circuitry
+-
RE
5.1 v 300
Vin
NVI -
J
1
>.
x
*L
m
1
m
*
C6
.
L
X36 to X36
TTT’
X46 to X48
Ov 0
I
I
Load
resistances
Use the common- connection (pin 9) to apply them to
GND
or 24 V
depending on the type of encoder.
A
!
Caution
Pin RE on the plug connector must always be connected
otherwise inputs A*, B* and N* will be coupled together (i.e.,
triggering of one input can cause another input to be trig-
gered).
1 – 14
1P
281 Equipment Manual
@
.Siemens
AG
1992,
Order No:
6ES5998-0KP21
R 11/92
General Function Description
Encoder with P
switching outputs
1
Encoder I
1
1
1
I
v+
P switch
J
-L
A
E
B
N
v–
v+
--t’
1
A* (24
V,Jrack
A
IN
~
;
:
4B* (24
V.Jra
k B
RE
8
* (24
V~er
mark. pulse)
RE RE
#~;:
7
N
Encoder
5 4
supply
Pin 7 and pin 9 must be
jumpered.
Encoder with M
switching outputs
Encoder
(open collector)
Encoder with MP
switching
outputs
(push-pull outputs)
L
M switch
T
v–
A* (24
VJack
A)
)
)R
E
) N
D
Encoder
)24V
supply
Pin 5 and pin 9 must be
jumpered.
Encoder
I
A
1
1
1
,
B
MP switch
N
v– v–
1-
V+
)B
* [24 V,Jr&k
B]
)
)
N ’24
y~
*Vr
mark. pulse
)R
E
)G
ND
Encoder
~
‘Upp’y
Pin 7 and pin 9 must be
jumpered.
1P
281 Equipment Manual
@
Siemens
AG
1992,
Order No: 6ES5998-0KP21 1 – 15
General Function Description
R
11/92
Counting with one When only one counting input is used, this must be applied to input A*.
counting input
The direction of counting is set on counting input B*. There are two ways to
do this.
– Connect a directional encoder to counting input B*
(low level -+ up, high level -t down).
– Change the direction of counting by inverting bit 11 in parameter
register 1/2 (inversion of counting input B*). The following applies to
counting input B* when it is not connected or low: Bit 11 = O -t up,
bit 11 = 1
-+
down.
Counting mode direction evaluation EVDI (-t section 6.2.2) must be set
for counting with one counting input.
Encoder supply
The encorder supply (24
V)
is provided with potential isolation from the
digital inputs and the S5 bus. Potential isolation from the digital output is
not provided.
The encoder supply is available on connection plug
connector X5/X7. It is short circuit proof (--t section 1.4.4).
1 – 16
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6E.S5998-0KP21
R 11192
General Function Description
1.4.1.2 5 V Encoder Interface in Accordance with
RS
422
The 5 V encoder interface contains the inputs for the three, differential counting signals
AJ~,
B/E
and
N~.
A 5.2 V encoder supply is available on the module as an option.
Signal inputs
The signal inputs are provided with potential connected to the S5 bus. The
inputs are potentially isolated from the following.
– Digital inputs
– Digital output
– 24 V
SUf3@Y
Encoders with two, differential signals displaced by 90° (track A/x, track
BE
and zero marking pulse
N~
in accordance with RS 422) can be con-
nected,
~
When the module is operated via the RS 422 interface, the refer-
ence potential must be set for the S5 bus
(-+
sections 1.4.1 and
2.3).
Wire break
recognition
The inputs are equipped with wire break recognition. This can be switched
on and off with
plug:
in jumpers X34/X44.
A
A
Y
a
D
+
A
A“
Wire break
Be
.3
I
h
B
!l!~
7
NO
D
+
N
IT”
~–––––amipnal
,
5.2 V encoder
SU}PIY
l—
~.——.——
The wire break recognition detects the following errors.
9
Wire break on the signal input
Wire break on the inverted signal input
Short circuit between signal input and inverted signal input
Short circuit between signal input and O VI
Short circuit between signal input and 5 VI
1 Is not detected unless the voltage difference between user signal and
short circuit
<1.1
V.
1P
281 Equipment Manual
@ Siemens AG 1992, Order No: 8ES5998-OKP21 1 – 17
General Function Descridion
R 11192
When the wire break recognition is active and an error occurs, the error is
entered in status register 3 and the ERROR LED goes on. There is one wire
break recognition for each counter.
The message is retained for the duration of the error.
When the wire break recognition is active and counting inputs are open, this
causes a wire break message.
~
The wire break recognition must be switched off for unconnected
plug connector/unused input X5/X7.
The wire break recognition can cause errors when very long con-
nection lines are used. Switch off the wire break recognition if this
happens.
5.2 V
encoder
An optional model of the basic module is also available with a short circuit
supply
proof, 5.2 V encoder supply on plug connector X5/X7(+ section 1.4.4).
This 5.2 V encoder supply
cannot
be retrofitted later.
1 – 18
1P
281 Equipment Manual
@
Siemens AG 1992, Order No:
6ES5998-0KP21
R 11192
General Function
DescriMion
1.4.2
Digital Inputs
(Dl)
Each counter is equipped with three digital inputs.
STA
= Input, gate start
STO
= Input, gate stop
SET = External set input (preliminary contact) (e.g., proximity switch)
The inputs for counter 1 are located on plug connector X4; the inputs for counter 2 are located
on plug connector X6
(+
section 1.3.3).
The digital inputs are potentially isolated from the following.
– S5 bus
– Digital output
– Encoder interface
The digital inputs are 2–way. They are operated with a nominal voltage of 24 V. The function of
digital inputs
STA
and
STO
is described in sections 6.6.2 and 6.6.3; the function of digital input
SET is described in section 6.5.1.2.
Each digital input is equipped with an
RC
filter (for the suppression of interferences) following the
optocoupler.
Plug–in jumpers
(+
section 2.3) can be used to set this filter to three limit
frequen-
cies
&
250 kHz,
<
25-kHz,
<100
Hz).
Input Circuiting of the Digital Inputs
1.5 k 5.1 V
lx
300
Vin
Al
>–
x
~
w
Ov
4
1 – 19
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-OKP21
General Function Description
R 11192
1.4.3
Digital Output (DQ)
Each counter is equipped with one, two-way, digital output with a nominal voltage of 24 V. The
digital output for counter 1 is available on plug connector X4; the digital output for counter 2 is
available on plug connector X6
(+
section 1.3.3).
The digital output can be used to directly trigger processes external to the module. The functions
of the
diaital
outRuts
are described in section 6.7. Direct connection of a relay is possible (maxi-
mum Io[d current of 600 mA).
.
~
The connected relay must be equipped with a free-wheeling diode.
Address–
ing of
DQ
w
al
&
Setting of the BASP
minimum Software
pulse
enable
I
duration
24 V
+
Driver
output
~
~1+
RLFree-
wheeling
Status
diode
When activated, the output remains active for the minimum pulse duration. This minimum pulse
duration can be set to three different times (1Omsec/100 msec/500
msec)
for each output
indivi–
dually
(+
section 2.3). If the triggering event lasts longer than the minimum pulse set, the output
remains active until the event has disappeared again.
The digital output is potentially isolated via
optocouplers
from the following.
– S5 bus
– Digital inputs
– 5.2 V encoder supply
The digital output is supplied by the 24
Vdirectvoltagefed
by X3. A P switch is used as the output
driver. The digital output is short circuit proof and protected against overload.
The digital outputs are disabled after startup of the
1P
281. They are enabled by control register3.
The
BASP
signal is active during an interference, and during startup and stop of the PLC. The
BASP
signal is used for the S5 as an “EMERGENCY OFF” for the digital outputs. Since certain
applications require that the outputs not be switched off when an error occurs, the
1P
281 offers
the capability of switching off the
BASP
function for both digital outputs together
(+
section 2.3).
Remember that, in such situations, the digital outputs are no
longer
protected by the safety system
of the
SIMATIC
S5.
A
! Warning
When the
BASP
function is switched off, other suitable measures must be provided
to ensure that persons and systems are not endangered when the outputs are not
switched on.
1 – 20
IP
281 Equipment Manual
@
Siemens AG 1992, Order No:
6ES5998-0KP21
R 11192
General Function Description
1.4.4
Voltage Supply for Incremental Encoders
The module is available in the two configurations.
– With voltage supply for 24 V encoder
– With voltage supplies for 24 V encoder and 5.2 V encoder
~
Thevoltage supply
forthe5.2V
encoder cannot be retrofitted.
~CLDQtHnAfwmerT
Fuse
o
:
:N
r-----”
V.,t,g,
Supf),y
24 V 3.15 A
Fil– Fil–
ter ter
I
-0
~~~~~
I
1-
—————
J
Optional
I
~
24 V
Voltage supply
encoder for 24 V
supply
encoder
I
)
o
Voltage supply
o
for digital outputs
Both encoder supplies are short circuit proof and protected against overload. A diode is used to
protect against feedback for the 24 V encoder supply.
The supplies for the encoder and the digital outputs are generated from the externally fed 24 V
supply. A diode is used to protect the module against polarity reversal of the 24 V supply. A fuse
is located on the input of the 24 V supply. The fuse is not triggered unless errors are present on
the module. The fuse is not triggered when an output or the encoder supply short circuits since
short circuit proof drivers are used for these outputs.
The 5.2 V supply is potentially isolated from the external, 24 V supply.
The voltage supplies for the encoders are available on the encoder interfaces X5/X7
(+
section 1 .3.3).
IP
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-0KP21 1 – 21
General Function
L3escriDtion
R 11/92
1.5
Communication with the SIMATIC S5
The
1P
281 is an intelligent 1/0 module. It can be addressed in the following areas.
– Analog 1/0 area (P area), addresses F080H to FOFFH
2128
to 255
– Expanded 1/0 area (Q area), addresses F1OOH to
F1
FFH
20
to 255
The module occupies 8 bytes of input/output address area. The addresses for input and output
are identical and can be selected as desired in the above stated address areas. The basic address
is set with
DIL
switch S1 (
+
section 2.2). The basic address is always a multiple of eight.
Decoding of the addresses depends on the
PLC.
PLCS5–115U evaluates addresses up to 8 bits;
PLCS
S5–135U
and
S5–155U
evaluate 12–bit addresses. The type of decoding must beset with
the
DIL
switch
(-+
section 2.2) based on the
PLC
in which the
1P
281 is used.
The module is accessed with simple transfer commands
(LPB,
LPW, LQB, LQW,
TPY
TPW, TQB,
TQW)
given by the S5 CPU.
The
1P
281 can be used in the individual
PLCS
with the
CPUS
listed below.
PLCS5–115U
CPUS
941Ato 944A
CPUS
941 B to 944B
PLCS5–11 5H
– CPU 942H
PLC
S5–135U
– CPU 922
– CPU 928A
– CPU 928B
PLC
S5–155U
(in S5–150U mode without “interrupt’’/S5-155U mode, full operation)
– CPU 922
– CPU 928A/CPU 928B
– CPU 946/947
PLC
S5–155H
(without “interrupt”)
– CPU
946R/947R
PLCS5–115U is not equipped with an expanded
1/0
area.
Due to internal synchronization, the
1P
281 increases the command run times by approximately
0.4
psec
per byte accessed.
The
1P
281 can trigger interrupt processing on the S5 CPU
(+
section
4).
1 – 22
1P
281 Equipment Manual
@
Siemens
AG
1992,
orderNo:
6Esgg8-oKP21
R 11/92
Hardware Settings
2
Hardware Settings
2.1
2.2
2.3
Location of the Setting Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 –
1
Setting the
DILSwitches
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–3
Setting the Plug-ln Jumpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–7
1P
281 Equipment Manual
@
Siemens
AG 1992, Order No: 6ES5998-OKP21 2–1
R11192
Hardware Settings
2
Hardware Settings
2.1
Location of the Setting Elements
1
Selec[ion
of an interrupt line (section 2.2)
——
———————
Slot for
plug-in
submodule
(see next page and
section 1.3. 1)
——
———————
Ii?E/
Selection of the
x39
reference potential
\x::,
,,
x36
Pulse duration on
x33
the digital output
Pi
,.!
,.
:,
x37
mx34
\
\
.cOgnLn
‘=4
W/re
break
X38 . .
P
I
. .
.
.:::,
X30
+
‘F;E~J
NE3
\
X31
Selection of the
,,
.++,,
encoder interface
;:,<:
X32
wire fuse (section 1.4.4)
-J
123
-
Pina//ocation
of thep/ug-injumpem
Setting elements on the basic module
Plug–in
jumpers
X50
to x55
“ must be open
(used for internal
factoty
testing
purposes).
1P
281 Equipment Manual
@SiemensA(31992,
Order
No:
GE.%
99&r)Kp21
2–1
Hardware Settings
R 11192
/
Plug–in connectors
\
Filter
setting,
digital
inputs
o
setting,
24 V
inputs
liiih’-
X46
./
Wire braakrecognition
x45
Selection of the
X41
encoder interface
X42
o
123
Pin allocation of the
plug-in
jumpars
Figure 2.2: Setting elements on the plug-in submodule
Before the plug–in jumpers can be set, the cover must be removed by unscrewing four screws
(+
figure 1.1). If settings on the plug–in
submodule
are to be adjusted, it must first be removed
from
~he
basic module by hand.
A
!
Caution
To avoid damaging the module, do not use tools to remove the plug–in
submo-
dule.
After setting the plug–in jumpers, install the plug–in
submodule
again
(+
section 1.3.1). Replace
the cover and screw down.
2–2
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No:6ES5998-0KP21
R 11/92 Hardware Settings
2.2 Setting the
DIL
Switches
Address decoding
OIL
switch S1 is used to set the basic address and select the address
and basic address
decoding.
The register address for read and write accesses of the individual registers
is generated from the set basic address and the offset (-t section 3).
The module occupies the address area from basic address +0 to basic ad-
dress +7 in both the input and output area.
Switches
S1.1
to
S1.9
are used to set address bitsAB3toAB11.
The address is always a multiple of 8 since address bits
ABO
to
AB2
are
fixed.
Switch S1 .10 is used to switch between simple address decoding (8 bits)
and expanded address coding (12 bits).
Status on delivery: all switches “OFF”
S1
DEC AB1l
AB1O
AB9
AB8
AB7
AB6
AB5
AB4
AB3
211
.210
29
2S
27
26
25
24
#
II
Preceding
S5 basic address
Selection of address decoding
OFF= Simple address decoding
ON = Expanded address decoding
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 2–3
Hardware Settings
R 11192
Setting the basic
PLCSS5–11 5U andS5–115H evaluate only address bits
ABO
to AB7.
address for
Set
DIL
switch S1 as shown below.
PLC
S5-1
15U
and
PLC
S5-1
15H
Switch Meaning Setting
S1 .1 to S1.5 AB3
to
AB7
Basic address
S1 .6 to S1 .9
Disregard Any
S1.lo 12/8-bit decoding
OFF
Example:
2–4
Since the
1P
281 is always addressed in the analog 1/0 area when used with
PLCS5–115U and PLCS5–115H, possible basic addresses are 80H (128)
to F8H (248).
Basic address of the module: 090H
Qaddress
144 ~
PY144 toPY151
I
I
Basicaddress=
141
LSetting is fixed.
~
1P
281 Equipment Manual
@
Siemens AG 1992, Order No:
6ES5998-0KP21
R 11/92 Hardware Settings
Setting the basic
PLCS S5–135U,
S5–155U
and
S5–155H
evaluate address bitsAB11 to
address for ABO.
Set DIL switch S1 as shown below.
PLCS5-135U,
PLC
S5-155U
PLC
S5-155H
1st example:
2nd example:
r
Switch
S1 .1 to
S1
.5
S1 .6
SI.7 to S1.9
S1.lo
Meaning
AB3
to
AB7
Selection of area
AB9toAB11
12/8–bit decoding
Setting
Basic address
Areas
OFF = P area
ON = Q area
OFF
ON
The module can be operated in both the analog 1/0 area (P area) and the
expanded 1/0 area (Q area) when used withPLCSS5–135U, S5–
155U
and
S5–155H.
Available basic addresses are listed below.
P area: 80H (128) to
F8H
(248), addresses F080 to FOF8
Q area: OH (0) to
F8H
(248), addresses F1OO to F1F8
~
The Q area can only be used in expansion units.
P area
Basic address of the module:
A8H ~ address 168
Q
PY168 toPY175
~
27
$
25
24
23
Setting is fixed.
1’
128 + O + 32 + O + 8
I
Selection: Q area = OFF Basic address = 168
Q area
Basic address of the module: A8H~ address 168 ~
OYB168 toOY175
~
,2’
2’
25
24
23,
Setting is fixed.
1
128 + O + 32 + O + 8
I
Selection: Q area = ON Basic address = 166
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 2–5
Hardware Settings
R 11192
Selecting the
DIL switch S2 is used to select the S5 interrupt line which triggers the
interrupt line
interrupt on the PLC
(+
section 4).
Only one switch may be set to ON.
S2
IRD IRC
IRB IRA
I
OFF: No interrupt
OFF
ON
S5 interrupt lines IRA to
IRD
ON: Interrupt
v”iathe
applicable line
Status on delivery: all switches OFF
2–6
IP
281 Equipment Manual
@
SiemensAG
1992, Order No:6ES59e8-oKP21
R
11192
Hardware
Settinas
2.3
Setting the Plug-In Jumpers
Location
of
the
plug–in jumpers
BASP
function for
digital outputs
The design of both counters is identical (i.e., the location of the components
on the module and the plug–in
submodule
are geometrically identical).
This makes it easier to set the plug –in jumpers.
The settings are made with plug–in jumpers X20, X30 to X39 (basic
module) and X40 to X49 (plug–in
submodule).
Plug–in jumper X20 affects both counters.
Counter 1 is set with X30to X39; counter 2 is set with X40 to X49. Plug–in
jumpers with the same relative position have the same function.
~
Plug-in jumpers X50 to X55 are used for internal factory testing
purposes. Leave them open.
Plug–in jumper X20 can be used to switch the EMERGENCY OFF function
(BASP)
on or off for both counters together
(-+
section 1.4.3).
I
Jumper X20
I
H+----
Effect
Not permitted
The digital outputs are switched off when the
BASP
signal is active.
00———0
The digital outputs are not switched off when the
1
23
BASP
signal is active.
A
!Warning
When the plug–in jumper is inserted on 2–3, the digital
output is not switched off even when an error occurs. This
can lead to destruction of system components and injury to
persons.
Status on Delivery
Jumper X20
Effect
~o
The digital outputs are switched off when the
BASP
1
2
3
signal
ia
active.
1P
281 Equipment Manual
@SiemensA(31992,
Order
No: 6ES5998-I)KIJX 2–7
Hardware Settings
R 11/92
Setting the
input filter
Digital inputs
The 24 V counting inputs and the digital inputs are equipped with
RC
filter
for the suppression of interferences. These filters can be set individually to
various limit frequencies.
Input signals and interferences whose frequencies are above the limit fre-
quency are filtered out.
Plug–in jumpers X30 to X32 and X40 to X42 are used to set the maximum
signal frequency for the digital inputs.
I
Allocation of the Plug-In Jumpere
Function Counter 1
Counter 2
Gate start input
X30 X40
Gate stop input
X31 X41
Set input
X32 X42
Setting the
Llmlt
Frequency
Jumpers X30 to X32 Maximum signal frequency
X40 to X42
000
1
250
kHz
23
~o
25
kHz
1
23
o~
100 Hz
1
2
3
Status on Delivery
1
I
Jumpers X30 to X32
I
Maximum signal frequency
X40 to X42
I
z
+.
00250
kHz
1
* Plug–in jumper premounted on pin 3
2–8
1P
281 Equipment Manual
@ SiemensAG 1992, Order No:6ES5998-0KP21
R 11192
Hardware Settings
24
V encoder
inputs
Plug–in jumpers X36 to X38/X46 to X48 are used to set the maximum
counting frequencies for the 24 V encoder inputs.
I
Allocation of the Plug-In Jumpere
Function Counter 1
Counter 2
Track A
X36 X46
Track B x37 x47
Zero marking pulse X38 X46
Setting the Limit Frequencies
Jumpers X36 to X38 Maximum counting frequency
X46 to X46
000250
kHz
1
2 3
~o
50
kHz
1
23
o~
1
kHz
1
2 3
Status on Delivery
Jumpers X36 to X38 Maximum counting frequency
X46 to X48
00
~,
250
kHz
1
2
* Plug–in jumper
premounted
on pin 3
Minimum pulse
Plug– in jumpers X33M43 are used to set the minimum pulse duration for
duration for
the digital outputs. This is the minimum time a digital output remains active
digital outputs
after activation.
Allocation of the Plug–In Jumpers
x33
Minimum pulse duration, digital output 1
x43
Minimum pulse duration, digital output 2
Setting the Minimum Pulse Duration
Jumpers
X33iX43
Minimum pulse duration
000
Approx.
500
msec
1
2
3
~o
Approx.
100
msec
1
2 3
o~
Approx.
10
msec
1
2
3
Status on Delivery
Jumpers X33/X43
Minimum pulse duration
z
{*
00
Approx.
500
msec
1
* Plug–in jumper
premounted
on pin 3
1P
281 Equipment Manual
@
.%3MEHIS
AG 1992, Order No: 6ES5 998-0KP21 2–9
Hardware Settinas
R 11192
Wire break
recognition
Plug–in jumpers X34/X44 are used to switch the wire break recognition on
or off for the individual counters
(+
section 1.4.1.2).
Allocation of the Plug–In Jumpers
x34
Wire break recognition for counter 1
I
x44
I
Wire break recognition for counter 2
I
I
Setting the Wire Break Recognition
I
X341X44
I
Meaning
000
1
2 3
Not permitted
I
~o
Wire break recognition switched off
1
1
2 3
I
o~
Wire break recognition switched on
1
1
23
I
1
~
The wire break recognition can only be used during operation of
the RS 422 interface.
The wire break recognition
must
be switched off when the counter
is operated with the 24 V encoder interface.
Status on Delivery
x34/X44
I
Meaning
Wire break recognition switched off
2 – 10
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No:6ES5998-0KP21
R 11192
Hardware Settings
Selecting the
Plug– in jumpers
X35M45
are used to select the encoder interface (24 V
encoder interface
encoder or 5 V encoder in accordance with
RS
422) for the respective
(RS 422/24
V)
counter.
Allocation of the Plug-In
Jumpera
x35
Interface selection, counter 1
x45
Interface selection, counter 2
Interface Selection
X351X45
Selection
000
Not permitted
1
2
3
~o
For 24 V encoder
1
2 3
o~
For
RS
422 encoder
1
23
I
Status on Delivery
X351X45
Selection
~o
24 V encoder selected
1
2
3
A
! Caution
If you switch the encoder interface, you must also switch the
reference potential for plug connector X5/X7 otherwise the
potential isolation is removed
(+
following page and section
1P
281 Equipment Manual
@
SiemenS
AG 1992, Order No: 6ES5 998-0KP21
2 – 11
Hardware Settings R 11/92
Selecting the
Plug– in jumpers
X39/X49
are used to set the reference potential for the
reference potential
encoders.
for the encoder
The encoder interfaces can be operated as either 24 V interfaces or 5 V
(RS422). If the interface is adjusted, the corresponding reference potential
must beset to prevent the potential isolation between the 24 V area and the
5 V area from
being
removed.
I
Allocation of the Plug–In Jumpers
x39
Reference potential for counter 1 (X5)
x49
Reference potential for counter 2 (X7)
I
Reference Potential Selection
X391X49
Meaning
Use
I
1
000
Not permitted
1
23
r
-
0--00
1
23
0
Vew4
is connected to pin 7 24 V encoder
(X51X7).
I
I
o~
Ml from S5 bus is
con–
RS 422 encoder
1
23
nected
to pin 7 (X5/X7).
A
!
Caution
/@\
Incorrectly inserted jumpers can lead to interferences caused
by grounding loops. In addition, the potential isolation of the
24 V encoder inputs to the S5 is lost.
I
Statua
on Delivery
x39/x49
Meaning
Use
~o
O
VeW4
is connected to pin 7 24 V encoder
1
23
(X5M7).
2 – 12
1P
281 Equipment Manual
@
.SiemensAG
1992,
Order
No: 6E.% gg8-l)KP21
R
11/92
Software Settings
3
Software Settings
3.1
3.1.1
3,1.2
3.1.3
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
3.10
General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1
Definition
ofthe
Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1
Selectingthe
Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–2
Reading and Writing the Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–3
SelectRegister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–4
Load Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–5
Interrupt Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–7
CounterValueRegister(CVR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–9
lnterruptEnable Register
(lFR)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–11
lnterruptlnformation
Register(llR)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-12
Status Register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–14
ParameterRegisters and Control Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–16
Overview
ofthe
RegisterAddresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
3–18
IP281 EquipmentManual
@SiemensAG 1992, 0rderNo:6ES5 998-fjKp21 3–1
R11192
Sollware
Settings
3
Software Settings
3.1
General
3.1.1
Definition of the Registers
Select register
Global registers
Control register 3
Status register 3
Interrupt infor–
mation register
Specific
registers
Control registers
1 and 2
Parameter
registers 1 and 2
Interrupt enable
registers 1 and 2
Load registers
1 and 2
Interrupt registers
1 and 2
Counter value
registers
Used as an addressing aid for the selection of a register set
Registers containing information for both counters. Global registers are
control register 3, status register 3 and the interrupt information register.
The general module functions are set here.
Indicates the status of the module
Information concerning the interrupts triggered is stored here.
Registers which are available for each individual counter
The control of the respective counter is specified here.
Counting mode, operating mode, counting pulse evaluation, gate control,
input behavior of the counting inputs, method of operation of the
digtal
out-
put, and synchronization are parameterized here for the respective counter.
The interrupt sources which will trigger interrupts are set here for the
respective counter.
A start value can be entered here for the respective counter.
An interrupt value can be entered here for the respective counter.
The respective counter uses these registers as intermediate storage to
allow the contents of the counter to be read out.
1P
281 Equipment Manual
@
Siernens
AG
1992,
order
No:
6ES5
998-r)Kp21 3–1
Software Settings
R 11/92
3.1.2
Selecting the Registers
Principle of
selection
Register address
3–2
The registers of the
1P
281 are divided into sets of registers for read and
write accesses. Before a register can be accessed, the corresponding
register set must be set with the select register
(@
section 3.2).
The desired register can then be read or written via the register address.
The register address consists of the following components.
- The basic address set (via DIL switch S1 for the
1P
281) (-t sect. 2.2)
and
– The offset in the respective register set (-t section 3.2)
Register address = basic address + offset
~
Anerror message is notgenerated when an address is accessed
which is not assigned to a register. The access is acknowledged
with
~
1P
281 Equipment Manual
@
SiemensAG
1992, Order No:6ES5998-0KP21
R 11192
Software Se
ftings
3.1.3 Reading and Writing the Registers
The registers are read or written via the programmable controller using S5
commands. The permissible commands are found in section 3.10.
Writing the
registers
Reading the
registers
The use of word commands is recommended for registers which are longer
than one byte (load, interrupt and parameter registers) .
(Exception: CPU 944, only byte commands are permitted.)
The
1P
281 does not accept the values until the last byte is written (access to
the byte with the highest offset address of the corresponding register). It is
mandatory that the sequence from the lowest address to the highest ad-
dress (or from the highest byte to the lowest byte) be adhered to to prevent
the registers from accepting erroneous values.
The contents of the registers are stored intermediately during read
ac–
cesses.
Intermediate storage is performed when the lowest address/
highest byte of the register to be read is accessed.
~
The entire
re9ister
must be read to
obtain
avalkj
value
No other register can be read until the entire register has been read.
As soon another readable register is accessed, the new contents
are intermediately stored and the old value is lost.
Example:
Read byte 3 of
CVR1
~
Value is stored.
Read byte 2 of
CVR1
-t Value of
CVR1
is still valid.
Read byte 1 of
CVR1
-+ Value of
CVR1
is still valid.
Read byte O of
CVR1
~
Read
CVR1
is concluded.
Read byte 3 of
CVR1
-t Value is stored.
Read byte 2 of
CVR1
~
Value of
CVR1
is still valid.
Read
STATUS1
-t Value of
CVR1
is lost.
STATUS1
is valid.
Read byte 1 of
CVR1
~
Value is invalid.
It is recommended that registers which are longer than one byte
(IIR
and
CVR)
be read with word commands,
(Exception: CPU 944: Only byte commands are permitted.)
Access
via
CPU 944 inPLCS5–115U does not permit word commands. When byte
byte commands
command addressing is used, the access sequence shown below must be
adhered
to.
– Sequence of byte addresses for 2–byte registers:
1st
byte address: n
2nd byte address:
n+l
– Sequence of byte addresses for 4–byte registers:
1st
byte address: n
2nd byte address:
n+l
3rd byte address:
n+2
4th byte address: n+3
1P
281 Equipment Manual
@SiemensA(31992, order
No:
6ES599&r)Kp21 3–3
Software
Setfinw
R 11/92
3.2 Select Register
A register set is selected to address the registers for the
1P
281. The allocation of the registers to
the ;ets is shown in the following figure. -
Offset O
1
2
3
Write 4
5
6
7
Offset O
1
2
3
Read 4
5
6
7
Reg. Set O Reg. Set 1
+
Parameter
register 1 Load
Parameter
register 1
register 2
+
IIR
Status reg. 1
Status reg. 2
I
Status reg. 3
I
J
.————
-————
Counter
value
register 1
Counter
value
register 2
Reg. Set 2 Reg. Set 3Reg. Set 4
~
Select reg.
-————
-————
-————
Interrupt
register
1
Select reg.
-————-
IFR 2
Load
register 2
Select reg.
-————-
-————-
-————.
Interrupt
register 2
When a counter is operated in 16–bit mode, only byte O and byte 1 are used when 4–byte re–
gisters
are used (i.e., the offset addresses for the load, interrupt and counter status registers are
incremented by 2).
A register set is selected in the select register. The register set remains selected until a new value
is entered in the select register.
Register Set
Contents of the Select
Register
o
OH
1
IH
2
2H
3
3H
I
4
I
4H
I
The ERROR LED
goes
on for all other entries. The select register
is
always
addressed with offset
address O regardhss of the register set selected. The
selec~
register can-not be read back.
Caution
When a set is selected in the interrupt program (e.g., to read out the
IIR),
this call
causes the current set selection in the cyclic program to be lost. This makes it
necessary to save the selected set for all read and write procedures for which the
interrupts are not disabled
IA/RA).
The selected set address must then be saved in
a selected memory location and reloaded at the end of the interrupt program.
3–4
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No:
6ES5998-0KP21
R 11192
Software Settings
3.3 Load Register
Each counter is equipped with a load register. A defined value (load value), which is used to load
the counter for certain events, can be stored in this register.
The load register can be written
atall
times (except with operating mode
TCLR).
It cannot be read
back.
The load value is entered as a 16–bit or 32– bit value in the register (depending on the counting
mode set).
The following methods can be used to enter the values in the load register.
– Writing the load register from the
PLC
– Transfer when in
TCLR
operating mode
(+
section 6.4.3)
~
Load register 2cannot rewritten from the
PLC
in operating mode
TCLR.
Contents of the register after
RESIX
O
Load register 1/2
Byt~
3
Bw~
2
2S1
.
-
-
-
-
-
-
-
-
224
I
223.
-
-
-
-
-
-
-
-
216
31
30 29 28 27 26
25
24
23
22
21
20
19 18 17 16
15 14 13 12
11
10
9 8
7
6
5
432
1
0
Byte 1 Byte O
For counting modes 1 and 3 (16–bit):
‘8e’ml
For counting modes 2 and 4 (32–bit):
Offset 4
n
Byte 3
5Byte 2
6
Byte 1
7
Byte O
1P
281 Equipment Manual
@SiemensA(31992, Order No: 6ES5998-0KP21 3–5
Sotlwfare
Seitirws
R
11192
Example: Writing load register 1 (32 bits)
Prerequisites:
– Load value is in
DB
20.
DW 10 (high word, bits 31 to 16)
DW 11 (low word, bits 15to O)
– Counting mode 2 or 4 is selected (i.e., offset= 4).
– Basic address of the module: 136
With word commands:
L KH 1 }
Set register set 1 for access to the load register
T PY 136
C
DB
20
Call data block 20
L DW 10
T PW 140’)
L DW 11
1
Transfer load value from
DB
to the
1P
281
T PW 142*)
~
With byte commands:
L KH 1
T PY 136 }
Set register set 1
C
DB
20
Call data block 20
L DL 10
T PY 140’
\
L
DR
10
T PY 141 *
L DL 11
\
Transfer load value from
DB
to
1P
281
T PY 142*
L
DR
11
T PY 143*
I
Example:
Writing load register
1
(16 bits)
Prerequisites:
– Load value is in
DB
20.
DW 11 (bits 15 to O)
– Counting mode 1 or3 is selected (i.e., offset= 6).
– Basic address of the module: 136
With word commands:
L KH
1
T PY 136 }
C
DB
20
L DW 11
T PW 142’ }
With byte commands:
L KH 1
T PY 136 }
C
DB
20
L DL 11
T PY 142*
L
DR
11
T PY 143* }
* Register address = basic address + offset
Set register set 1
Call data block 20
Transfer load value from
DB
to
1P
281
Set register set 1
Call data block 20
Transfer load value from
DB
to
1P
281
3–6
1P
281 Equipment Manual
@
SiemensAG
1992, Order No:6ES5998-0KP21
R 11/92 Software Settings
3.4 Interrupt Register
Each counter is equipped with an interrupt register. A defined value (interrupt value) can be stored
in this register and continually compared to the current counting value (hardware comparator).
A digital output can be activated
(+
section 6.7) or an interrupt generated
(+
section 4.4) when
the counting value reaches the interrupt value.
~
A digital output must be enabled in control register 3
(+
section 3.9) before it can be
activated. An interrupt must be enabled in the interrupt enable register
(+
sections 3.6
and 4.4) before it can be generated.
The interrupt register can be written at all times. It cannot be read back.
The following methods can be used to enter the interrupt value in the interrupt register.
– Writing the interrupt register via the S5 from the
PLC
– Transfer in
TCAR
operating mode
(+
section 6.4.2)
~
interrupt register 2cannot rewritten
Contents of the interrupt register after
RESH:
Interrupt register 1/2
Byt?
3
from the
PLC
in operating mode
TCAR.
o
B~e 2
I
1
231.
-
-
-
-
-
-
-
-
224
223-
-
-
-
-
-
-
-
-
216
31
30
29
28
27 26 25 24
23
22
21
20
19 18 17 16
15 14 13 12
11
10
9
8 7
6
5 4
3
2
1
0
215- - - - - .
-
- -
28 27
-
.
-
-
-
-
-
-
-
20
Byte 1 Byte O
For counting modes 1 and 3 (16–bit):
Offset 6
Byte 1
7
Byte O
for counting modes 2 and 4 (32–bit):
Offset 4
r
Byte 3
5
Byte 2
6
Byte 1
7
Byte O
1P
281 Equipment Manual
@SiemensA(31992,
order
No:
6E!%
99&
fJKp21
3–7
Software Settings
R 11192
Example: Writing interrupt register 1 (32 bits)
Prerequisites:
– Interrupt value is in DB 20.
DW 10 (high word, bits 31 to 16)
DW 11 (low word, bits 15 to O)
– Counting mode 2 or 4 is selected (i.e., offset= 4).
– Basic address of the module: 136
With word commands:
L KH 2
>
Set register set 2 for access to the interrupt
T PY 136
register
C DB 20
Call data block 20
L DW 10
T PW 140*
L DW 11
)
Transfer interrupt value from DB to
1P
281
T PW 142’
~
With byte commands:
L KH 2
T PY 136 }
Set register set 2
C DB 20
Call data block 20
L DL 10
T PY 140’
L
DR
10
)
T PY 141 *
L DL 11 )
Transfer interrupt value from DB to
1P
281
T PY 142*
L
DR
11
T PY 143’
/
Example: Writing interrupt register 1 (16 bits)
Prerequisites:
– Interrupt value is in DB 20.
DW 11 (bits 15 to O)
– Counting mode 1 or 3 is selected (i.e., offset= 6).
– Basic address of the module: 136
With word commands:
L KH 2
T PY 136
>
C DB 20
L DW 11
T PW 142* }
With byte commands:
L KH 2
T PY 136 }
C DB 20
L DL 11
T PY 142*
L
DR
11
T PY 143* }
* Register address = basic address + offset
3–8
Set register set 2
Call data block 20
Transfer interrupt value from DB to
1P
281
Set register set 2
Call data block 20
Transfer interrupt value from DB to
1P
281
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5 998-0KP21
R
11192
Software Settings
3.5 Counter Value Register
(CVR)
The counter value register
(CVR)
is used to read out the counter status. It contains either 16 bits
(modes 1 and 3) or 32 bits (modes 2 and 4) depending on the counting mode set.
The CVRcan be read by the S5 at all times. Thecountervalues can be read asynchronously (each
counter individually) or synchronously (counter 1 and counter2 simultaneously
(+
section 6.5.3)).
With high–byte addressing (byte 1 for 16 bits; byte 3 for 32 bits), the counting value is
interme–
diately
stored in the
CVR
until the lowest byte (byte O) is addressed and output
(+
section 3.1.3).
Each counter is equipped with a
CVR
register.
CVR
1 for counter 1
CVR
2 for counter 2
Counter value
Byte 3 Byte 2
register
231.
-
-
-
-
-
-
-
-
224
I
223.
-
-
-
-
-
-
-
-
216
31
30 29
28
27
26 25
24
23
22
21
20
19 18 17 16
15 14 13 12
11
10 987
6
5 4 3 2
1
0
215-
-
-
-
-
-
-
-
-
28 27
-
-
-
-
-
-
-
-
-
20
Byte 1 Byte O
For counting modes 1 and 3 (16–bit):
Counter 1
Counter 2
-:m
OWE
For counting modes 2 and 4 (32–bit):
Counter
1
Counter 2
‘ffset:m
OfietiE
1P
281 Equipment Manual
@
Siemena
AG
1992,
order
No:
6ES5
99&(jKp21 3–9
Software Settings R 11/92
Example:
Reading
CVR
1 (32 bits)
Prerequisites:
– Memory for counter is in
DB
20.
DW 20 (high word, bits 31 to 16)
DW21 (low word, bits 15to O)
– Counting mode 2 or 4 is selected (i.e., offset= O).
– Basic address of the module: 136
With word commands:
L KH 1 }
Set register set 1 for access to the counter value
T PY 136
register
C
DB
20
Call data block 20
L PW 136*
)
T DW 20
L PW 138*
)
Read counter value and store in DW
20/DW
21.
T DW 21
With byte commands:
L KH 1
T PY 136 }
Set register set
1
C
DB
20
Call data block 20
L PY 136*
T DL 20
L PY 137*
)
T
DR
20
L PY 138’
)
Read counter value byte by byte and store
T DL 21
in DW
20/DW
21
L PY 139*
T
DR
21 )
Example:
Reading
CVR
1 (16 bits)
Prerequisites:
– Memory for counter is in
DB
20.
DW21 (bits 15 to O)
– Counting mode 1 or 3 is selected (i.e., offset= 2).
– Basic address of the module: 136
With word commands:
L KH 1
T PY 136
)
C
DB
20
L PW 138*
T DW 21 }
With byte commands:
L KH 1
T PY 136 1’
C
DB
20
L PY 138*
T DL 21
L PY 139’
T
DR
21 }
* Register address = basic address + offset
3 – 10
Set register set 1
Call data block 20
Read counter value and store in DW 21
Set register set 1
Call data block 20
Read counter value byte by byte and store
in DW 21
1P
281 Equipment Manual
@
.%3MWIS
AG 1992, Order No: 6ES5
996-0KP21
R 11192
Software Settings
3.6 Interrupt Enable Register (IFR)
Each counter is equipped with an interrupt enable register with which the interrupt sources can
be enabled or disabled (-t section 4.4).
“’’’t”;
Wmz
Interrupt value reached, counting up
Interrupt value reached, counting down
b—::l
The interrupt is disabled when a “O” is entered;
when a”1” is entered. the interrupt is enabled
Counter 1
Counter 2
Offset 3
Byte O
Offset 3
Byte O
RESET
status
76543210
0 0 0
0
0 0 0 0
Example:
All interrupts are disabled.
Setting the
IFR
for counter 2
Basic address of the module: 136
L KH 3 }
Set register set 3 for access of the
IFR
for
T PY 136
counter 2
L KMOOO11OOO
}
Enable counter underflow interrupt and gate
T PY 139
start interrupt
76543210
000
1 1
0
0
0
An interrupt is triggered for “counter underflow” and “gate start”; the other
interrupts are suppressed.
1P
281 Equipment Manual
@.SiemensA(31992,
order
No:
6ES5998-0KP21 3 – 11
Software Settings
R
11192
3.7 Interrupt Information Register (IIR)
The interrupt information register is a 2–byte register in which the causes of an interrupt are en-
tered. There is one common
IIR
for both counters.
Allocation
of the
IIR
RESET status
15 14 13 12 11 10 9 876543210
Disregard Disregard
Gate stop Gate stop
Gate start
Gate start
undefilo~
~
Overflow
Interrupt value reached,
counting down
Interrupt value reached,
counting up
\
Counter 2
I
::::&75JJ
Interrupt value reached,
counting down
Interrupt value reached, —
counting up
\
/
Counter 1
The cause of an interrupt is identified by a set bit.
All bits: O
Reading the
IIR
~
The
IIR
must be read during interrupt processing. This read ac-
cess resets the S5 interrupt and the
IIR.
The S5 can determine the cause of an interrupt by reading the
IIR.
The entire
HR
must always be read (2 bytes). Use of the word commands
LPW/LOW
is recommended for this purpose.
Word commands cannot be used with CPU 944. Byte commands
must be used for the access.
During the access to the
IIR
with byte commands, the interrupt
must be disabled with the S5 command 1A and enabled again after
the access with the S5 command RA.
New interrupts which occur while the
IIR
is being read are stored
intermediately. These are entered in the
IIR
after the read access, and
another interrupt is triggered.
3 – 12
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No:
6ES5!398-0KP21
R 11/92
Software Settings
Example:
Reading the
IIR
Prerequisites:
– Memory for
IIR
value is DW 30 of
DB
20.
– Basic address of the module: 136
With word commands:
L KH O
T PY 136 }
C
DB
20
L PW 136*
T DW 30 }
With byte commands:
L KH O
T PY 136 }
C
DB
20
IA
L PY 136*
T DL 30
L PY 137’
T
DR
30 }
RA
* Register address = basic address + offset
1P
281 Equipment Manual
@
Siemens
AG
1992,
order
No:
6E.%
998-
(JKP21
Set register set O for the access to the
IIR
register
Call data block 20
Store
IIR
in DW 30
Set register set O
Call data block 20
Disable interrupts
Store
IIR
in DW 30
Enable interrupts
3 – 13
So
ffware
Settings R 11/92
3.8 Status Register
There are three status registers containing information about the current status of the respective
counter (status register 1 or 2) or the module (status register 3)
(+
section 5.4).
Each status register contains 1 byte and can only be read.
The static entries are reset when the status register is read.
Contents of Status Register 1 /2
7
6543210
-L
J-
S
s s
s
d d
d d
s = Static entry, remains set until the register is read
d = Dynamic entry, indicates the current status
III
p
L
Gate
~tatu~
O: Gate closed (Counting pulses are not counted.)
1: Gate open (Counting pulses are counted.)
Counter runnlngl
O:
CRS
= O
1:
CRS
= 1
Direction of counting
o: up
1: Down
DQ
status
O: Digital output is inactive (O
V).
1: Digital output is active (24 V).
O: No zero
cr&+sing
occurred
1: Zero crossing occurred
L:cross’na
O: Counter not loadad
1: Counter loaded
Overflow
O: No overflow
1: Overflow occurred
Underflow
O: No underflow
1: Underflow occurred
1
The
CRS
bit (last position of the respective counter) is entered in the status register.
RESET Status
76543210
0 0 0 0
0
0 0
1
Offset 2
3
Status register 1
Status register 2
3 – 14
1P
281 Equipment Manual
@
Siemens AG 1882, Order No: 6ES5998-OKP21
R 11192
Software
Settinm
Contents of
Ststus
Register 3
s = Static entry, remains set until the register is read
d = Dynamic entry, indicates the current status
76543210
s
s
Illegel
operating mode
O:
O~eratinq
mode
setting
is correct.
1: Operatin~mode setting is incorrect.
Counter 2 aubmodule
Ineerted
O: No
1: Yes
Module parameterlzed
O: No
1: Yes
O: No
1: Yes
Wire break, counter 1
Wire break, counter 2
O: No
1: Yes
Disregard
RESET Status
7
6543210
Iqq
o
pl
o
Depending on whether a wire break has occurred
1
:Wire
break
O:NO wire break
1:
Counter 2
submodule
inserted
O: Counter 2
submodule
not inserted
Offset
4
Status register 3
I
1P
281 Equipment Manual
@.WmensA(31992,
Order
No:
6ES!5998-0KP21 3 – 15
Software Settings
R 11/92
3.9 Parameter Registers and Control Registers
The method of operation of the counters is set in the parameter registers and the control registers.
Each counter is equipped with one parameter register (1 or 2) and one control register (1 or 2).
Settings affecting both counters are made in global control register 3.
~
It is recommended thatthe 16-bit parameter registers rewritten with word commands
(exception: PLC
S5-115U,
CPU 944A/B).
Allocation of Parameter Registers 1/2
Except for bits 7 and 8, the allocation of parameter registers 1 and 2 is identical. See section 6
for the operating modes and functions.
15 14 13 12 11 10 9 876543210
.— —.
--
--
——
L
L
Counting
mode
00: 1 (16 bits, positive)
01: 2 (32 bits, positive)
10: 3 (16 bits, positive/negative)
11: 4 (32 bits, positive/negative)
Autonomous operating mode
XXO:
CONC
001: Ocss
011: OCHG
101: Ccss
111: CCHG
Counting pulse evaluation
00:
EVOT (one-time)
01:
EVfT
(two-time)
10:
EVFT
(four–time)
11:
EVDI
(direction)
Combination operating mode
Parameter reg.
1
Parameter reg. 2
00: No selection
00: No selection
01: SC2A
01: TCAR
10: No selection
10: TCLR
11 No selection
11: ZMPC
Gate control, GFS
O: By pulse
1: By level
Inverting at counting input A
O:
Not
inverted
1: Inverted
Inverting at counting Input B
O:
Not inverted
1: Inverted
Method of
oDeratlon,
dlaital
outDut
000: DQNU “ ‘ -
001: DQAO
010: DQAU
100:
DQiU
101:
DQID
Set
counter (synchronization)
O: Once
1: Several times
3 – 16
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No:6ES5998-0KP21
R 11192
Software Settings
Allocation of Control Registers 1 and 2
7
6543210
[
I I I IL I
1
1
J
,I
L
~
Gate start-stop (software gate from S5), GSS
O: Gate is closing.
1: Gate is
openingl.
Gate enable, GEN
O: Gate function is switched off.
1: Gate function is enabledl
Gate stop per software,
GST
O: No effect
1: Stops the
counterl
Enable counting up synchronization, EUS
O: Not
enabied
1:
Enabied2
~
Enable countirw down synchronization, EDS
~’g’’’’’b’ed-
-
Load counter via software, LOS
O: No effect
1: Counter is
ioadedl.
Not used
1 0
+
1 edge required
2 0
+
1
edge: synchronize once; 1
Ievei:
muiti–synchronization
Allocation of Control Register 3
3
I
1
I
~
Digitai
output, counter 1,
EDQ1
k
O: Switch off
digitai
output
1:
Enabie
digitai
output
Digitai
output, counter 2,
EDQ2
O: Switch off
digitai
output
1:
Enabie
digitai
output
Moduie was completely parametrized 3
O: No
1: Yes
Read counter synchronously,
SYR
O: Asynchronous reading
1: Synchronous reading
~
Controi
counter
mmchronousiu,
SYC
O: Asynchronous
~ontrol
-
1: Synchronous
controi
Not used
The
parameterization
bit with which you document the
compiete
parameterization
of the
moduie
must be set during
startup aftertheparameter register (or both registers) was/weretransferred tothe iP261.
Toaccompiishthis,
writecontroi
register
3asthe
iastwrite
access. The
parameterization
bitistransferred bythe moduietostatus
register3.
Foraii
addi-
tional
entries in
controi
register3,
the
parameterization
bit must be checked first (must be 1) in status
register3,
and the
parameterization
bit must then be set.
iP
261 Equipment
Manuai
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 3 – 17
Sothvare
Settings
R 11/92
3.10 Overview of the Register Addresses
Select
Offset Read
Selected S5 Command
Register Length in Bytes
Register
Address
Write Register
~1
o
w
Select register
TPY/TOY
1
OH
1
w
Control register 1
TPYITOY
1
OH
2
w
Control register 2
TPYiTOY
1
OH
3
w
Control register 3
TPYjTOY
1
OH
w
Parameter register 1
TPW/TOW
2
4
Byte 1
TPYITOY
5
Byte O
OH
w
Parameter register 2
TPWITOW
2
6
Byte 1
TPY/TOY
7
Byte O
OH R
IIR
LPWILOW 2
0
Byte 1 (counter 2)
LPYILOY
1
Byte O (counter 1)
OH
2
R
Status register 1 LPW/LOY
1
OH
3
R
Status register 2 LPYILOY
1
OH
4
R
Status register 3 LPYILOY
1
IH
3
w
IFR
1
TPYITOY
1
lH
w
Load register 1
TPWITOW 2 or 4
4Byte 3
TPY/TOY depending on the mode of the
5Byte 2 counters
6
Byte 1
7
Byte O
IH
R
Counter value register 1 LPW/LOW
2 or 4
0
Byte 3 LPY/LOY
depending on the mode of the
1
Byte 2 counters
2
Byte 1
3
Byte O
IH
R
Counter value register 2
LPWILOW
2 or 4
4
Byte 3 LPY/LOY
depending on the mode of the
5Byte 2 counters
6
Byte 1
7
Byte O
2H w
Interrupt register 1
TPWITOW 2 or 4
4Byte 3
TPYITOY depending on the mode of the
5
Byte 2 counters
6
Byte 1
7
Byte O
3H
3
w
IFR
2
TPYITOY
1
3H
w
Load register 2
TPW/TOW 2 or 4
4Byte 3
TPYITOY depending on the mode of the
5Byte 2 counters
6
Byte 1
7
Byte O
4H
w
Interrupt register 2
TPWITOW 2 or 4
4Byte 3
TPYITOY depending on the mode of the
5Byte 2 counters
6
Byte 1
7
Byte O
1
XX
= Any
3 – 18
IP
281 Equipment Manual
@
Siemens
AG
1992, Order No:
6ES5998-0KP21
R 11192 Interrupt Processing
4
Interrupt Processing
,,
.,
,,,,
,
4.1
4.2
4.3
4.4
4.5
4.6
What Is Interrupt Processing? . . . . . . . . . . . . .
Interrupt Processing . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
,..
.
.,
.
.
.
.
.
.
,..
.
.
.
.
.
.
.
.
.
.
.
.
.
Reaction Times During Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
Interrupt Sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Guidelines for Interrupt Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hysteresis of the Interrupt Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1P
281 Equipment Manual
@
Siemens
AG 1992. Order No: 6ES5998-OKP21
4–1
4–2
4–4
4–6
4–8
4–9
4–1
R 11/92
Interrupt Processing
4
Interrupt Processing
4.1
What Is Interrupt Processing?
Interrupt processing takes place when a signal external to the processor (CPU, central processing
unit of the PLC) interrupts the running program and triggers a separate program (the interrupt pro-
gram).
Interrupt processing is involved when such an interrupt signal is acquired via interrupt lines and
fed to the central processing unit. Process interrupt processing is involved when acquisition is
via input byte
160.
Only interrupt processing
can be triggered on the
1P
281. Process interrupt processing is
not
availabe on this module.
The interrupt program acknowledges the queued interrupt and evaluates it by reading and storing
current actual values, for example, or by generating an immediate reaction on a digital output
module. After the interrupt program is processed, processing of the interrupted program is contin-
ued at the point at which it was interrupted.
Interrupt processing is used to achieve fast reactions to changes in signal status.
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-0KP21 4–1
Interrupt Processing
R
11192
4.2 Interrupt Processing
This type of interrupt acquisition uses special interrupt lines on the S5 backplane bus to feed the
interrupt signal to the central processing unit.
Slot selection
When selecting the slots, remember that interrupt lines are not available on
all slots
(+
section 8.5 and equipment manual of the PLC).
Interrupt line
One interrupt line on the module must be selected via DIL switch S2 to feed
selection
the interrupts from the
[P
281 to the central processing unit.
S2
OFF:
ON:
The
IRD
IRC
IRB IRA
~
S5 interrupt lines IRA to
IRD
No interrupt
Interrupt via the applicable line
switch for the selected
interrurX
line must be set to ON: all other
switches must beset to OFF. All
fou;
switches must beset to OF
-
F when the
1P
281 is operated without the triggering of interrupts.
Several
IP281
modules can reconnected to one interrupt line. The module
which triggered the interrupt is determined in your interrupt program by
reading the interrupt information registers on the modules.
One organization block of the interrupt processing is assigned to each inter-
rupt line. It is called when the corresponding interrupt line is activated.
When several interrupts are queued, they are processed in the order of their
priority (either set in data blockDXO(forS5–135U and S5– 155U) or start-
ing with the organization block with the lowest number).
4–2
1P
281 Equipment Manual
@
Siemens
AG
19$)2,
Order
No:
6E&jgg8-r)Kp21
R 11/92 Interrupt Processing
Interrupt
Interrupts are evaluated at different locations on different programmable
evaluation
controllers.
PLC
I
Interrupt pointa
Occur
At
I
S5–115H
I
Synchronization points
I
I
S5–115U
Instruction boundaries
I
S5–135U
Block boundaries (standard setting) or
instruction boundaries (can be set in data block DX O)
I
S5-155U (155u mode)
I
Instruction boundaries
Remember the following when setting the interrupt points on the S5–
135L.L
The advantage of fast acquisition after each instruction (in practical terms,
reaction to an interrupt is immediate) must be weighed against the
disadvantage that programming the interrupt–controlled program
processing becomes much more complicated to ensure error–free “inser-
tion” of the interrupt program after each
STEP5
instruction.
Among other things, this requires that certain instruction sequences for an
interrupt be disabled by interrupts (either with software via
STEP5
instruction or with special functions).
Setting “interrupt at block boundaries” in data block DX O is always
recommended when the reaction time permits.
Particularly for interrupts after every instruction, remember that the signal
states or values of temporary data must not be overwritten in the interrupt
program. These values must be saved at the beginning of the
interrupt–
controlled program processing, and reloaded again at the end to ensure
that they are again available unchanged to the running program. This par-
ticularly applies to the scratchpad flag area from flag byte
FY
200 to
FY
255.
1P
281 Equipment Manual
@
Siemens
AG
1992,
Order No: 6ES5998-0KP21 4–3
Interrupt Processing
R 11192
4.3 Reaction Times During Interrupt Processing
The reaction time to an interrupt consists of the following partial times.
– Acquisition time of the module
– Acquisition time in the programmable controller
– Processing time of the interrupt program
Acquisition time
of the module
Acquisition time
in the program-
mable controller
Interrupt at
synchronization
points
Interrupt at
instruction
boundaries
Interrupt at
block boundaries
Interrupt
disable
Processing time
of the interrupt
program
(An enabled interrupt source)
The time between the triggering event and the triggering of the interrupt line
is a maximum of2
~sec.
When the event is triggered by external signals, the
delay time required to set the input filter must also be added
(+
section 8.7).
Interrupt acquisition in the PLC depends on the programmable controller
and the central processing unit used. Processing times of the system
program can be found in the applicable equipment manuals.
The longest reaction time to an interrupt is usually the processing time
between two synchronization points.
The longest reaction time to an interrupt is usually the processing time in the
operating system or the processing time of special functions or integrated
function blocks.
The longest reaction time of an interrupt is usually the processing time of the
longest running part of the program without block calls or block end
instructions.
~
Program loops injunction blocks often increase processing
time significantly.
Always remember that no interrupts are processed during a programmed
interrupt disable. The processing time of a program section containing an
interrupt disable may have to be included when determining the reaction
time to an interrupt.
The processing time is primarily determined by your own programming,
4–4
1P
281 Equipment Manual
@
.Siemens
AG
1992, order No: 6ES5888-0KP21
R
11192
Interrupt Processing
When are
Interrupts can be processed when the supply voltage of the module is
interrupts
within the tolerance range, and the RESET signal is inactive (“0”).
acquired?
Incoming interrupts are not processed as long as the
BASP
signal is active
(“l”),
When an interrupt is queued and the
BASP
signal becomes active, the inter-
rupt is removed by the
1P
281 from the S5 bus. The interrupt is output again
when the
BASP
signal becomes inactive again.
This behavior is not affected by plug–in jumper X20
(BASP
selection)
(+
section 2.3).
BASP
I
1
?
NT
INT
NW
INT
I
+
$$$
0
Startup or RESET: Interrupt Interrupts cannot
Interrupts are deleted.
pass through.
Interrupts are suppressed.
Acknowledging
When an interrupt is triggered by an interrupt enabled in interrupt enable
the interrupts
register
IFR
(-+ section 3.6), the cause is entered in interrupt information
register HR.
Interrupts which are not enabled do not trigger an interrupt and are not en-
tered in the HR.
Reading the
IIR
causes the interrupt to be reset,
Although one byte in the
HR
is available to each counter
(-+
section 3.7), the
IIR
must always be read in its entirety (2 bytes). For this reason, the use
of word commands LPW/LOW is recommended for the access.
When the CPU 944A/B is used, byte commands must be used for
the access. While the
IIR
is
being
accessed with byte commands,
the interrupt processing must
b=
disabled with the S5 command
1A, and then enabled again with RA after the access.
When several interrupts occur before the
IIR
is read by the S5 CPU, these
are also entered in the
IIR.
When interrupts arrive while the
IIR
is being read, these are stored inter-
mediately. An interrupt is then triggered again after the read procedure is
concluded.
1P
281 Equipment Manual
@ Siemens AG 1992, Order No:6ES5998-0KP21 4–5
Interrupt Processing
R 11/92
4.4 Interrupt Sources
The
1P
281 can trigger the interrupt processing on the S5 CPU when various events occur. There
are 6 interrupt sources for each counter. These sources can be enabled bythe respective interrupt
enable register.
76543210
0 0 0 = Interrupt disabled
1 = Interrupt enabled
1
r
, , ,
,
11-
LL
Interrupt when interrupt value is reached while counting up
Interrupt when interrupt value is reached while counting down
Interrupt for overflow of the counter
Interrupt for underflow of the counter
Interrupt for gate start
Several interrupt sources can be enabled for one counter. The triggering event (several if neces-
sary) must be determined in the interrupt program by evaluating the interrupt information register
(+
section 3.7),
4–6
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5998-OKP21
R 11/92
Interrud Processing
Explanation of the Interrupts
Interrupt when the interrupt value is reached while counting up
The counter must be counting up. An interrupt is triggered when the counter value reaches the
interrupt value. A hysteresis of
&
1 is provided when the interrupt value is reached
(+
section 4.6),
Interrupt when the interrupt value is reached while counting down
The counter must be counting down. An interrupt is triggered when the counter value reaches
the interrupt value. A hysteresis of
*1
is provided when the interrupt value is reached
(+
section 4.6).
Interrupt at counter overflow
The interrupt is triggered when a counter overflow occurs. A hysteresis is provided when the
overflow occurs
(+
section 6.2.1).
Interrupt at counter underflow
The interrupt is triggered when a counter underflow occurs. A hysteresis is provided when the
underflow occurs
(+
section 6.2.1).
Interrupt at gate start
An interrupt is generated when the internal gate (-t section 6.6) is opened.
When operating mode SC2A is used, the interrupt is also triggered when the interrupt value of
counter 1 has not yet been reached (i.e., the interrupt is exclusively dependent on the hardware
or software gate).
Interrupt at gate stop
An interrupt is generated when the internal gate
(+
section 6.6) is closed.
~
Nointerruptisgenerated whenthegate isclosedviathe EMERGENCY GATEstop(GST
in control register 1/2).
1P
281 Equipment Manual
@SiemensA(31992, order
No:
6Ef35998-0Kp21 4–7
Interrupt Processing
R 11192
4.5 Guidelines for Interrupt Processing
The use of one or more counter modules with
interrurX
wocessina reauires some
me~aration.
.,
-,
,,
Use the following overview as an aid.
.
,’h
,’i
%
-
u,
J:
II,
~n
,,,
%
,,
,,
,
,
.,1
,#,,
?
1,
9
I
~S
,!2!
I ,
.-.
,
I
1,
Decide how many interrupt–generating modules you want to use,
,:<
b
;
I*
b
,
,n
t
>
,rJo
,
1;
)
j~
b
.
.
. .
~
Check todeterminewhere themodules can be installed
(+
section 8.5 and the equipment manual of your
PLC).
D
Q.:.j
““
n
“’cl
~..
‘?
Selectthe
interrupt linewith
DILswitch
S2 (+section 4.2).
~,,:
:?ti
:.
a
I
L
Fw 100
T
The table in section 4.2 shows you where an interrupt will interrupt
JU
R’
%
~
youruser program:
Al
A
G
at block boundaries or at instruction boundaries or at
.
b
5.1
synchronization points.
10”
““’0’0”
’01
~
Allocate theinterruptenable register described infection 4.4
based on your application.
11000011
~
0s3
OB2
~
Setup yourinterrupt program inthe applicable interrupt OBs.
.
4–8
1P
281 Equipment Manual
@
.Siemens
AG
1992,
C)rrjer
No: 6ES5998-0KP21
R 11/92
Interrupt Processing
4.6 Hysteresis of the Interrupt Value
Each counter is equipped with an interrupt register in which an interrupt can be stored. Accep-
tance of the interrupt value can be triggered by the S5
(+
section 3.4) or by operating mode TCAR
(-t section 6.4.2).
The interrupt value is always compared with the current counter value (hardware comparator).
The following can occur when the counting value reaches the interrupt value.
– An interrupt is triggered
(-+
section 4.4).
– The digital output is activated
(+
section 6.7).
– Counter 2 is started
(+
section 6.4.5,
SC2A).
Hysteresis for
When the encoder stops at the interrupt–triggering position, the encoder
interrupt
can oscillate back and forth around this interrupt point. Interrupts would
processing
be triggered continuously or the digital output activated.
To prevent this undesired triggering of interrupts, the interrupt values are
provided with a hysteresis of
Al.
The counter cannot trigger a new interrupt unless it reaches a value at least
2 greater or 2 less than the interrupt value.
Example:
3FFD 3FFE 3FFF
4000
4001
4002 4003
1
-1
t
Hysteresis
Interrupt value = 4000
– An interrupt is triggered when the value 4000 is reached.
– If the counter oscillates between 3FFFand 4001, no further interrupts are
triggered even if the counter repeatedly reaches the value 4000.
– Anew interrupt is triggered when the counter reaches the
value3FFE
(or
less) or the value 4002 (or greater) and then assumes the value 4000
again.
The hysteresis is reset by loading the counter or the interrupt register.
1P
281 Equipment Manual
@
.%ITKXIS
AG 1992, Order No:6ES5998-0KP21 4–9
R 11192 Commissioning the Counter Modu/e
5
Commissioning the Counter Module
5.1
5.2
5.3
5.3.1
5.3.2
5.4
5.5
5.6
Commissioning Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 1
Startup Behavior of the Counter Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 – 3
RESET Behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–4
RESETCauses . . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–4
Basic Setting ofthelP281 after RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–4
Evaluation ofthe Status Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–5
Changing the
DirectionofCounting
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–8
Overviewofthe Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–9
IP281 EquipmentManual
@SiemensAG 1992,
OrderNo:
6ES5998-0KP21 5–1
R1l/92
Commissioning the Counter Module
5
Commissioning the Counter Module
5.1
Commissioning Guidelines
Hardware settings (items 1 to 5) and software settings (items 6 to 9) must be performed during the
commissioning of the counter module.
WI
?
1’
Check the following after unpacking the module.
Release status of the module
(Labelling
on the front plate)
Release status of the plug– in
submodule
3,
Adjust the module to the application conditions.
m
Interface selection
I@l
?
24 V encoder interface
I@l.
–Change interface selection plug –in jumper?
m
–Change reference potential plug–in jumper?
I@l
–Change limit frequency plug–in jumper?
–Circuit
Din
RE?
)
–Change wire break recognition plug–in
jumper?
1
Section 2.3
RS 422 interface
– Change interface selection plug
–in jumper?
–Change reference potential plug–in jumper?
–Change wire break recognition plug–in
jumper?
Limit frequency of the digital inputs
Minimum
r.mlse
duration of the
diaital
outrmts
F
‘nterrupt
~
4,
when
int
errupt processing is used, use
DIL
switch S2
m
to
select the interrupt line for your module. Section 2.2
1P
281
Equipment Manual
@
Siemens
AG 1992, Order No: 6ES5
998-0KP21
5–1
Commissioning the Counter Modu/e
R 11192
5. Switch off the programmable controller and insert the
?
module in the slot provided.
.
(Only certain slots are provided for interrupt processing
via interrupt lines.)
6. Setup the registers and write your startup
Parameter-
program in 06s 20 to 22
Section 3.2 to
ization
DB
?
of your programmable controller. section 3.9
~
Don’tforgetto include the status registers in
your startup program. These registers supply
you with information concerning the module or
the individual counters.
OB
1
7. Now setup your cyclic program in 061.
?
~
Don’tforgetto include the status registers in
your program. These registers supply you
with information concerning the module or
the individual counters.
I
I
I
R-J
OB
2
~
8. If necessary, setup yourinterrupt program inthe applicable
interrupt organization block.
L
I
9. When switching on the programmable controller, proceed
ma
ON
in the
seauence
as recommended below.
)
?
3.
4.
Opera~ing
mode switch on the central processing unit to STOP
Switch on power voltage for the programmable controller.
(Perform an “overall reset” for the program memory if
switching on for the first time.)
Transfer blocks from the programmer to the programmable
controller.
Start the central processing unit with a “new start”.
It is expressly pointed out that incorrect handling or operating or incorrect connec-
tion can damage the
1P
281 module. This can also cause extensive damage to your
system. We make the assumption that only qualified personnel who are also
familiar with the ESD protection regulations will work with the module.
5–2
1P
281 Equipment Manual
@
Siemens
AG 1992, Order No:
6ES5
998-OKP21
R
11/92
Commissioning the Counter Modu/e
5.2 Startup of the Counter Module
After switching on the supply voltage and an inactive RESET of the
S5,
the module is readv for
.
operation and-the green
‘%U-N”
LED goes on.
I
RUN LED
Indication
ERR LED
o
0
Meaning
Voltage supply missing (from
S5)
RESET is active.
Module is operating correctly.
Parameterization error or wire break
1P
281 Equipment Manual
@ Siemens AG 1992, Order No: 6ES5 998-0KP21 5–3
Commissioning the Counter Module
R 11/92
5.3 RESET Behavior
5.3.1
RESET Causes
There are two conditions which can cause a RESET of the
1P
281.
– RESET due to the S5
RES~
signal
- RESET due to power failure or power too low (hardware RESET)
The module is reset as soon as one of the two causes occurs.
After the reset, the module has the same status as it did after the first startup.
5.3.2 Basic Setting of the
1P
281 after RESET
Counting mode
Counter status
Operating mode
Gate
Counting pulse
evaluation
Interrupts
Registers
Digital outputs
Counter 1 and counter 2 operate in mode
and count from O to
FFFFH).
The counters have the value “O”.
(i.e., they are 6–bit counters
The “continuous counting”
(CONC)
operating mode is set for both coun-
ters.
The gate function is switched off (i.e., the counter counts (regardless of the
signals on the
STA
and
STO
input).
One–time evaluation
(EVOT)
is set for both counters.
All interrupts are disabled
(IFR
= O).
The registers are deleted (= O). The status registers contain the current
status.
The DQNU method of operating is set. The digital outputs are inhibited.
5–4
1P
281 Equipment Manual
@
Siemens
AG
1992,
order No: 6ES5
998-0KP21
R 11/92
Commissioning the Counter Module
5.4Evaluation of the Status Registers
Status registers 1 to 3 contain information on the current status of the counters and the module.
There are static entries and dynamic entries.
Static:
The applicable bit is set when the triggering event occurs. Reading the status
register causes the static bits to be reset.
Dynamic: The current status is indicated.
Contents of Status Register 1/2
Status after RESET
76543210
0
000000
1
s = Static
d = Dynamic
Gate
atatus
O: Gate closed (Counting pulses are not counted.)
1: Gate open (Counting pulses are counted.)
Counter running
O:
CRS
= O
1:
CRS
= 1
Direction of counting
o: up
1: Down
DQ
atatus
(DQS)
O: Digital output is inactive (O V).
1: Digital output is active (24
V).
zero crossing
O: No zero crossing occurred.
1: Zero crossing occurred.
Set
(SPE)
O: Counter not loaded
1: Counter loaded
Overflow
(OVF)
O: No overflow
1: Overflow occurred
Underflow
(UNF)
O: No underflow
1: Underflow occurred
5–5
IP
281 Equipment Manual
@ Siemens
AG
1992, Order No: 6ES5 998-0KP21
Commissioning the Counter Module
R 11/92
Gate status
Counter running
Counting direction
DQ
status
Zero crossing
Set
Overflow
Underflow
5–6
Indicates the current status of the internal gate (-t section 6.6)
The CRS (counter, bit O) of the applicable counter is entered in the status
register.
This bit indicates the current direction of counting. When stopped, the di-
rection of counting last indicated is retained.
This bit indicates whether the digital output is active (24 V level on
DQ).
This bit is set when the counter reaches the value O during counting.
Reading the register causes the bit to be reset.
This bit is set each time the counter is loaded. Reading the register
causes the bit to be reset.
This bit is set when the counter exceeds the upper counting range limit
(+
section 6,2.1). Reading the register causes the bit to be reset.
This bit is set when the counter passes below the lower counting range limit
(-+
section 6.2.1). Reading the register causes the bit to be reset.
1P
281 Equipment Manual
@.SiemensA(31992,
C)rder
No:6E85998-0KP21
R 11/92
Commissioning the Counter Module
Contents of Status Register 3
76543210
s
s
d
dd
s = Static
d = Dynamic
I
I
~
Illegal operating mode (IOM)
L
O: Operating mode setting is legal.
1: Operating mode setting is incorrect.
Counter 2 submodule inserted
O: No
1: Yes
Module psrsmeterized
O: No
1: Yes
Wire bresk, counter 1
O: No
1: Yes
~
Wire bresk, counter 2
O: No
1: Yes
Disregard
Status after RESET
76543210
xxx
@
~
o
@
o
~Wirebreak
message is queued: 1
Wire break message is not queued: O
@Counter 2submoduleis present: 1
Counter 2
submodule
is not present: O
Illegal operating
mode (IOM)
Counter 2 sub–
module inserted
Module
parameterized
Wire break,
counters 1/2
Monitors the
parameterization.
The bit is automatically set to O when the
parameterization
is legal. The
parameterization
must be checked if the bit is
set
(+
section 6.4).
This bit indicates whether the plug– in
submodule
is installed.
After the
1P
281 has been
parameterized,
the S5 can use control register3
(set bit 2) to report that the module is
parameterized.
Assoonasthe bit has
been set (during startup) in the control register, it can be read back via the
status register for monitoring purposes.
This status bit remains set as long as operation of the module is “normal”. It
is deleted when a supply voltage failure occurs or the S5 initiates a RESET
(i.e., the
parameterization
is lost).
As soon as a wire break occurs on the RS 422 encoder interface
(+
section 1.4.1 .2), the applicable bit is set in status register 3 if the wire
break recognition is active. Reading the status register causes the bitto be
reset if no more errors are queued.
Statuss
~
Bit 4/5
1P
281 Equipment Manual
@
.%31WIS
AG 1992, Order No: 6ES5 998-0KP21
Status bit is not reset.
5–7
Commissioning the Counter Modu/e
R 11192
5.5 Changing the Direction of Counting
The direction of counting is determined by two different methods depending on the type of pulse
evaluation. When encoders with two pulse trains displaced by 90” (counting pulse evaluation
EVO~
Em,
EVFT)
are used, the direction of counting is derived from the signal sequences of A
and B
(+
section 6,2,2).
By inverting the input signals while retaining the same direction of rotation of the encoder, the direc-
tion of counting can be changed without having to change the wiring. The inversion is set in the
parameter register of the respective counter.
Parameter Register 1/2
15 14 13 12 11 10 9876543210
~
Inversion at counting input A
O: Not inverted
1: Inverted
~
Inversion at counting input B
O: Not inverted
1: Inverted
When encoders with one pulse train (counting pulse evaluation
EVDI)
are used, the direction of
counting is specified by the level at counting input B or by bit 11. Inversion is specified at counting
input B
(+
section 6.2.2).
5–8
1P
281 Equipment Manual
@
Siemens
AG
1992, Order No: 6ES5 998-0KP21
R 11192
Commissioning the Counter Module
5.6 Overview of the Operating Modes
3perating
Mode
r
---
Counting Mode Operating Mode
Gate Control
Counter 1
I
Counter 2 Counter 1
I
Counter 2
Counters 1 and 2
Wtonomous
)perating
node
combination
)perating
nodes
H=
CONC
1
2
3
4
Ocssl
1
Ccss
2
3
4
OCHG/
1
CCHG
I
2
3
4
TCAR
1
2
3
4
TCLR
1
2
3
4
ZMPC
1
2
3
4
SC2A
1
2
3
4
1
1
1 2 3 41
Hardware Gate
Software Gate
Start
stop start Stopl
++++
i-+--Fi-
+
++++
++++
++++
The autonomous operat-
++++
ing modes can be com-
++++
bined aa desired.
++++
++++
++++
+++++
++++
+––-
+++
–++
-+––
+++
-++
–+–
++–+++
—-
-+
+++
–++
+---
–+––
-–+–
–+
+++i-
++++
++++
++++
++++
++++
++++
++++
+++ –++
+++
–++
● ☞☞
☞☞☞
☞
☞☞☞
2
+++ –++
+++ –++
+
+++ –++
+++ –++
+++
-++
+++
–++
+
+++
–++
+
☞✍
+
+ Setting permitted
– Setting not permitted: The ERR LED goes on and the IOM bit 3 is set in status register 3.
. Setting has no effect: The module does not operate in this mode. The ERR LED does not 90 on and the
IOM
bit is not
set in
=tatus
register 3.
+
No practical use
1 The software EMERGENCY OFF gate stop is always possible except with counter 2 for
ZMPC.
2 When operating mode ZMPC is used, gate control for counter 2 has no effect.
When operating mode ZMPC is used, counter 2 must operate with counting pulse evaluation
EVDI,
and counter 1 with
EVOT,
EVTT
or
EVFT.
The counting pulse evaluation can be selected as desired
for all other operating modes.
IP
281 Equipment Manual
@
.W17WIS
AG 1992, Order No: 8ES5
998-0KP21 5–9
R 11/92
Operating
Modes and Functions
6
6.1
6.2
6.2.1
6.2.2
6.3
6.3.1
6.3.2
6.3.3
6.3.4
6.3.5
6.3.6
6.4
6.4.1
6.4.2
6.4.3
6.4.4
6.4.5
6.5
6.5.1
6.5.1.1
6.5.1.2
6.5.1.3
6.5.2
6.5.3
6.6
6.6.1
6.6.2
6.6.3
6.6.4
6.6.5
6.7
6.7.1
6.7.2
6.7.3
6.7.4
6.7.5
6.7.6
6.8
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–1
CounterSettings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–2
Counting Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–2
Counting Pulse Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–4
Autonomous Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–7
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–7
ContinuousCounting (CONC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–8
One–Time Counting with Software Start
(OCSS)
. . . . . . . . . . . . . . .
.
. . . . . . . . . . 6–9
One–Time
Counting with Hardware Gate Start (OCHG) . . . . . . . . . . . . . . . . . . . . 6–11
Cyclic Counting with Software Start (CCSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–13
Cyclic Counting with HardwareGate Start
(CCHG)
. . . . . . . . . . . . . . . . . . . . . . . . 6–15
Combination Operating Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–17
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–
17
TransferringtheCountingValue
tothelnterruptRegister(TCAR) . . . . . . . . . . . . 6–18
TransferringtheCountingValue
tothe Load Register(TCLR) . . . . . . . . . . . . . . . 6–19
ConnectingtheZeroMarking Pulse to Counter2(ZMPC) . . . . . . . . . . . . . . . . . . 6–20
Starting Counter 2Whenthelnterrupt Value ofCounterl
lsReached
(SC2A)
. 6–21
Handling theCounters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–23
Loading the Counters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–23
Loading bytheS5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–23
Loading with theZero Pulseand
S~lnput
(Synchronization) . . . . . . . . . . . . . . 6–24
External ResetofaCounter* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–27
Controlling Both Counters Synchronously . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–28
Reading
theCounters
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–29
GateControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–30
Activatingthe
GateControl
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–31
Hardware Gate Control with Pulses
(GAPU)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–31
HardwareGateControlwith Level (GALE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–32
Software GateControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–33
EMERGENCYOFFGate Stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–33
Method ofOperation of the Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–34
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–34
Digital Output Switched
Off(DQNU)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–35
Digital
OutputActive
inthe Range Between the lnterruptValue and Underflow
(DQAU)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 6-36
Digital
OutputActiveinthe
Range Between thelnterruptValue andOverflow
(DQAO)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-37
Pulse on the Digital OutputWhen the
lnterruptValue
lsReached While
Counting
Up(DQIU)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–38
Pulse on the Digital OutputWhen the
lnterruptValue
lsReached While
Counting Down(DQID) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–39
Block Circuit Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–40
* Under development
lP281 EquipmentManual
@SiemensAG 1992, OrderNo: 6ES5998-0KP21 6–I
R 11/92 O~eratina
Modes and Functions
6
Operating Modes and Functions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . .
,................ ...........:..........:i:;:1::1,:,,:::::::::::::::,::::::::::::::::::::::::,:::::,:,:,:,::,::::::::::::::::::::,:::::::::,:,:,:,:::,:,:,,:,::::::;:::::::::::i:i:::::::;::::,::::::,::::,,,,,,,,,,,,.,.,.,.,.:.,.,.,.,.,.:.,.,.,.,.:.,.,.,.,.:.,.:.:.:.,.:.:.:.:-:.:.<%n,..,,
.x.,,..
.
. . . .
.............................................................................
. .
. . . . .. . . .
....
. .
..........
. .
.........
...........
.............
.. . . . .
.
.
. . .
.
..
...............................................................................'..................
.......
v....:<.:.:.:s555555555555<5<<<55<5<555555,::5::5<$::<::<5<<<<sss5<::
.......
....
.
. . .
.
.
.
.
.
..
...
.
..
..................................................
..
.
.
.
.....
............
.
..
.
..
.
..
.
...
.....
.
.
.
.
.......................................................... A12E...:.......
..
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
6.1
Introduction
The
1P
281 munter module offers great flexibility in adapting its functions to the requirements of
many different counting applications.
Counter settings must be performed specifying the counting mode and the type of counting pulse
acquisition
(+
section 6.2).
The autonomous operating mode allows the method of operation of each individual counter to be
set
(+
section 6.3).
The combination operating modes which
couple
the functions of both counters are particularly
useful for certain applications (-t section 6.4).
The counters can be
loaded
with defined values. Both counters can be controlled synchronously.
The counter values can be read out individually or simultaneously
(+
section 6.5).
The counters are equipped with a gate control which allows both hardware control by the digital
inputs and software control by the S5
(+
section 6.6).
Various methods of operation (i.e., the conditions under which the digital output activates) can be
set for the digital output of each counter
(+
section 6.7).
1P
281 Equipment Manual
@
Siemens AG 1992, Order
No:
6ES5
998-0KP21 6–1
Operating Modes and Functions
R 11/92
6.2
Counter Settings
6.2.1
Counting Mode
The counting mode
specifies the counting width and range
for each counter separately.
The basic setting for both counters after power–on is counting mode 1.
The counting mode for munter 1 is set in parameter register 1; the counting mode for counter
2
is set in parameter register
2. All counting modes are permitted for the autonomous operating
modes and the combination operating modes ZMPC and
SC2A.
The combination operating
modes TCAR and TCLR require that both counters operate in the same counting mode.
Counting mode 1
The counter has a counting width of 16 bits and operates in the positive
counting range listed below.
0000
to
FFFF (hexadecimal)
o
to +65,535
(decimal)
Parameter register 1/2
15
14
13 12 11 10 9 8 76543210
0 0
Counting mode 2
The counter has a counting
counting range listed below.
00000000 to
FFFF
FFFF
width of 32 bits and
[hexadecimal)
operates in the positive
o
to4,294 ,967,295 (decimal) “
Parameter register 1/2
15 14
13
12 11 10 9 876543210
0
1
Counting mode 3
The counter has a counting width of 16 bits and operates in the positive and
negative counting range listed below.
8000 to 7FFF
(hexadecimal)
–32,768 to +32,767
(decimal)
Parameter register 1/2
15 14 13 12 11 10 9 876543210
1
0
6–2
1P
281
Equipment
Menuel
@
.%WWMS
AG
1992,
Order No: 6ES5
996-0KP21
R 11/92
Operating Modes and Functions
Counting mode 4
The counter has a counting width of 32 bits and operates in the positive and
negative counting range listed below.
80000000 to
7FFF
FFFF (hexadecimal)
–2,1 47,483,648
to +2,147,483,647
(decimal)
Parameter register 1/2
15 14 13 12 11 10 9876543210
1 1
~
The counters use binary operation in all counting modes and can count up and
down in the ranges set.
The counting width also sets the width of the load, interrupt and counter value registers.
Overflow/underflow An overflow occurs when the upper counting range limit is exceeded while
counting
up.
Underflow occurs when the lower counting range limit is ex-
ceeded while counting down.
–1
+1
Counting
Upper Counting
Lower Counting
Mode
Range Limit Range Limit
1:
FFFE FFFF
0000 cool
2:
FFFF
FFFE
FFFF
FFFF
00000000 00000001
3:
7FFE 7FFF
8000
Sool
4:
7FFF
FFFE
7FFF
FFFF
8000
OOW
80000001
Hysteresis
When an encoder is “stationary”, oscillation of this encoder around the ac-
tual value can change the counter status.
When the counter stops on a range limit, this could cause
overflow/under-
flow to be triggered continuously. To avoid this, overflow and underflow are
provided with a fixed hysteresis of 1 (i.e., to trigger a new overflow/under-
flow, the value of the “upper counting range limit+ 1“/’’lower counting range
limit –1” must be reached respectively,
When oscillation around the counting range limits occurs, one overflow and
one underflow are triggered and the hysteresis then becomes active.
The hysteresis is reset when the counter or the interrupt register is loaded.
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
888-0KP21 6–3
Operating Modes and Functions R 11192
6.2.2 Counting Pulse Evaluation
The counters can operate with one–time, two-time or four–time pulse evaluation, or with direc-
tion evaluation.
The type of counting pulse evaluation is set for each counter individually in the parameter register.
One-time
evaluation
(EVOT)
Two-time
evaluation (lNTT’)
6–4
Upward counting pulses are generated with arising edge of A and
low
level
on B. Downward counting pulses are generated with
afalling
edge of A and
low level on
B.
Input A
I
Input
B
1
1
Upward
counting
pulsea
u u
Parameter register 1/2
EVOT
A counting pulse is generated for every rising and falling edge of A. The
direction of “counting depends on the level at input B.
Input A
Input B
Upward
counting
pulses
Downward
counting
pulses
u
u
u
I-Ill
Parameter register 1/2
15
14
13
12 11 10 9 8 7 6 543210
0
1
Evl-r
1P
281 Equipment Manual
@
sit?t_IR?nS
AG 1992, Order No: 6ES5 9s16-0KP21
R 11/92 Operating Modes and Functions
Four-time
A counting pulse is generated for every rising and falling edge of A and B.
evaluation
(EVFT)
The direction of counting depends on the level at inputs A and B.
Input A
[
1
Input B
I
Parameter register 1/2
15 14 13 12 11 10 9 876543210
1
0
EvFr
Direction
When counting with one counting input, the acquisition of counting pulses
evaluation
(EVDI)
occurs at
munting
input A. The positive edge causes a change in the
counting value (one–time evaluation). Counting input B is used to evaluate
the direction of counting.
Low level at input B: Counting up
High
level
at input B: Counting down
A
! Caution
The counting
value
can become invalid if the encoder is
oscillating around its actual value.
I
I I I I I
Input A
I
1
L
I
Input B
up
OOwn
Upward
;:::”’
~
:=%rd
~
pulses
Parameter register
1/2
15 14 13 12 11 10 9 876543210
1 1
EVDI
1P 281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 6–5
Operating Modes and Functions
R 11/92
When the 24 V encoder interface is used, the direction of counting can be
specified via the “inversion at counting input B“ bit in parameter register 1 /2,
without using input B*,
Parameter register 1/2
15 14 13 12 11 10 9876543210
1 1
T
Inversion at counting input B EVDI
O: Counter is counting up.
1: Counter is counting down.
Inversion of the
Input signals A and B can be inverted. The setting is made in the
input signals
respective parameter register as shown below.
Parameter register 1/2
15 14 13 12 11 10 9876543210
Inversion at counting input A
O: No inversion
1: Inversion
~
Inversion at counting input B
O: No inversion
1: Inversion
When incremental encoders with two pulse trains displaced by
~
90” are used, the direction of counting can be changed by the
inversion of
one
counting input,
without
having to rewire the
counting inputs.
A
!
Caution
If the setting (inversion/no inversion) is changed while the
counter is running, the level change can cause an extra count-
ing pulse to
be
generated.
To avoid this error, the counter must be loaded
after
parametri-
zation (with the value O if necessary).
6–6
IP
281 Equipment Manual
@
SiemenS
AG 1892, Order No: 6ES5 986-0KP21
R
11192
Operating Modes and Functions
6.3 Autonomous Operating Modes
6.3.1
Overview
The method of operation of a counter is specified
by
setting the autonomous operating mode.
There are five autonomous operating modes.
Continuous counting,
CONC
One–time counting with
soflware
gate start, OCSS
One–time counting with hardware gate start,
OCHG
Cyclic counting with software gate start, CCSS
Cyclic munting with hardware gate start,
CCHG
The autonomous operating modes can be combined as desired when the
1P
281 is operated with
two counters.
All counter settings (counting mode and counting pulse evaluation) can be selected as desired
with the autonomous operating modes.
Available Gate Controls
Operating Mode Gate Control
Hardware Gate Software Gate
CONC
Yea
No*
Ocss
No
Yes
Ccss
No
Yes
OCHG
Yes
No*
CCHG
Yes
No*
* The EMERGENCY OFF gate atop is always available
(+
section 6.6.5).
~
Hardware and software gate control do nottake effect until enabled in control
register 1/2 (GEN bit).
The following are permitted with all autonomous operating modes.
– All load capabilities
(+
section 6.5.1)
–All read capabilities
(+
section 6.5.3)
– All methods of operation of the digital outputs
(+
section 6.7)
– All interrupt lines
(+
section 4.4)
Behavior during overflow and underflow is described in section 6.2.1.
1P
281 Equipment Manual
@
%3WIS
AG 1992, Order No: 6ES5 998-0KP21 6–7
Operating Modes and Functions
R
11/92
6.3.2
Continuous Counting
(CONC)
Method of
The counter starts to count at the current counting value and counts
operation
continuously. After
RES=
the current counting value is O.
_-
——————
—___
//-
up
-..
/
Example:
Counting mode
1
‘;=WI’J
FFFF
‘]
\
/
----
Down
//’
--
--
————
—---
Gate control
Hardware gate via pulse
(+
section 6.6.2)
Hardware gate via level
(+
section 6.6.3)
– The gate function is disabled after RESET (i.e.,
the counter counts).
Gate control does not take effect until the gate function
(GEN
bit) is
enabled in control register 1/2.
Gate start:
PuLse
at digital input
STA
– High level at digital input
STA
Gate stop:
– Pulse at digital input
STO
– Low level at digital input
STA
~
Thecounter can beloadedwith avaluebythe S5beforetheope-
rating mode is set. The counter then begins counting starting
with this
value
(+
section 6.5.1.1).
Parameter
The operating mode and the type of gate control are set in parameter re–
register 1/2
gister
1 /2.
15
14
13
12 11 10 9 8 7 6543210
x x
o
T
GFS
= O: Hardware gate puke
CONC
GFS
= 1: Hardware gate level
x = Any
Control
The gate function is enabled/disabled with the control register using the
register 1/2
GEN
bit. An EMERGENCY OFF gate stop is available via the
GST
bit.
76543210
T
T
GEN
= O: Disable gate function
GEN
= 1: Enable gate function
GST
= 1: Close gate
6–8
IP
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
996-0KP21
R 11/92
Operating Modes and Functions
6.3.3 One-Time Counting with Software Start (OCSS)
Method of
When the software gate opens, the counter is loaded with the
value
operation
stored in the load register, and begins to count starting with this
value.
It is stopped by the following.
– Overflow of the counter
– Underflow of the counter
– The software gate closes.
The counter remains in stop status until the software gate is opened again.
Underflow Overflow
+-
Example:
1
-+
Counting mode 1
t
I
I
I
Oooo
Load value
FFFF
When a range limit is exceeded, the counter stops at this limit
(e.g., in counting mode 1, the counter stops at
OOOOH
when an un-
derflow occurs and at
FFFFH
when an overflow occurs).
Gate control
Software gate control with
GSS bit O in control register 1/2
Start:
GSS bit O:
1
stop:
GSS bit O: O
~
Thegate function must be enabled
incontroi
register 1/2.
Evaluation of bit 6 (overflow) and bit 7 (underflow) in status register 1/2 is
used to determine whether the counter has exceeded a range limit.
This operating mode cannot be set unless the gate function has been en-
abled by the
GEN
bit (bit 1 in control register 1/2). Otherwise the message
“illegal operating mode” is output
(IOM
in status register 3) and the ERROR
LED goes
on,
The settings must be performed in the sequence listed below.
1. Enable gate function
(GEN
in control register 1/2)
2. Set operating mode (parameter register 1/2)
Notes
1P
281 Equipment Manual
@
siefTIenS
AG
1992, Order No: 6ES5
888-0KP21 6–9
Operating Modes and Functions
R
11/92
Control
Control register 1/2 is used for the following purposes.
register
1/2
– Disable/enable the gate function with the
GEN
bit
– Software gate control with the
GSS
bit
– EMERGENCY OFF gate stop with the
GST
bit
76543210
I
TTT
GSS
= O
+1:
Open gate
GSS
= O: Close gate
GEN
= O: Disable gate function
GEN
= 1: Enable gate function
GST
= 1: Close gate
Parameter
The
OCSS
operating mode is set in parameter register 1/2.
register
112
15 14 13 12 11 10 9676543210
0
0
1
6 – 10
Ocss
1P
281 Equipment Manual
@
SieI_I_IenS
AG 1992, Order No: 6ES5
996-0KP21
R 11/92
Operating Modes and Functions
6.3.4 One-Time Counting with Hardware Gate Start (OCHG)
Method of
The counter operates as an up/down
munter.
When the hardware gate
operation
opens, the counter
is
loaded with the value stored
in
the load register, and
begins to count starting with this value.
It is stopped by the following.
– Overflow of the counter
– Underflow of the counter
– Closure of the hardware gate
The counter remains in stop status until the hardware gate is opened again.
Underflow Overflow
Example:
Countina
mode 1
‘-~-+
Gate control
Notes
,
Hardware aate via
mdse
(+
section 6.6.2)
I
1
I
I
0000
Load value FFFF
When a range limit is exceeded, the counter stops at this limit
(e.g., in counting mode 1, the counter stops at
OOOOH
when an un-
derflow occurs and at
FFFFH
when an overflow occurs).
Hardware
Gate
via
ievel
(~
section 6.6.3)’
Start:
Pulse
at digital input
STA
– High
level
at digital input
STA
stop:
– Pulse at digital input
STO
– Low level at digital input
STA
~
Thegate
function must be enabled
inthe
control register.
Evaluation of bit 6 (overflow) and bit 7 (underflow) in status register 1/2 is
used to determine whether the counter has exceeded a range limit.
This operating mode cannot be set unless the gate function has been en-
abled by the
GEN
bit (bit 1 in control register 1/2). Otherwise the message
“illegal operating mode” is output (IOM in status register 3) and the ERROR
LED goes
on.
The settings must be performed in the sequence listed below.
1, Enable gate function
(GEN
in control register 1/2)
2. Set operating mode (parameter register 1/2)
1P
281 Equipment Manual
@
%3YHIS
AG 1992, Order No: 6ES5
998-0KP21 6 – 11
Operating Modes and Functions
R 11/92
Control
The control register is used to enable/disable the gate function with the
register 1/2
GEN
bit. An EMERGENCY OFF gate stop is available with the
GST
bit.
76543210
1---1-
1
GEN
= O: Disable gate function
GEN
= 1: Enable gate function
GST
= 1: Close gate
Parameter
The operating mode and the type of gate control are set in parameter
register 1/2
register 1/2.
15 14 13 12 11
10
9 876543210
1 1
T
+
GFS
= O: Hardware gate pulse OCHG
GFS
= 1: Hardware gate level
6 – 12
[P
281 Equipment Manual
@
Si9m9nS
AG 1992, Order No: 6ES5
996-0KP21
R
11/92 Operating
Modes and Functions
6.3.5
Cyclic Counting with Software
Starl
(CCSS)
Method of
When the software gate opens, the counter is loaded with the load value,
operation
and begins to count starting with this value.
If a counting range limit is exceeded (overflow or underflow), the counter
is loaded again with the
load
value, and resumes counting starting with this
value.
The counter is stopped when the software gate closes.
Underflow Overflow
Example:
coun’ingmode’
“~-”
Oooo
Load
valua FFFF
The counter behaves as shown below when the load value corresponds to
a range limit. Example: counting mode 1, 16 bits, positive counting range
E
Load
Value
0000
FFFF
Direction of Counting
I
up
I
Down
I
(hunter counts Counter stops
at
“continuously”.
OrIOOH.
0000 to
FFFF+OOOO
tO FFFF-+
Counter stops at
Counter counts
FFFFH.
‘continuously”.
FFFF to
OOOO+FFFF
to
0000+
Gate control
Software gate
Start: GSS
bit O in control register 1/2: 1
stop:
GSS
bit O in control register 1/2: O
~
Thegate
function must have been enabled in control register 1/2.
Notes
This operating mode cannot be set unless the gate function has been en-
abled by the
GEN
bit (bit 1 in control register 1/2). Otherwise the IOM mes-
sage (“illegal operating mode”) is output and the ERROR LED goes on.
The settings must thus be performed in the sequence listed below.
1. Enable gate function
(GEN
in control register 1/2)
2. Set operating mode (parameter register 1/2)
1P
281 Equipment Manual
@
SieI_IIenS
AG 1992, Order No: 6ES5
996-0KP21 6 – 13
Operating Modes and Functions
R 11192
Control
Control register 1/2 is used for the following purposes.
register
1/2
– Disable/enable the gate function with the
GEN
bit
– Software gate control with the
GSS
bit
– EMERGENCY OFF gate stop with the
GST
bit
MHIYfl
-r-r-r
I
G& = O
+1:
Open gate
GSS
= O: Close gate
GEN
= O: Disable gate function
GEN
=
1:
Enable gate function
GST
= 1: Close gate
Parameter
The operating mode is set in parameter register 1/2.
register 1/2
15 14 13 12
11
10 9 876543210
1
0
1
6 – 14
Ccss
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21
R1l/92
Operating Modes and Functions
6.3.6
Cyclic Counting with Hardware Gate Start
(CCHG)
Method of
When the hardware gate opens, the counter is loaded with the load value,
operation
and begins to count starting with this value.
If a counting range limit is exceeded (overflow or underflow), the counter
is loaded again with the load value, and resumes counting starting with this
value.
The counter is stopped when the hardware gate closes.
Underflow Overflow
,
-
. - - - - - - - - - - - - - - .
~--
- - - - - - - -- ,
Example:
{
v
1
Counting mode 1 ‘ -
Gate control
Notes
0000
Load value FFFF
The counter behaves as shown below when the load value corresponds to
a range limit. Example: counting mode 1, 16 bits, positive counting range
Load Direction of Counting
Value
up
Down
0000
Counter counts
Counter stops at
“continuously”.
OOOOHi
0000 to
FFFF+OOOO
to
FFFF+
FFFF
(hunter stops at
Counter counts
FFFFH. “continuously”.
FFFF
to
OOOO+FFFF
to
0000+
Hardware gate via pulse
(+
section 6,6.2)
Hardware gate via level
(+
section 6.6.3)
Start:
– Pulse at digital input
STA
– High level at digital input
STA
stop:
– Pulse at digital input
STO
– Low
level
at digital input
STA
~
Thegatefunction must be enabled in control register 1/2.
This operating mode cannot be set unless the gate function has been en-
abled by the
GEN
bit (bit
1
in control register
1/2). Otherwise the IOM mes-
sage is output (“illegal operating mode in status register 3“) and the ERROR
LED goes on.
The
settings
must thus be performed in the sequence listed below.
1. Enable gate function
(GEN
in control register 1/2)
2. Set operating mode (parameter register 1/2)
IP
281 Equipment Manual
@
SieI?IenS
AG 1992, Order No: 6ES5
998-0KP21
6 – 15
Operating Modes and Functions
R
11192
Control
The control register is used for the following purposes.
register 1/2
– Disable/enable the gate function the the
GEN
bit
– EMERGENCY OFF gate stop with the
GST
bit
76543210
TT
I
GEN
= O: Disable gate function
GEN
= 1: Enable gate function
GST=
1: Close gate
Parameter The operating mode and the type of gate control are set in parameter
register 1/2
register 1/2.
15
14
13 12 11 10 9
8
76543210
111
T
CCHG
GFS
= O: Hardware gate pulse
GFS
= 1: Hardware gate level
6 – 16
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
996-0KP21
R 11/92
Operating Modes and Functions
6.4
Combination Operating Modes
6.4.1
Overview
Both munters are required for the combination operating modes. The ERROR LED goes on and
the
IOM
bit is set in status register 3 when the plug–in
submodule
is not installed.
The combination operating modes couple the functions of the counters.
In addition to the combination operating mode, the counting mode, the counting pulse evaluation
and the autonomous operating mode must beset for both counters. The permissible settings are
shown below.
Combination Counting Mode Autonomous Operating Mode
Operating Gate Control
Mode
Counter 1
Counter 2
Counter 1
Counter 2 Hardware
Software
Gate Gate
1
234
g$g
ggg
o~o
o~o
o
c)
o
Q
%~
(n
G
U)g
o
6
c)
00
0:
TCAR
1
+–––
*++
–++
Yes Yea
2
+––
+++
–++
3
+–
+++
–++
4
+
+++
–++
TCLR
1
+–––
++i-–++
Yes Yes
2
+––
+++
–++
3
——
+–
+++
–++
4
———
+
+++
–++
ZMPC
1
*+++++–++
Yesl
yesl
2
++++
+++–++
3
++++
+++–++
4
*+++++–++
SC2A
1
+++++++–++
Yes Yes
2
+++++++–++
3
+++++++–++
4
++++
+++
–++
+ Setting permitkd
– Setting not permitted: The ERROR LED goes on and the
IOM
bit is set in status register3.
Setting has no effect: The module does not operate in this setting. The ERROR LED doea not go on and the
IOM
bit is
not
se~
in status register 3.
+
No practical use
1 In ZMPC operating mode, gate control is only available for counter 1. Gate control for counter 2 has no effect.
When operating mode ZMPC is used, counter 2 must operate with counting pulse evaluation EVDI
and counter 1 with EVOT, EVTTor
EVFT
The counting pulse evaluation can be selected as desired
for all other operating modes.
1P
281 Equipment Manual
@
SiemenS
AG 1992, Order No: 6ES5
998-0KP21 6 – 17
ODeratina
Modes and Functions R 11/92
6.4.2
Transferring the Counting Value to the Interrupt Register
(TCAR)
Method of
operation
Gate control
Load counter
Read counter
Digital output
Interrupt
Special
notes
Parameter
register
The counting value of counter 1 is entered in the interrupt register of
counter 2 when internal gate 1
closes
(+
section 6.6).
The gate functions available are specified by setting the autonomous oper-
ating mode
(+
section 6.3) for the individual counters.
~
An EMERGENCYOFF gatestop (control
registerl)
doesnot
cause
the interrupt value to be transferred.
All load capabilities described in section 6.5.1 and allowed by the autono-
mous operating
mode
(+
section 6.3) are permitted.
All read capabilities are permitted
(+
section 6.5.3).
All methods of operation are permitted
(+
section 6.7).
All interrupt settings are permitted
(+
section 4.4).
Both counters must operate in the same counting mode. The
IOM
bit is set
in status register
3 and the ERROR LED goes on when two different count-
. . .
Ing
modes are Selected.
When operating mode
TCAR
is used, interrupt register 2 (counter 2)
cannot
be written by the S5.
The interrupt
value
transferred to counter 2 can be determined by reading
counter value register 1 after the internal gate of counter 1 has closed (bit O
in status register 1 =
O).
Operating mode
TCAR
is set in parameter register 2.
Parameter register 2
15 14 13 12 11 10 9 8 76543210
0
1
T
TCAR
6 – 18
1P
261 Equipment
Msnual
@
sk?M(?fIS
AG 1992, Order No: 6ES5
996-0KP21
R11192
Operating Modes and Functions
6.4.3 Transferring the Counting
Value
to the Load Register
(TCLR)
Method of
operation
Gate control
Load counter
Read counter
Digital output
Interrupt
Special
notes
Parameter
register
The value of counter 1 is entered in the load register of counter 2 when
internal gate 1 closes
(+
section 6.6).
The gate functions available are specified by
setting
the
autonomous
oper-
ating
mode
(+
section 6.3) for the individual counters.
~
An EMERGENCY OFFgate stop (control register 1) does not
cause the
load
value
to be transferred.
All load capabilities allowed by the autonomous operating mode set are
permitted.
All read capabilities are permitted
(+
section 6.5.3).
All methods of operation are permitted
(+
section 6.7).
All interrupt settings are permitted
(+
section 4.4).
Both counters must operate in the same counting mode. The IOM bit is set
in status register 3 and the ERROR LED goes on when two different
counting modes are selected.
When operating mode
TCLR
is used, load register 2 of counter 2 cannot be
written by the S5.
The load value transferred to counter 2 is determined by reading counter
value register 1 after the internal gate of counter 1 has closed (bit O in status
register 1 =
O).
Operating mode
TCLR
is set in parameter register 2.
Parameter register 2
15 14 13 12 fll 10 9876543210
1
0
T
TCLR
1P
281 Equipment
Msnusl
@
skXI’IWIS
AG 1992, Order No: 6ES5
888-0KP21
6 – 19
Operating Modes and Functions
R 11/92
6.4.4
Connecting the Zero Marking
Pulse
to Counter 2
(ZMPC)
Method of
The zero marking pulse of encoder 1 is the counting signal for counter 2
operation
(zero marking pulse counter). The direction of counting for counter 2 is
derived from counting signals A and B of counter 1.
Gate control
Counter 1: – Gate functions specified by the autonomous
operating mode set
– All gate functions described in section 6.6
Counter 2:
No gate functions available. The zero marking
pulses
are always transferred to counter 2 (even
when the gate of counter 1 is closed).
Load counter
Counter 1: All load capabilities are permitted
(+
section 6.5.1).
Counter 2: Only practical via the LOS bit in control register 2
Read counter
All read capabilities are permitted
(+
section 6.5.3).
Digital output
All methods of operation are permitted
(+
section
6,7),
Interrupt
Counter 1: All interrupt settings are permitted
(+
section 4.4).
Counter 2: The gate start and gate stop interrupts cannot be
used since counter 2 does not operate with gate
functions.
Special
notes
Parameter
register
The zero marking pulse counter (counter 2) evaluates the rising edge of
the zero marking pulse when counting up, and the falling edge when count-
ing down.
The ZMPC operating mode is
set in parameter register
2. The load value
should be “O”.
Parameter register 2
15
14
13
12 11 10 9 8 76543210
-+
+
+
‘-r
ZMPC
EVDI1
CCSS2
10 = Counting mode 32
or
11 = Counting mode
42
1 Failure to make these settings will cause the IOM message to occur in
status register
3 and the ERROR LED to go on.
2 Recommended setting
Underflow
Overlbw
Example for
. - --
counter 2:
‘:~:’
:::gngmodea
~
Loed
value O moo
Loed
value 7FFF
6 – 20
1P
281 Equipment Manual
@
sieI_fIenS
AG 1992, Order No: 6ES5
9W-0KP21
R11192
Operating Modes and Functions
6.4.5 Starting Counter2 When the Interrupt Value of Counter 1 Is Reached
(SC2A)
Method of
Counter 2 is started when both of the conditions below are met.
operation
Counter 1 reaches the interrupt value.
– The gate of counter 2 (gate 2) is open.
When counter 1 reaches the interrupt value, the gate function appropriate
to the autonomous operating mode set takes effect for counter 2.
Closing of gate 2 (also EMERGENCY OFF gate stop) stops counter 2 and
blocks gate function
2.
The gate function does not take effect again for
counter 2 until interrupt value 1 is reached again.
Example
Counter 1 reaches in-
terrupt value.
Herdwere gate 2 or
software gate 2
Internal gate 2
Counter 2
.-
Gate control
Counter 1: – Gate functions specified by the autonomous
operating mode set
– All gate functions described in section 6.6
Counter 2:
– Same as counter 1 except that the gate function
must be enabled by reaching the interrupt value
of counter 1
Load counter Counter 1:
All load capabilities described in section 6.5.1 are
permitted.
Counter 2:
Only practical via LOS bit in control register 2
Read counter
All read capabilities are permitted
(+
section 6.5.3).
Digital output
All methods of operation are permitted
(+
section 6.7).
Interrupt
All interrupt settings are permitted
(+
section 4.4).
Special
The interrupt value of counter 1 is provided with a hysteresis
of~l
notes
(+
section 4.6).
The interrupt at the gate start is also triggered when the interrupt value of
counter 1 is not yet reached (i.e., the interrupt is exclusively dependent on
the hardware or software gate).
1P
281 Equipment Manuel
@
siWIV3nS
AG 1992, Order No: 6ES5
998-0KP21 6 – 21
Operating Modes and Functions
R 11/92
Control
register
2
Parameter
register
6 – 22
Control register 2
76543210
GEN
= O: Gate function disabled
GEN
= 1: Gate function enabled
The
SC2A
operating mode is set in parameter register 1.
Parameter register
1
15 14 13 12 11 10 9 8 76543210
0
1
T
SC2A
1P
281 Equipment Manual
@
Siemens
AG 1992, Order No: 6ES5 996-0KP21
R 11/92
Operating Modes and Functions
6.5
Handling the Counters
6.5.1
Loading the Counters
The
1P
281 offers several ways to load the counters with a value stored in the load register.
– Loading by the S5
– Loading by zero pulse and SET input (synchronization)
– Loading by operating mode–related loading procedures
6.5.1.1 Loading by the S5
Method of
The counter can
be
loaded
with the load value by the S5 by using the
operation
O
+
1
edge of the LOS control bit in control register 1/2.
=
Loading can bepedormed whilethe counter is running.
Control registerl/2
765
43210
LOS = O: No effect
LOS = 1: Load counter
Confirmation of
The SPE bit is set in the applicable status register 1/2 during when the
loading
counter is loaded. The status bit is reset when the status register is read
out.
Status register 1/2
76543210
SPE
= 1: Counter was loaded.
SPE
= O: Counter was not loaded.
1P
281 Equipment Manual
@
SiemenS
AG 1992, Order No: 6ES5 998-0KP21 6 – 23
Operating Modes and Functions
R 11/92
6.5.1.2 Loading with the Zero Pulse and SET Input (Synchronization)
Method of
The respective counter is loaded with the value stored
in
the load
register
operation
when the zero pulse occurs. The synchronization can be performed either
at the 1st zero pulse or at every zero pulse.
Synchronization can be performed either while counting up or counting
down.
Upward counting synchronization is performed at the rising edge of the
zero pulse under the following conditions.
– Enabling has been performed by the
EUS
control bit.
– The external S13 signal is on high level.
– The counter is counting up.
Downward counting synchronization is performed at the failing edge
of the zero pulse
u;de;
the following conditions. --
Enabling has been performed by the EDS control bit.
– The external
S13
signal is on high level.
– The counter is counting down.
One–time,
counting upward,
A
synchronization
I
B
One–time,
counting downward,
synchronization
SET
UP/DOWN
EUS
N
1
1P
-
I
(
L
tt
Counter is loaded. Counter is not loaded.
UP/DOWN
J
-
Counter is loaded. Counter is not loaded.
6 – 24
1P
281 Equipment Manual
@
.%3’IW?S
AG 1992, Order No: 6ES5
996-0KP21
R 11/92
Operating Modes and Functions
Multiple,
counting upward,
synchronization
Multiple,
counting downward,
synchronization
Parameter
register
UP/DOWNl p
EUS
J
Ckmnter
is loaded. Counter
&
loaded.
UP/DOWN
J
b“’”
f=Ds
~
N~
tt
bunter
is loaded.
Counter is loaded.
The selection of one–time or multiple synchronization is made in parameter
register 1/2 for the respective counter.
Parameter register 1/2
15 14 13 12 11 10 9 8 76543210
O: One–time synchronization
1: Multiple synchronization
1P
281 Equipment Manual
@
.%YfNYW
AG 1992, Order No: 6ES5 988-0KP21 6 – 25
Operating Modes and Functions
R 11/92
Control register
The EUS bit must be set in control register 1 /2 for upward munting synchro-
nization and the EDS bit for downward counting synchronization.
Control register 1/2
76543210
One–time: The applicable bit must beset (O
--+1
edge required) before
the zero pulse occurs.
Multiple:
The applicable bit must beset during the entire
synchroniza–
tion time period.
SET input
Synchronization requires that the external
S=
signal be on high level dur-
ing synrchonization. The SET signal must occur before the synchronization
event.
Confirmation of
After synchronization has been performed, the
SPE
status bit (counter
synchronization
loaded) is set in status register 1/2 of the respective counter. This bit is reset
when the status register
k
read.
Status register 1/2
76543210
SPE
I: Counter was loaded.
SPE
O: Counter was not loaded
A
! Caution
The digital output must be switched off (EDQ bit in control
register 3) during synchronization. This prevents the counter
from activating the interrupt function and thus the digital output
during synchronization (loading).
6 – 26
1P
281 Equipment Manual
@
sif3Mf3nS
AG 1992, Order No: 6ES5
996-0KP21
R
11192 O~eratina
Modes and Functions
6.5.1.3 External Reset of a Counter*
* Under development
1P
281 Equipment Manual
@
siWTKJIM
AG 1992, Order No: 6ES5 888-0KP21 6 – 27
Operating Modes and Functions
R 11192
6.5.2 Controlling Both Counters Synchronously
Method of
The
1P
281 offers the capability of using the software gate to start and stop
operation both counters per software simultaneously. Both software gates are con-
trolled by control register 1.
Requirements
Synchronous mntrol of the counters requires that the two conditions
listed below be met.
– Operating mode OCSS or
CCSS
(any combination) must be set.
– The
SYC
bit must be set in control register 3.
Control register 3
76543210
SYC
= O:NO synchronous control
SYC
= l: Synchronous control of both counters
Start/stop of
Setting the
GSS
bit in control register 1 causes the software gates to be
the counter
opened for both counters simultaneously. When the
GSS
bit is reset, the
gates are also closed.
Control register 1
76543210
GSS
= 1: Gates will be opened.
GSS
= O: Gates will be closed.
The GSS bit in control register 2 has no function during synchronous con-
trol. The GEN 2 and
GST
2 bits retain their function.
6 – 28
1P
281 Equipment Manual
@
siOfWnS
AG 1892, Order No: 6ES5 996-0KP21
R 11/92
Operating Modes and Functions
6.5.3
Raeding the Counters
Counter 1 is read by reading counter value register 1
(CVR
1) and counter 2 by reading
CVR
2
(+section
3.5). The counters can be read both separately (asynchronously) and simultaneously
(synchronously). The basic setting is asynchronous.
Reading counters
The counters are read separately. The counter value in the respective
asynchronously
counter value register is retained during the first read access while the
read–out takes place.
The
SYR
synchronous bit in control register 3 must be “O” when the asyn–
chronous
read access takes place.
Control register 3
76543210
SYR
= O
Reading counters
Setting the
SYR
bit in control register 3 causes the counter values in both
1
and 2 synchro-
counter value registers to be retained simultaneously.
nously
Both counter value registers can then be read.
The contents of
CVR
1 and 2 are retained until the
SYR
bit is set to “O” again.
The following sequence must be adhered to for a synchronous read ac-
cess.
1. Set
SYR
bit to “1”,
2. Read first counter value register.
3. Read second counter value register.
4. Reset
SYR
bit to “O”.
~
If the
SYR
bit is not reset, thesame value will be read again during
the next read access.
Control register 3
76543210
SYR
=0: Current counter value
SYR
=1:
8oth
counter values frozen
BottI
counter values frozen
Current
SYR
J
cmunter
values
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
888-0KP21 6 – 29
Operating Modes and Functions R
11192
6.6 Gate Control
The counters are equipped with a gate control offering the following capabilities.
– Hardware gate control by level
– Hardware gate control by pulse
– Software gate control
The gate mntrol is activated in control register 1/2 for the respective counter. The internal gate
can be closed with an EMERGENCY OFF gate stop for all types of gate control.
Priorities of the
The following diagram shows the priorities of the gate control.
gate control
hcraasing priority
GAPU GALE
+
u
DI
STA
+
I
Hardware GST
/
SC2A
GEN
gate
DI
STO
~
II
+
A
~
EMER-
SaIaction Intern.
~
GENCY Gate
4
~
of
operating gate OFF
control
node
onloff
v
gate atop
m
‘-i
::a-
P1
1-d
e’
for operating mode
SC2A
Interrupt
Counting
pulse enable
for counter
status
register
Gate status
The status of the gate is indicated in status register
1
for counter 1 and sta-
tus register 2 for counter 2.
76543210
T
1: Gate open
O: Gate closed
6 – 30
1P
281 Equipment Manual
@ siWTN?fW AG 1992, Order No: 6ES5 996-0KP21
R 11/92
Operating Modes and Functions
6.6.1
Activating the Gate Control
After the startup of the module, the gate control is switched off (i.e., the gate is open and the count-
ing pulses are
fotwarded
to the counter).
The gate control is switched on/off in control register 1 for counter 1 and in control register 2 for
for counter 2.
Control register 1/2
76543210
GEN
= O: Gate function switched off
GEN
= 1: Gate function switched on
6.6.2 Hardware Gate Control with Pukes
(GAPU)
Method of
The gate is controlled by pulses on the
STA
and
STO
digital inputs.
operation
Gate start:
– Pulse on the
STA
input
Gate stop:
– Pulse on the
STO
input
Parameter
register
Dll
STA
D12
STO
The
GAPU
hardware gate control is parameterized in parameter register 1
for counter 1 and in parameter register 2 for counter 2.
Parameter register 1/2
15 14 13 12 11 10 9 876543210
+
I
GAPU
XXO:
CONC
011: OCHG
111: CCHG
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 6 – 31
Operating Modes and Functions
R 11/92
6.6.3 Hardware Gate Control with Level (GALE)
Method of
The gate control is performed via level on the
STA
digital input.
operation
Gate start:
– High level on the
STA
digital input
Gate stop: – Low level on the
STA
digital input
The
STO
digital input must
be
applied to
0.
DI
STA
:~
DI
STO
Internal gate
;;:
~
Parameter
register
6 – 32
The GALE gate control is parameterized in parameter register 1 for
coun–
ter 1 and in parameter register 2 for counter 2.
Parameter register 1/2
15 14 13 12 11 10 9 876543210
+
I
GALE
)0(0: CONC
011: OCHG
111:
CCHG
1P
281 Equipment Manual
@ sit3mEMIS AG 1992,
C)rder
No: 6ES5 996-0KP21
R 11/92 Operating Modes and Functions
6.6.4 Software Gate Control
Software gate control must be used when there are no hardware signals from the external system
to start and stop the counters, or when this information must first be obtained from the user pro-
gram in the
S5.
Method of
The software gate control is performed with the GSS bit in control
re–
operation
gister
1 /2.
Gate start:
– Setting the
GSS
bit
Gate stop:
– Resetting the
GSS
bit
Parameter
register Software gate control can only be used with operating modes
OCSS
and
CCSS. The software gate is activated by parameterizing one of these oper-
ating modes in parameter register 1/2.
Parameter register 1/2
15
14
13 12
11
10 9 8 7 6 5 43210
001
:
Ocss
101
:
Ccss
Control register
Control register 1/2
76543210
T
GSS
= O: Gate will be opened.
GSS
= 1: Gate will be closed.
6.6.5 EMERGENCY OFF Gate Stop
Method of
The hardware gate and software gate of the respective counter are
operation closed by setting the
GST
bit in control register 1/2.
The EMERGENCY OFF gate stop can be used with all operating modes (ex-
cept counter 2 in operating mode ZMPC) regardless of the type of gate con-
trol.
~
In operating modes TCLRand TCAR, the EMERGENCYOFF gate
stop does not cause the load or interrupt value to be transferred.
The EMERGENCY OFF gate stop also does not affect the digital
outputs.
Control register 1/2 76543210
T
GST
= 1: Gate will be closed.
GST
= O: No effect
1P
281 Equipment Manual
@
%3’?’WIS
AG 1992, Order No: 6ES5 ee8-oKP21 6 – 33
Operating Modes and Functions
R
11/92
6.7 Method of Operation of the Digital Outputs
6.7.1
Overview
Each counter is equipped with a digital output which can be used to directly trigger processes
external to the
1P
281
(+
section 1.4.3).
The method of
o~eration
(i.e., the conditions under which it is activated) of this
diaital
outtwt
can
be set separately for eachmunter in parameter register 1/2. Five possibilities are-available.
– Digital output switched off, DQNU
– Digital output active in the range between the interrupt value and underflow,
DQAU
– Digital output active in the range between the interrupt value and overflow,
DQAO
– Pulse on the digital output when the interrupt value is reached while counting upward,
DQIU
– Pulse on the digital output when the interrupt value is reached while counting downward,
DQID
Enabling the
The respective digital output is enabled by setting the
EDQ
1/2 bit.
digital outputs
The digital output is switched off (no
delay!)
by resetting this bit.
Caution
The digital output becomes externally active again when the
conditions for an active digital output are met (e.g., minimum
pulse still exists), and the digital output is enabled with
EDQ).
‘Qontema’)
~
EDQ
J
DQ(efiema,)
~
Control register 3
~
EDQ1
(counter 1)
EDQ2
(counter 2)
6 – 34
1P
281 Equipment Manual
@
.%31TNMS
AG 1992, Order No: 6ES5 988-0KP21
R 11/92
Operating Modes and Functions
Basic setting
After the startup of the module, both digital outputs are switched off. This
means that the following conditions exist.
DQNU
is selected.
– Bit
EDQ1
and bit
EDQ2
in control register 3 are “0”.
The status of a digital output (external digital output) is evaluated via the
DQS
bit in status register 1 or
2.
Status register
1/2
Status
indication
m
DQS
=0: Digital output inactive
DQS
=1: Digital output active
6.7.2
Digital Output Switched Off
(DQNU)
Method of
This setting switches the digital output off. This may be necessary to
operation
prevent accidental switching (e.g., during synchronization).
When this function is used, the digital output is switched to low level.
~
When
DQNLJ
is transferred while the digital output is active, the out-
Parameter
register 1/2
put remains active until the end of the minimum pulse.
If the output is to be disabled immediately, this can be
control bits
EDQ1
and
EDQ2
in control register 3.
15 14 13 12
11
10 9
8
76543210
0 0
0
done with
DQNU
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 6 – 35
O~eratina
Modes and Functions
R 11/92
6.7.3 Digital Output Active in the Range Between the Interrupt Value and Underflow
(DQAU)
Method of
operation
I
I
Underflow
Interrupt
vslue
Overflow
The digital output is switched active when the counting value is in the range
from interrupt value to underflow. The output remains active at Ieastforthe
duration of the pulse set with a plug–in jumper
(+
section 1.4.3 and sec-
tion 2.3).
Parameter 15 14 13 12 11 10 9 876543210
register 1/2
o
1
0
DQAU
Control register 3
The respective digital output must be enabled with the EDQ bit in control
register 3.
Control register 3
76543210
--F-Q
O =
Digitsl
outpul
switched off
1 =
Digitsl
output
ensbled
Hysteresis
6 – 36
The following hysteresises take effect on the limits of the active range.
Interrupt value: Hysteresis for interrupt value
(+
section 4.6)
Oveflow/underflow: Overflow/underflow hysteresis (-t section 6.2.1 )
1P
281 Equipment
Msnuel
@
SieIIIenS
AG 1992, Order No: 6ES5
966-0KP21
R
11/92
Operating Modes and Functions
6.7.4
Digital Output Active
in the Range Between the Interrupt Value and Overflow
(DQAO)
Method of
operation
Parameter
register 1/2
1
I
I
Underflow Interrupt value Overflow
The digital output is switched active when the counting value is in the range
from interrupt
value
to overflow. The output remains active at least for the
duration of the pulse set with a plug–in jumper
(+
section 2.3).
15 14 13 12 11 10 9 876543210
0 0
1
DQAO
Control register 3
The respective digital output must be enabled with the EDQ bit in control
register 3.
Control register 3
O = Digital output switched off
1 = Digital output enabled
Hysteresis
The following hysteresises take effect on the limits of the active range.
Interrupt value: Hysteresis for interrupt value
(+
section 4.6)
Oveflow/underflow: Overflow/underflow hysteresis
(+
section 6.2.1)
1P
281 Equipment Manual
@SiemensA(31992,
C)rder
No:6ES5998-0KP21 6 – 37
Operatina
Modes and Functions
R 11192
6.7.5
Pulse on the Digital Output When the Interrupt Value Is Reached While
Counting Up
(DQIU)
Method of
When the counting
value
reaches the interrupt
value
while counting up, the
operation
digital output is activated
for
a minimum pulse duration
which
can be set
(10
msec,
100
msec,
500
msec
+
section 2.3).
The interrupt value is provided with a hysteresis of
+1
(+
section 4.6).
A pulse is not triggered when the counting value reaches the interrupt
value
again while the digital output is still active (the time between the triggering
events is less than the minimum
puLse
duration set). Another pulse cannot
be triggered until the digital output is no longer active.
Parameter
register
15
14
13 12 11 10 9 876543210
0 0
+
DQIU
Control register 3
The respective digital output must be enabled with the EDQ bit in control
register 3.
Control register 3
O = Digital output switched off
1 = Digital output enabled
6 – 38
1P
281 Equipment Manual
@
siEM7W3flS
AG 1992, Order No: 6ES5 996-0KP21
R 11192
ODeratina
Modes and Functions
6.7.6 Pulse on the Digital Output When the Interrupt Value Is Reached While
Counting Down (DQID)
Method of
When the counting value reaches the interrupt value while counting down,
operation the digital output is activated for a minimum pulse duration (10
msec,
100
msec,
500
msec
-+
section 2.3),
The interrupt value is provided with a hysteresis
of+l
(+
section 4.6).
A pulse is not triggered when the counting value reaches the interrupt value
again while the digital output is still active (the time between the triggering
events is
less
than the minimum pulse duration
set).
Another pulse cannot
be triggered until the digital output is no longer active.
Parameter
register
15
14
13 12 11 10 9 8 7 6543210
0
1
+
DQID
Control register 3
The respective digital output must be enabled with the EDQ bit in control
reqister
3.
Control register 3
O = Digital output switched off
1
= Digital output enabled
1P
261 Equipment Manual
@
siWTW31W
AG 1992, Order No: 6ES5
998-0KP21 6 – 39
Operating Modes and Functions
R 11/92
6.8 Block Circuit Diagram
5
;
3........
-.-.2
J--
L
Figure 6.1: Block circuit
diagnm
of the
1P
281
6 – 40
1P
281 Equipment Manual
@
Siemens
AG
1992,
Order No: 6ES5
996-0KP21
R 11/92 Programming Example
7
Programming Example
7.1
General . . . . . . . . .
7.2
Startup . . . . . . . . .
7.3
Cyclic Program ,, ,
.
.
.
.
.
.
. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7.4
InterruptProcessing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.5
Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
lP281Equipment Msnual
@SiemensAG 1992.0rderNo:6ES5 998-0KP21
7–1
7–4
7–5
7–6
7–7
7–1
R11192 Programming Example
7.1
General
Use
Block
allocation
As an introduction working with the
1P
281, this section contains a program-
ming example which can be run on
PLC
S5–1
15U/S5–
115H.
(OB 20 and DX O must be added to the program when
PLC
S5–135U
or
S5–155U/S5–l 55H is used.)
You can use this program as the basis for your own program. The individual
blocks must then be adapted or supplemented to suit the application.
Block Function
OB 1
Cyclic program processing
OB 2 Interrupt-controlled program
proc8asing
for IRA
OB 21
Startup bahaviorfor manual power-on (STOP
–>
RUN)
OB 22
Startup behavior for return of voltage
FB 10 Interfaces for
inputa/outputs
FB 20 Startup FB for
1P
281
FB 21
Cyclic main program
FB 22
Interrupt program
DB 20 Working DB for
IP
281
1
IP
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
888-0KP21 7–1
Programming Example R
11/92
Device
One
of the programmable controllers listed
(+section
1.2)
configuration Programmer
(e,g,
PG 685, PG 750)
1P
281 counter module
– Encoder with two pulse
trainsl
displaced by 90°
– Digital input module (e.g.,6ES5420–4UA11)
– Digital output module (e.g.
6ES5
421 –4UA11)
– Simulator for digital inputs and outputs (e.g.,6ES5788–0LA12)
PLC
1
1
1
1 1
1
1
1
I
/
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
n---------
1
[
4
rrug[tull[lw
I
I
, ,
Innml
,
I I
I
nl
t
I
Iu
~
u
I
1
1
1 1
I
I
II
WI]
-
J
Simulator
1
The
enmder
must provide signals in the upward direction or no DQ activation and no
inter–
rupt will occur.
An input signal must be inverted
if the direction of rotation is wrong.
7–2
1P
281 Equipment Manual
@
siWfWIM
AG 1992, Order No:
6ES5
998-0KP21
R
11192
Programming Example
Hardware
Set basic address 128 and
select
interrupt line IRA on the
1P
281 counter
settings
module
(+
section 2.2).
When a 5.2 V encoder in accordance with RS 422 is used, the interface se-
lection and the reference potential must also be changed
(+
section 2.3).
Parameterization
The module operates in ZMPC combination mode (zero marking pulse
counter).
Counters
1
and 2 are parameterized as shown below
(+
section 3).
Counter 1
– Gate enable,
GEN
=
1
– Counting mode 3
– Counting pulse evaluation EVFT
– Autonomous operating mode
CCSS
– Counting inputs not inverted
– Digital output enabled
– Method of operation of the digital output,
DQAO
– Interrupt at overflow enabled
– Load value: –30000
– Interrupt value: –5000
Counter 2
– Gate enable,
GEN
=
1
– Counting mode 3
– Counting pulse evaluation EVDI
– Autonomous operating mode
CCSS
– Counting inputs not inverted
– Digital output enabled
– Method of operation of the digital output,
DQAU
– No interrupt enabled
– Load value: O
– Interrupt value: 50
Method of opera-
Counter 1 is loaded with load
value
–30000. When interrupt
value
–5000
tion of the
is reached, the digital output
is
activated (active until overflow). An interrupt
counters in the
is triggered at overflow.
program example
Counter 2 counts the zero marking pulse crossings. It is loaded with the
load
value
O if it reaches the value 100.
The digital output is active from the load value to the interrupt value.
The counting procedure is continually repeated.
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 7–3
Programming Example
R 11/92
7.2 Startup
The module must be parameterized during startup, The module is not equipped with a buffer.
Since the
parameterization
is lost when a power failure occurs or the module is switched off, the
parameterization
data must be transferred to the
1P
281 each time a new start or restart is per-
formed.
OB 21 OB 21 is processed during a
manual
new start (PG selection and operating
mode switch
STOP+
RUN). It calls startup block FB 20 and working
(para-
metrization) data block DB 20.
OB 22
FB 20
DB 20
7–4
OB 22 is processed when a restart is performed due to return of voltage
(power-on). It is identical to OB 21.
The following is performed in the startup
FB.
– The register addresses (basic address +0 to basic address +7) are cal-
culated and stored in DB 20 to simplify addressing in the cyclic program.
– The parameter register and control register aretransferred from DB20to
the
1P
281.
– The
parameterization
bit is set.
Keep the following in mind.
– Control register 3 must be transferred after
parameterization
(set
para-
metrization
bit).
– When setting the autonomous operating modes (except
CONC),
the
GEN bit must first
be
set in control register 1/2 for the gate enable, and
then the parameter register. Otherwise the ERROR LED goes on.
– When CPU 944A/B is used, the correct addressing sequence must be
adhered to.
DB 20 is used as
parameterization
DB and working DB. The addresses
(128 +0 to 128 +7) calculated during startup are entered in DW O to DW 7.
In addition, the register contents are stored for the startup in DB 20
(DW
8
to DW 12),
All other register accesses (read and write accesses) are also performed
via this DB
(DW
13 to
DW
30).
DW31
isthestorage
Iocation
forsavingthe
register set address during read
and write accesses. The interrupt program accesses this location to update
the register set selection again after an interrupt is processed.
1P
281 Equipment Manual
@
Siemens
AG
1992, orijer
No:
6ES5
9gs-0Kp21
R 11/92 Programming Example
7.3 Cyclic Program
Function blocks FB 21 and FB 10, and working data block DB 20 are called by OB 1 in the cyclic
program.
FB 21 FB 21 contains the main cyclic program for the
1P
281.
The structure of the segments makes it easy to handle the individual pro-
gram parts (e.g., when setting up your program).
During cyclic operation, the programmed functions are selected one after
another. The individual functions (load, read write, etc.) can be made de-
pendent (software links and digital input signals) on certain events.
Keep the following in mind when programming.
– When the counter
value
registers are read, the interrupts must be dis-
abled with 1A before the register set is called, and enabled again with
RA
after the read access.
– The selected register set must be saved for all other (not
interrupt–dis-
abled)
accesses.
R
must be stored in DW 31 after selection.
– If control
register3
is to be transferred, a check in status
register3
must
be made before to determine whether the
parameterization
bit is still set
to”1”
(parameterization
exists), The
parameterization
bit must then be
setto 1 with the OW instruction. If the
parameterization
bit in status regis-
ter 3 is set to “O”, a new start or restart must be performed to restore the
parameterization.
DB 20
FB 10
All accesses (read and write) are performed via working data block DB 20.
FB 10 provides the allocation to the inputs and outputs. It is only required
when a simulator is used.
1P
281 Equipment
Msnusl
@
siemenS
AG
1992, Order No: 6ES5
998-0KP21 7–5
Programming Example
R 11/92
7.4 Interrupt Processing
OB 2 is called when an interrupt is triggered via
IRA.
OB 2 calls
funotion
block FB 22 and working
data block DB 20.
FB 22
The interrupt information register is read in the interrupt program, and at the
end of interrupt processing, the register set present before the interrupt arri-
ved is restored again, (The register set address is stored in DW 31 of
DB 20.)
The interrupts must be disabled with 1A while the
IIR
is being read, and then
enabled again with RA.
7–6
1P
281 Equipment Manual
@
%31TN311S
AG 1882, Order No: 6ES5
996-0KP21
R
11192
Programming Example
7.5 Program
OB
1
SEGMENT 1
0000
Oooo :JU
FB 21
0002 NAME
:CYCLIC
0004
DBNR
: DB 20
0006
0008
:JU
FB 10
OOOA
NAME :1/Q
Oooc
OOOE
:BE
OB
2
SEGMENT 1
0000
Oooo :JU
FB 22
0001 NAME
:INTERUPT
0002
DBNR
: DB 20
0003
:BE
OB 21
SEGMENT 1
0000
Oooo :JU
FB 20
0001 NAME :START–UP
0002
ADR
KF
+128
0003
DBNR
!
DB 20
0004
:BE
OB 22
SEGMENT 1
0000
Oooo :JU
FB 20
0001 NAME :START-UP
0002
ADR
:
KF
+128
0003
DBNR
:
DB
20
0004
:BE
FB
10
SEGMENT 1
NAME : l/Q
OOOA
Oooc
OOOE
0010
0012
0014
0016
0018
oOIA
Oolc
OOIE
0020
0022
0024
:C
DB
20
:L
:T
%
:4
:L
DR 25
:T
QB
9
:L
:T
::
:
:L
IB
4
:T
DR
8
:L
IB
5
:T
DR 9
:L
IB
6
:T
DR
10
:BE
B:
PROBEIST.S5D
CYCLIC PROGRAM
B: STS5D
INTERRUPT OB FOR IRA
B:
PROBEISTS5D
B:
PROBEISTS5D
B:
PROBEISTS5D
INTERFACE TO INPUT/OUTPUTS
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21
LEN=13
Call FB with cyclic program
Working data block
Interface to inputs/outputs
LEN=9
Call FB with interrupt program
Working data block
Call startup FB
Basic address
Working data block
Call startup FB
Basic address
Working data block
Working data block
Status register
1
Status register 2
Status register 3
Control register 1
Control register 2
Control register 3
LEN=1O
LEN=1O
LEN=25
7–7
Programming Example
R
11192
FB
20
SEGMENT 1
NAME :START–UP
Decl
:ADR
Dad
:DBNR
OOOB
:DO
Oooc
:L
OOOE
:T
OOOF
:LW
0010
:T
7–8
B:
PROBEISTS5D
LEN=77
Oooo
STARTUP FB FOR
1P
281
I/Q/D/B/T/C: D
KM/KH/lCY/KS/KF/KT/KC/KG:
KF
l/Q/D/Bn/C: B
=DBNR
KH 0000
FW20
=ADR
FW22
0011
MOO1
:L FW 22
0012
:DO
FW 20
0013
0014
0015
0016
0017
0018
0019
OOIA
O(I1B
OOID
OOIE
O(XF
0020
0022
0023
0024
0025
0026
0027
0028
0029
002/4
O02B
O02C
O02D
o(32E
o02F
Oo30
0031
0033
0034
0035
0036
0037
(XX38
Oo3A
O03B
O(I3D
O03E
O03F
0040
0041
0043
0044
0045
0046
0047
:T
DW O
:L FW 20
:1
1
:T FW 20
:L
FW
22
:1
:T FW
h
:TAK
:L KF +7
:<=F
:JC
=MOO1
:L KH 0000
:DO
DW O
:T PY O
;L
DR
8
:DO
DW 1
:T PY O
:L
DR
9
:DO
DW 2
:T PY O
:L DL 11
:DO
DW 4
:T PY O
:L
DR
11
:DO
DW 5
:T
PY O
:L
:DO
%
42
:T PY O
:L
DR
12
:DO
DW 7
:T PY O
:L
KH 0000
:DO
DW O
:T PY O
:L
DW 10
:L
KM 0000000000000100
:Ow
:DO
DW 3
:T PY O
Open working
DB
Calculate
addreasas
and
store in working DB
Select register set O
Basic address (byte +0)
Write control register 1
Address byte +1
Write control register 2
Address byte +2
Write parameter register 1
Address byte +4
Address byte +5
Write parameter register 2
Address byte +6
Address byte +7
Select register set O
Basic address (byte +0)
Set “parametrization” bit in
control register 3
Write control register 2
Address byte +3
IP
281 Equipment Manual
@
sif3Mt3nS
AG 1992, Order No: 6ES5
998-0KP21
Rll192
Programming Example
B:
PROBEIST.S5D
LEN=208
Sheet 1
MAIN CYCLIC PROGRAM OF THE
1P
281
FB 21
SEGMENT 1
Oow
Name
:CYCLIC
Dad
:DBNR
IIQIDIBITIC:
B
0008
SEGMENT2
0009
OOOA
OCOB
OOOD
OOOE
oOOF
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
OOIA
001 B
Oolc
OOID
001 E
001 F
0020
0021
0022
0023
0024
0025
0026
0027
W328
W29
O02A
SEGMENT 3
O02B
O02D
O02E
O02F
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
O03A
SEGMENT4
O03B
O03D
O03E
O03F
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
.***
READ COUNTER VALUE REGISTER Open working DB
Disable interrupts
Select register sat 1
Basic address (byte +0)
0008
=DBNR
:DO
:IA
:L
:DO
KH
0001
DW O
PYo
:T
:DO
DW O
PYo
DL 27
DW 1
PYo
DR 27
DW 2
PYo
DL 28
DW 3
PYo
DR 28
Read counter value register
1
Address byte +0 (reg. byte 3)
Address byte +1 (reg. byte 2)
:L
:T
:DO
:L
:T
:DO
:L
:T
:DO
:L
:T
Address byte +2 (reg. byte 1)
Address byte +3 (reg. byte O)
Read counter value register 2
Address byte +4 (reg. byte 3)
:DO
:L
:T
:DO
:L
:T
:DO
:L
:T
:DO
:L
:T
:RA
.***
DW 4
PYo
DL 28
DW 5
PYo
DR 28
DW 6
PYo
DL 30
DW 7
PY o
DR 30
Address byte +5 (reg. byte 2)
Address byte +6 (reg. byte 1)
Address byte +7 (reg. byte O)
Enable interrupts
READ STATUS REGISTERS 1,2,3
Select register set O
Store register set
Basic address (byte +0)
:L
:T
KH
(kOO
DR 31
DW O
PYo
:DO
:T
:DO
:L
:T
:DO
:L
:T
:DO
:L
:T
.***
DW 2
PYo
DR 24
DW 3
PYo
DR 25
DW 4
PYo
DR
26
Read status register
1
Address byte +2
Read status register 2
Address byte +3
Read status register 3
Address byte +4
WRITE CONTROL REGISTER
Select register sat O
Store register set
Basic address (byte +0)
KH
DR
DW
PY
O03B
0000
31
0
0
:L
:T
:DO
:T
:L
:DO
:T
:L
:DO
:T
:DO
:L
Write control register
1
Address byte +1
DR
DW
PY
DR
DW
PY
8
1
0
9
2
0
Write control register 2
Address byte +2
DW
PY
4
0
Read status register 3
Address byte
+4
7–9
1P
281 Equipment Manual
@
Siemens
AG 1992, Order No: 6ES5
988-0KP21
Programming
Exernple
R
11/92
FB 21
O04A
O04B
O04D
O04E
O04F
0050
CONT
0051
0053
0054
0055
0056
0057
SEGMENT5
0056
005A
O05B
W5C
O05D
O05E
O05F
0061
0062
0064
0066
0067
0069
O06B
O06D
O06E
O06F
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
O07A
O07B
oo7c
O07D
SEGMENT 6
O07E
Oo60
0061
0062
0063
0064
0065
0066
0067
0069
O06B
Oo6c
O06D
O06E
O06F
Oo80
0091
0093
0094
0085
B:
PROBEISTS5D
LEN=206
Shaat
2
:T
DR 26
:TB D 26.2
Module still parameterizad?
:JC
=CONT
If yes: continue. If no:
:STS
Stop! New atart required
;L
DW 10
Set “parameterization” bit
:L
KM 0000000000000100
in control
raaister
3
:Ow
:DO DW
:T PY
:***
:L KH
:T DR
:DO DW
:T PY
:L DL
:DO DW
:T PY
:L
DR
:DO DW
:T PY
:L
DL
:DO DW
:T PY
:L DR
:DO DW
:T PY
;L
KH
:T DR
:DO DW
:T
PY
:L
:DO
:T
:L
:DO
:T
:L
:DO
:T
:L
:DO
:T
.***
DL
DW
E:
DW
PY
DL
DW
PY
DR
DW
PY
:L KH
:T
DR
:DO DW
:T PY
;L
DL
:DO DW
:T PY
:L DR
:DO DW
:T PY
:L
DL
:DO DW
:T PY
:L DR
:DO DW
:T PY
:L KH
:T
DR
:DO DW
:T
PY
3
0
0058
Ooo1
31
0
0
15
4
0
15
5
0
16
6
0
16
7
0
0003
31
0
0
17
4
0
17
5
0
18
6
0
18
7
0
007E
0002
31
0
0
19
4
0
19
5
0
20
6
0
20
7
0
0004
31
0
0
Write control register 3
Address byte +3
WRITE LOAD REGISTER
Select register set 1
Store register set
Basic address (byte +0)
Write load register 1
Address byte
+4
(rag. byte 3)
Address byte +5
(rag.
byte 2)
Address byte +6 (reg. byte 1)
Address byte +7 (rag. byte O)
Select register set 3
Store register aat
Basic address (byte
+0)
Write load register 2
Address byte +4 (reg. byte 3)
Address byte +5 (rag. byte 2)
Address byte +6 (rag. byte 1)
Address byte +7 (reg. byte O)
WRITE INTERRUPT REGISTER
Select register set 2
Store register aat
Basic addreas (byte
+0)
Write interrupt register 1
Address byte +4 (reg. byte 3)
Address byte +5 (reg. byte 2)
Address byte +6 (reg. byte 1)
Address byte +7 (reg. byte O)
Select register set 4
Store register set
Basic address (byte
+0)
7 – 10
1P
281 Equipment Manuel
@
siWI’IWIS
AG 1992, Order No: 6ES5
996-0KP21
R 11/92 Programming Example
FB 21
0086
0097
;L
DL
0098
:DO
DW
0089 :T PY
008A
:L
DR
O09B
:DO
DW
Oo9c
:T PY
O09D
:L
DL
O09E
O09F
:DO
DW
:T PY
OOAO
:L DR
OOA1
:DO
DW
OOA2
:T PY
OOA3
.***
SEGMENT 7
OOA4
:L
KH
OOA6
:T
DR
OOA7
:DO
DW
OOA6
:T PY
OOA9
OOAA
:L DR
OOAB
:DO
DW
OOAC
:T PY
OOAD
OOAE
:L
KH
OOBO
:T
DR
oOB1
:DO
DW
OOB2
:T PY
00s3
OOB4
:L
DR
OOB5
:DO
DW
WB6
:T PY
OOB7
.***
SEGMENT8
0086
OOB9
OOBB
OOBC
OOBD
OOBF
ooco
Oocl
OOC2
:L DW
:L KF
:<F
:BEC
:L
KH
:T DR
:DO
DW
:T
PY
21
4
0
21
5
0
22
6
0
22
7
0
OOA4
0001
31
0
0
13
3
0
0003
31
0
0
14
3
0
OOB6
30
+100
0000
31
0
0
B: PROBEIST.S5D
LEN=206
Sheet 3
Write intern@ register
2
Address byte +4 (reg. byte 3)
Address byte +5 (reg. byte 2)
Address byte +6 (reg. byte 1)
Address byte +7 (reg. byte O)
WRITE INTERRUPT ENABLE REGISTER
Select register set 1
Store register set
Basic address (byte +0)
Write
IR
enable register 1
Address byte +3
Select register set 3
Store register set
Basic address (byte +0)
Write
IR
enable register 2
Address byte +3
LOAD COUNTER 2 AT CERTAIN VALUE
Load counter value 2
Select
register eat O
Store register set
Baeic
address (byte +0)
OOC3
:L
DR 9
OOC4
:L
KM 0000000000100000
Load counter 2 (once)
00(%
:Ow
OOC7
:DO
DW 2 Address
bvte
+2
OOC6
:T PY O
OOC9
.***
SEGMENT9
OOCA
OOCA
:BE
1P
281 Equipment Manuel
@
SiemenS
AG 1992, Order No: 6ES5
888-0KP21
7 –
11
Programming Example R 11/92
FB 22
SEGMENT 1
NAME
:INTERUPT
Decl :DBNR
OooB
.***
SEGMENT2
:DO
OOOA
:IA
OOOB
:L
OOOD
:DO
OOOE
:T
OOOF
0010
:DO
0011
:L
0012
:T
0013
:DO
0014
:L
0015
:T
0016
:RA
0017 .***
SEGMENT 3
0018
0019
OOIA
oOIB
DB 20
o:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
Oooo
I/Q/D/B/T/C: B
o009
=DBNR
KH
0000
DW O
PY o
DW O
PY o
DL 23
DW 1
PY o
DR
23
0018
:L
DR
31
:DO
DW O
:T PY O
:BE
KF = +00000;
KF = +00000;
KF = +00000;
KF = +00000;
KF = +00000;
KF = +00000;
KF = +00000;
KF = +00000;
KM = 0000000000000010;
KM = 0000000000000010;
KM = 0000000000000111;
KM = 0001000001010110;
KM = 00100001 11110110;
KM = 0000000000000100;
KM =
(XXXXMOOOOQOOOOO;
KH = 0000;
KF = –30000;
KH = 0000;
KF = +00000;
KH = 0000;
KF = –05000;
KH = 0000;
KF = +00050;
KM = 0000000000000000;
KM = 0000000000000000;
KM = 0000000000000000;
KM = 0000000000000000;
KH = 0000;
KF = +00000;
KH = 0000;
KF = +00000;
KH = 0000;
KH = 0000;
KH = 0000;
KH = 0000;
KH = 0000;
KH = 0000;
KH =
OOOO;
KH = 0000;
KH = 0000;
KH = 0000;
B:
PROBEISTS5D
LEN=33
INTERRUPT PROCESSING
INTERRUPT INFORMATION REGISTER
Open working DB
Disable interrupts
Select register set O
Basic addreea (byte +0)
Read
IR
information register
Address byte +0 (counter 2)
Address byte +1 (counter 1)
Enable interrupts
LOAD STORED set
Load register set (restore)
Basic address (byte O)
B:
PROBEISTS5D
LEN=46
WORKING DB FOR
1P
281 Byte +0 Basic address
Byte
+1
Addresses are calculated
Byte +2 during startup and
Byte +3 stored in DW O to DW 7
Byte +4
Byte +5
Byte +6
Byte
+7
(DR
8) Control register 1
(DR
9) Control register2
(DR
10) Control
register3
Parameter register 1
Parameter register 2
(DR
13)
IR
enable register 1
(DR
14)
IR
enable register 2
Load register 1 Bytes 3 & 2
Load register 1 Bytes 1
&
O
Load register 2
Bytes 3
&
2
Load register 2 Bytes 1 & O
Interrupt register 1
Bytes 3 & 2
Interrupt register 1
Bytes
1
& O
Interrupt register 2
Bytes 3 & 2
Interrupt register 2 Bytes 1
&
O
IR
Information register (2 & 1)
(DR
24) Status register 1
(DR
25) Status register 2
(DR
26) Status register 3
Counter value reg. 1 Bytes 3 & 2
Counter value reg. 1 Bytes 1 & O
Counter value reg. 2 Bytes 3 & 2
Counter value reg. 2 Bytes 1 & O
Store register set
Use as desired
Use as desired
Use as desired
Uee as desired
Use as desired
Use as desired
Use as desired
Use as desired
Use as desired
7
– 12
IP
281 Equipment Manual
@
siefIIenS
AG 1992, order No: 6ES5 988-0KP21
R11192
Technical Specifications
8
Technical Specifications
8.1
8.1.1
8.1.2
8.1.3
8.2
8.3
8.4
8.5
8.6
8.6.1
8.6.2
8.6.3
8.6.4
8.7
8.7.1
8.7.2
8.7.3
8.7.4
8.7.5
Counter Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–1
IncrementalEncoderInputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–1
Digital Inputs
. . . . . .
.
,,.”.,,.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8–2
Digital Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . . . . . . . . . . . . . . . 8–2
Counting Frequencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–2
PowerSupply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–3
Environmental Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8–4
lnWhich
Slots CantheCounter Module Be Operated? . . . . . . . . . . . . . . . . . . . . . 8–5
Connection
Cablesfor
incremental Encoders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–6
ConnectionCableforSiemens
incremental Encoder6FC9320
(RS422with 5.2 VSupply Via IP281) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
ConnectionCablefor incremental Encoder inAccordancewith RS422
(5
VSignals;
5.2 VSupply Via IP281) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-7
Connection Cable for Incremental Encoder in Accordance with
RS
422
(5
VSignals;
24 VSupply Via IP281) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
Connection Cable for 24 V Incremental Encoder
(24
VSignals;
24 VSupply Via IP281) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-9
Requirements on the Input Signals , . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 – 10
Pulse Widths of the Encoder Inputs. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 – 10
Time Relationships Between Counting Signals A and B/A*and B* . . . . . . . . . . 8 – 11
Timetables for Encoder Inputs and Digital Inputs . . . . . . . . . . . . . . . . . . . . . . . . . 8 –
11
Time Relationships for HWGate Control ~ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 – 12
Time Relationships for Load Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 – 13
1P
281 Equipment
Msnusl
@
Siernens
AG
1992, Order No:6ES5998-0KP21 8–1
R11192 Technical Specifications
8
Technical Specifications
8.1
Counter Inputs
I
@erview 01 Counters I and 2
Number of incremental encoder
inputa
Number of
STA
digital inputs
Number of
STO
digital inputs
Number of
S13
digital inputs
Potential isolation
Satwaan
encoder
inputa
and digital inputs
Setwean
input and output
Satwaan
input and S5 bus
8.1.1
Incremental Encoder Inputs
per counter
par counter
par counter
par counter
Yes
Yes
Yes
24 V Encoder Inputs
Nominal input voltage
Input voltage for signal “O”
Input voltage for signal “1”
Signal status for unconnected
inputa
Input current (M–switching encoder)l O V to 13 V to 30 V
Input current (P–switching encoder)l O V to 13 V to 30 V
Input current (MP–switching
encmder)l
O V to 13 V to 30 V
RS
422 Encoder
Inputa
Maximum differential voltage
Minimum differential voltage
Common mode voltage
Line termination
Potential isolation
– Between 2 differential
inputa
– Between 2 differential inputs and S5 bus
Satween
differential input, digital output and digital input
Maximum line length for maximum frequency and
wire break monitor switched on
1 Required: Encoder type described in section 1.4.1.1
24 V
–3 v to 4.5 v
13 Vto 30 v
Low
–11 to –4 to 4 MA
O to 7.5 to 26
mA
O to 7.5 to 26
mA
5.5 v
1.4 v
Maximum
*7
V
150
n
No
No
Yes
100 m at 0.2 mm
2
wire cross section
1P
281 Equipment Manual
@
SiOmOnS
AG 1992, Order No: 6ES5
998-0KP21 8–1
Technical Specifications
R
11192
8.1.2
Digital Inputs
Nominal input voltage 24 V
Input voltage for signal “O”
input voltage for signal “1”
Signal status for unconnected inputs
Input resistance
Input current for signal “1” (nominal voltage 24
Vl
Input current (13 V to 30
V)
–3 Vto 4.5 v
13
v to 30 v
Low
1.8
K~
(average)
12
mA
(average)
2.5 MA to 15
mA
8.1.3 Digital Outputs
Number of outputs
Output voltage for signal status “1”
Output voltage for signal status “O”
Nominal output current
Maximum output current
Maximum delay time, switch on (low
–>
high)
Maximum delay time, switch off ( high
–>
low)
Umit
frequency
Short circuit proof
Overload protection
Pulse duration, can be set
Enable digital
outputa*
Potential isolation
– Between 2 digital
outputa
– Between digital output and S5 bus,
digital input and 5.2 V encoder supply
Free wheeling diode for inductive loads (relay) required
(circui~
+
section 1.4.3)
1 per counter
>U24veti –2.5 V
<3V
500
mA
600
mA
120
peec
120
psec
~
50 Hz
Yes
Yes
10
msedltlrl
msec/500 msec
S5 BASP signal = O and
U5Vnt
within the tolerance range
No
Yes
*
~
BASPfunction
can bewitched off (+section 1.4.3).
8.2
Counting Frequencies
I
lhis
information appiiesto
aii
counting and
digitai
inputs.
I
Maximum counting frequency 250 kHz
8–2
iP
281 Equipment Manual
@
SieMenS
AG 1992, Order No: 6ES5
996-0KP21
R 11/92
Technical Specifications
8.3 Power Supply
5 V Supply Voltage
vfa
Basic Plug Connector Xl
Nominal value
5V
Lower limit
4.65 v
Upper limit 5.25 V
Maximum current consumption
600
mA
24 V Supply Voltage via Front Plug Connector X3
Static limits (including ripple)
Lower limit
20V
Upper limit
3(3V
Dynamic limits
– Lower limit
value 14.25 V
Duration
5
msec
Recovery time
10 sac
– Upper limit
Value
35V
Duration
500
msec
Recovery time 50 sac
Ripple
~
3.6
V~
Maximum current consumption (depends on the output circuitry) 2.5 A
Overcurrent protection
Yes
Voltage monitoring No
5.2 V Encoder Supply (Option)
Nominal output voltage 5.2 V
Average output voltage at O A load current 5.20 V
Average output voltage at 350
mA
load current
5.15 v
Average output voltage at 700
mA
load current
5.10 v
Maximum output current
700
mA
(350
mAkounter)
Short circuit proof
Yes
Potential isolation
Yes: from
Dl,
DQ
end
encoder supply
24 V Encoder Supply
Nominal output voltage 24 V
Minimum output voltage
17 v
Maximum output voltage
30V
Maximum output current
300
mA
Short circuit proof
Yes
Potential isolation
Yes: from
Dl,
S5 bus and
encoder supply
1P
281 Equipment Manual
@
.%31WIIS
AG 1992, Order No: 6ES5 898-0KP21 8–3
Technical Specifications
R 11/92
8.4 Environmental Requirements
Climatic Requirement
Temperature
– Operation
o“ c
to 55”
c
Temperature change 10 K/h
Condensation not permitted
– Storage and transportation (in
originai
packaging)
–40” c
to
70” c
Temperature change 20 K/h
Air pressure
– Operation
Minimum 660
kPa
(= 1500 m. a,s. I.)
Maximum 1060
kPa
Over this: Limited cooling capacity
– Storage and transportation (in original packaging)
Minimum 660
kPa
(=
350o
m. a.s. i.)
Maximum 1060
kPa
Mechanicei Requirements
Vibration stress during operation
In accordance with DIN
IEC
66-2-6
10 Hz to 56 Hz: 0.075 mm displacement
56 Hz to 500 Hz: 9.8 msec-2 (=
1
g)
Transportation stress of device (packed for transportation)
in accordance with
DiN
iEC
66-2-6
5 Hz to 9 Hz: 3.5 mm displacement
9 Hz to 50 Hz: 9.8 msec-2 (= 1 g)
Topple/drop of device (not packaged)
In accordance with DIN
IEC
66-2-31
Fall height 50 mm
Faiiing
over (packaged)
in accordance with DIN
IEC
66-2-31
Electromagnetic Compatibility
Radio suppression (interference emission)
In accordance with VDE 0671,
iimitvalue
ciass
A
Interferenceimmunity
against iine–conducted interferences ondirectcurrent in accordance with
IEC
601
–4 (burst):
suppiy
and signal lines leaving the device
1
kV
Interference immunity against static electricity discharge in accordance with
IEC
601 –2: 8
kV
Interference immunity againat HF radiation In accordance with
IEC
601 –3: to 3V/m
Protective and safety Measurea
Protection
ciaas
lnaccordancewithVDEO106-1
(iEC536)
class
Ili
(safety extra low
voitage)
Degree of protection
IP
281 in S5
subrack
1P
20
IP
281 not
instalied
1P
OCl
A fan subassembly is
not
required.
8–4
1P
281 Equipment Manual
@
siWIN?IW
AG 1992, Order No: 6ES5
996-0KP21
R 11192
Technical Specifications
8.5
In Which Slots Can the Counter Module Be Operated?
The CPUS which can be used are listed in section 1.2.
Programmable Controller in Slot Designation
Module Subrack
=
Q
IP281 can be operated
in~is
slot.
Central
controller
Pa
CPU
o
1
2 3
IM
S5-115U
CR
700-OIA
:.:.::::::;:::;:\:;jj
.........
. . .
.
.........................
Pa
CPU
o
I
1
2 3
[M
S5-115u/ CR 700-OLB
:::::::::::
:::::::::::
:::::::::::::::::::::.:.:
::::::::?:::::;:;<<
S5–115H
..........
.
.
.........
.
. . . . . . . . . . .
.
.
.
.
..
. .
.......
.
..
.
......
:.:.:.:.:.:
:.:.:.:.:.:
:.:.:.:.:.:.:.:.:.:.:.:.:
::.:....:.:.:.:.:::::+:.
..........
. .
.........
. . . . . . . . . . . . . . .
.......
. . .
CR
7W)-1
Pa
CPU
o
1
2 3 4
5 6
IM
S5-115U
S5-115u/
Pa
CPU
CR 700-2
0
S5–115H
Pa
CPU
o
1
I
2 3
1+
4
S5-115LV
I
5
I
6
CR 700-3
IM
. . . . ...
.
.,.,.,.,.:.,.,.,.,.,.:.,.
.........
.
.:.,.:.,.,.
.:.:.>:j<::.+::>,<
.
.,,..:....
.:...
S5-115H
:,:,:,:,:,:
:,:,:,:,:,:
:,:,:,:,:,:
:,:,:,:::,:
:,.:.,.:.:.
.
.........
. .
....
.
. .. .
. . .
.
.
?..-..<+.:.:....
.
....
. . . . . . .
.......
. . . . . . . . . .
. . .
.
...<...:.:.:,.*.:.:.:
:.:.:,,:.:.>:<*<:;
,:<,:ZZ::2:::,.:,,<,
:,:,:,:,:,:
:,:,:,:,:,:
:,:,:,:,:,:
:,:,:,:,:,:
:,:,:,::,:
:,:,.:.,.,.
. . .
.
. . . . . . . . .
..........
. .
.........
. .
.........
. .
.........
.
,V.v..
.
.
...
..
. .
..........
. .
.
. .
....
.
.:.:.:.>.
. .
.
s=,..
.
.
.
.
......
.
....
.
....
. .
.
Pa
o
ER 701–3‘
Expansion
unit
Ps
o
1
2
I
3
ER 701–3LH
Central
controller
S5–135U
I
Central
mntroller
s5–155u/
S5–155H
Expansion unit
S5-183U
3
11
19 27 35 43
51
5s 67 75 63
91
99 07 15
123
131
139 147
155 63
Expansion unit S5-184U6 ~g;E3igx:iz*;#;#:%#3g*:E%2#$%;#$#:;:3:E%iE#i##i$%;#?#;g:%Ig%if##I;#:]
Expansion unit
S5-185U
Expansion unit
S5–186U
3 19
131
147 63
I
I
The
1P
281 counter module cannot be installed in expansion units ER 701 –1,
ER 701–2 and EU
187U.
1)
2)
3)
4)
5)
6)
Starting with release status
6ES5
701–3LA13, interrupt processing can be used in the expan-
sion unit using optical fiber coupling 6ES5307–3UA1 1 and6ES5317–3UA11.
Only one interrupt line each available
(+
equipment manual of the PLC)
Only after jumpers on the bus PCB are changed
Functionality very restricted since interrupt lines are not available.
Interrupts are only connected via lM307/lM317.
Only via interface 300–5/312–5 since EU 184U is not equipped with a power supply.
1P
281 Equipment Manual
@
SieffIenS
AG 1992, Order No:
6ES5
998-0KP21 8–5
Technical Specifications
R 11/92
8.6 Connection Cables for Incremental Encoders
8.6.1
Connection Cable for Siemens Incremental Encoder 6FC9320
(RS 422 with 5.2 V Supply Via
1P
281)
Order no:
6ES5
703–1000 (See ST52.3/54.l catalog.), max. length 32 m
l+
O Cable exit: bottom
1
Cable
exit: top
BFO: 5 m
CBO: 10 m
CCO: 20 m
CC5: 25 m
CD2: 32 m
1P
281
Shaft
encoder
,.,
,
,
,..
.
–,
–,
15
14
13
12
10
11
6
7
1
8
I
*
D
:.
.
.
.
.
::
.
.
.
I
snlela
on
snlela on
housing housing
I
h
Line 4 x 2 x 0.25 + 2 x 1 mm2
h
II
-
rd
\
(
5
11X
m
bk
II
I I
II
(6
II
~
<
D
br
II
I
1
\
1 1
<
8
ilE
m
gn
[i
(
1
II
N
<
m
9Y
II
I
I
II
(3
m
N
pk
(
4
II
II
m
I
5V2
Wt
I
2
1
1
12
II
m
I
GND
br
II
I
.
10
IJ
~
11
Outer
cable
diameter 8.9 mm
1+1
Sub D plug connector
9
15–way pin (crimp)
Connection side
Metallized housing with
15 screw lock
6FC9
341–lHC
* tines twisted in pairs
Round plug connector
Q
19080
12–way socket
Connection side
~“~o
:22
Siemens
30 ~1 06
6FC9
431–IFD
boo
8–6
1P
281 Equipment Manual
@
siC!fTWIS
AG 1882, Order No: 6ES5
996-0KP21
R 11/92
Technical Specifications
8.6.2
Connection Cable for Incremental Encoder in Accordance with RS 422
(5 V Signals; 5.2 V Supply Via
1P
281)
Order no:
6Es5
703–20000 (See ST52.3/w.l
catalo9.),
m=.
length
32 m
l-l
0 Cable exit: bottom
1
Cable
exit: top
1P
281
15
14
13
12
10
11
6
7
1
8
\
D
:.
.
.
.
.
::
.“
.
.
BFO: 5 m
CBO:
10
m
CCO:
20 m
CC5: 25 m
CD2: 32 m
Shaft
encoder
Shield on
housing
I
Line 4 x 2 x 0.25 + 2 x 1 mm2n
II
rd
m
II
K
bk
II
m
I
I
I
1
II
~
<
br
[1
m
1
1
\
I
I
ii
~
gn
II
m
II
N
<
m
w
II
I
m
I
I
N
pk
I
II
II
m
1
I
5V2
M
I
1
I
m
I
GND
br
I
1
11
!J
g
Cable end open
Outer
cable
diameter 8.9 mm
* Lines are twisted in pairs
Sub D plug connector
9 15-way pin (crimp)
Connection side
Metallized
housing
15
wi~
s~ew
Id
6FC9
341–lHC
1P 281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 8–7
Technical Specifications
R 11/92
8.6.3 Connection Cable for Incremental Encoder in Accordance with RS 422
(5 V Signals; 24 V Supply Via
1P
281)
Order no:
6ES5703–31XIIZU (See ST52.3/54.l catalog.), max.
length
32 m
~1
O Cable exit: bottom
1 Cable exit: top
BFO: 5
m
CBO:
10 m
CCO: 20 m
CC5: 25 m
CD2: 32 m
1P
281
15
14
13
12
10
11
5
7
I
-.
.
.
,
I
snlela an
housing
8–8
Shaft
encoder
(-1
tine 4 x 2 x 0.5 mm2
h
II
rd
9
II it
bl
II
m
I
I
II
II ~
<
m
ye II
I I
\
I
1
II ~
gn
ii
ti
N
+
m
9Y
II
m
I
I
N
pk
II
II
II
II
m
I
GND
br
II
1
II
II
Cable end open
Outer cable diameter 10.3 mm
* Lines twisted in pairs
I
+
1
Sub D plug cannactar
:.
,.
9
15–way pin (crimp)
.0
Connection side
::
Metallized
housing
.
.
.
15
with screw lock
8
6FC9 341–1
HC
+
1P
281 Equipment Manual
@
siWm??E
AG
1992, Order No: 6ES5
986-0KP21
R 11/92
Technical Specifications
8.6.4
Connection Cable for 24 V Incremental Encoder
(24V
Signals;
24V
Supply Via IP281)
Order no:
6ES5
703–4000 (See ST52.3/54.l catalog.), max. length 100 m
+
O Cable exit: bottom
1 Cable exit: top
BFO:
5 m
CBO: 10 m
CCO:
20 m
CC5: 25 m
CD2:
32 m
1P
281
I
1
4
8
5
7
9
Shield on
I
housing
Shaft
encoder
/-)
Line 4 x 2 x 0.5 mm
2
h
IIII
i
I
A*
II
m
I
III
I
I
B*
II
m
I
I
I I
I I
N*
II
m
1
I
II
IIII
m
24 V
11
II
GND
II
m
I I
~E
II
m
IIII
II
II
~
g
Cable end open
I
*
1
:0
,.
9
.
.
.
.
.
.
.
.
15
8
+
Sub D plug connector
15–way pin (crimp)
Connection side
Metallizad
housing
with screw lock
6FC9 341–lHC
IP
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
888-0KP21 8–9
Technical Specifications R 11/92
8.7 Requirements on the Input Signals
Precise functioning of the module requires that the input signals on the encoder inputs and digital
inputs meet definite specifications with regard to puke width and time in relation to one another.
8.7.1
Pulse Widths of the Encoder Inputs
Counting signals
The input signals on the encoder inputs must have the following minimum
puke widths.
I
T1
I
A
+
T2
I
AJB/N
or
L
24 V encoder
Encoder in
accordance
with
RS
422
Signals on
digital inputs
I
Maxirn.rnCo.ntingFreq.ency
I
Tlmin
I
T2min
250kHz 4
paec
1.6
psec
50kHz 20
paec
8
~ec
1
kHz
1
msec
400
paec
I
Maximum Counting Frequency
I
Tlmin
I
T2min
I
4
psec
1.6
paec
The input signals on digital inputs STA, STO and
SET
must have the
following minimum pulse widths.
I
T1
I
-
T2
I
L
STIVSTOISET
I
I
I
Maximum Signal Frequency
Tlmin
T2min
250
kHz
4
peec 1.6
WC
25
kHz
40
pec
16
~ec
0.1
kHz 10
msec
4
msec
8
10
1P
281 Equipment Manual
@ siWIN?IW AG 1882, Order No: 6ES5 998-0KP21
R 11/92
Technical Specifications
8.7.2
Time Relationships Between Counting Signals A and B/A* and B*
The input signals on encoder inputs A and B must meet the following requirements.
Times for
encoder
inputs
Max. Counting Frequency
Tlmin
T2min T3min
250
kHz
4
p-sac
1.6
~ec
0.8
~ec
50
kHz
20
p.sec
8W
4
paec
1
kHz
1
msec
400
paec
200
paec
8.7.3 Time Tables for Encoder Inputs and Digital Inputs
These tables are the basis for the calculation of time relationships in the following
sections.
Times for 24 V
encoder inputs
Times for RS 422
encoder inputs
Times for digital
inputs
Max. Counting Frequency
I
Min. Delay,
Emin
I
Max. Delay, Emex
11
250
kHz
0.5
paec
1.4
paec
50
kl-iz
I
2.5
paec
I
7
psec
1
kl-lz
125
psec
400
paec
Max. Counting Frequency Min. Delay,
Emin
Max. Delay, Emax
250
kHz
o
300 nsec
Max. Counting Frequency
I
Min. Delay,
Dlmin
I
Max. Delay,
Dlmex
I
250
kHz
0.6
~ec
1.9
psec
25
kHz
5
paec
14
pec
0.1
kz
1.4
msec
3.5
msec
1P
281 Equipment Manual
@ %31THIS AG 1992, order No: 6ES5 888-0KP21 8 – 11
Technical Specifications
R 11192
8.7.4 Time Relationships for HW Gate Control
Counting edge =
rising edge
Gate control
via pulse
{
Gate control
via level
1
W
I
I
l....~
T1
STA
&
. . . .
ii
I
Ii
Counting edge =
rising and
falling edge
Gate control
{
ii
via pulse STO
-----
I
I
1
IW
I
I
L...
L!LL--L
T1
Id
STA
1
. . .
.
,I
I
Gate control
via level
1 = First pulse to be counted
2 = Last pulse to be counted
3 = First pulse not to be counted
T1
min
=
Dlmax
– Emin + 0.4
~sec
T2min = Emax –
Dlmin
+ 0.6
@ec
The tables in section 8.7.3 apply.
Although non–adherence to the time relationships will not cause undefined states on the module,
the munter may deviate by 1 (more than 1
for
high frequencies on the encoder input and large
filter constants on the
Dl).
8 – 12
1P
281 Equipment Manuel
@
SiemenS
AG 1992, Order No: 6ES5
998-0KP21
R 11/92
Technical Specifications
8.7.5 Time Relationships for Load Procedures
Loading the Operating modes OCHG and
CCHG
counter
via STA
s,.
~
I
Loed counter
(internal signal)
Tlmin =
Dlmin
+ 0.7
~sec
Tlmax =
Dlmax
+ 0.7
~ec
The time table for
DI
in section 8.7.3 applies.
Loading the
counter via
zero pulse
(synchronization)
Loading in upward direction
SET
I
T2
~
Load counter
I
(internal signal)
T1
min
=
Dlmax
Emin
+ 0.4
psec
T2min
=
Emax
Dlmin
+ 0.4
psec
T3min
=
Emin
+ 0.4
psec
T3max
=
Emax
+ 0.4
psec
The time table in section 8.7.3 applies.
T1
and T2 must be adhered to ensure that the counter is loaded.
Loading in downward direction
I
N
1-
T1
Load counter
I
(internal signal)
T3
w
T1
min
=
Dlmax
Emin
+ 0.4
psec
T2min
=
Emax
Dlmin
+ 0.4
psec
T3min
=
Emin
+ 0.4
p.sec
T3max
=
Emax
+ 0.4
psec
The time table in section 8.7.3 applies.
T1 and T2 must be adhered to ensure that the counter is loaded.
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21 8 – 13
R
11/92
Definition of Terms
BASP
CCHG
Ccss
CONC
CPU
CRS
CVR
DB
DI
DQ
DQAO
DQAU
DQID
DQIU
DQNU
DQS
DW
EDQ
EDS
ESD
EUS
EVDI
EVFT
Disables command output. This signal is sent when the central module goes into
stop status. The signal disables the digital outputs.
Cyclic counting procedure with hardware gate start, an autonomous operating mode
Cyclic counting procedure with software gate start, an autonomous operating mode
Continuous counting, an autonomous operating mode
Central processing unit
Counter running status, the last position of the counter
Counter value register
Data block
Digital input
Digital output
DQ active from alarm value (i.e., interrupt value) to overflow, a method of operation
of the digital output
DQ active from alarm
value
(i.e., interrupt value) to underflow, a method of operation
of the digital output
DQ active for an adjustable impulse duration when the alarm value (i.e., interrupt
value) is reached – counting down, a method of operation of the digital output
DQ active for an adjustable impulse duration when the alarm value (i.e., interrupt
value) is reached – counting up, a method of operation of the digital output
DQ not used, a method of operation of the digital output
DQ status
Data word
Enable digital output
Enable downwards setting
Electrostatic sensitive devices/modules
Enable upwards setting
Directional evaluation
Four–time evaluation
1P
281 Equipment
Msnuel
@
%Mt3fIS
AG 1992, Order No: 6ES5 998-0KP21 D–1
Definition of Terms R 11/92
EVOT
FB
GALE
GAPU
GEN
GFS
GSS
GST
IFR
IIR
IOM
1P
IR
LED
LOS
OB
OCHG
Ocss
OVF
PLC
RES13
SC2A
SEP
SET
SPE
STA
STEP 5
D–2
One–time evaluation
Two–time evaluation
Function Mock
Level
gating
(i.e., hardware gate control with level)
Pulse
gating
(i.e., hardware gate control with pulse)
Gate enable
Gate function selection (i.e., select type of gate control)
Gate–start-stop
Gate stop (i.e., EMERGENCY OFF gate stop)
Interrupt enable register
Interrupt information register
Illegal operating mode
Intelligent peripheral (1/0) module
Interrupt
Light emitting diode
Load per software
Organization block
One–time counting procedure with hardware
gating
(i.e., one–time counting with
hardware gate start), an autonomous operating mode
One–time counting procedure with software start (i.e., one–time counting with soft-
ware gate start), an autonomous operating mode
Overflow, upper counting range limit exceeded
SIMATIC
S5 programmable controller
Reset pulse for the module
Start counter 2 when alarm value (i.e., interrupt value) in counter 1 is reached, a
combination operating mode
Standard slot
Digital SET input
Setting performed (synchronization)
Digital start input
Programming language used to program the
SIMATIC
S5 family
1P
281 Equipment Manuel
@
&3TN3fM
AG 1882, Order No:
6ES5
986-0KP21
R 11192
Definition of Terms
STO
Digital stop input
SYC
Synchronous control
SYR
Synchronous read
LJNF
Underflow. Lower counting range limit has been passed below.
TCAR
Transfer counting value to alarm register (i.e., interrupt register), a combination
operating mode
TCLR
Transfer counting value of counter
1
to load register of counter 2, a combination
operating mode
ZMPC
Zero marking pulse of encoder 1 to counter 2, a combination operating mode
1P
281 Equipment Manual
@
sk3m131W
AG 1992, Order No: 6ES5 998-0KP21 D–3
R 11/92
Index
A
Address area, 2–3
Address bits, 2–3
Address decoding, 2–3
Application area, 1–2
Basic address, 2–3, 3–2
Basic module, 1–3
Basic setting after
RES=,
5–4
BASPj
1–20
Block circuit diagram, 6–40
c
CCHG,
6–15
CCSS,
6–13
Command run times, 1–22
Commissioning, 5–1
Communication with
SIMATIC
S5, 1–22
CONC,
6–8
Continuous counting, 6–8
Control counter synchronously, 6–28
Counting direction, 5–8, 6–5
Counting mode, 6–2
Counting pulse evaluation, 6–4
Counting range, 6–2
Counting range limit, 6–3
Counting settings, 6–2
Counting width, 6–2
Counting with one counter, 1–16
CRS, 3–14
CVR (counter status register), 3–9
Cyclic counting, 6–13, 6–1 5
Cyclic program, 7–5
D
Diagnostic LEDs, 1–5
Digital inputs, 1–19
Digital output, 1–20, 6–34
Basic setting, 6–35
Enable, 6–34
Methods of operation
Interrupt value pulse, counting down,
6–39
Interrupt value pulse, counting up,
6–38
Interrupt value to overflow, 6–37
Interrupt value to underflow, 6–36
Switch off, 6–35
Status, 6–35
DIL switch, 2–3
Dimensions, 1–3
Direction evaluation, 6–5
DQAO,
6–37
DQAU,
6–36
DQID,
6–39
DQIU,
6–38
DQNU,
6–35
DQS, 6–35
E
EDQ, 6–34
EDS, 6–26
EMERGENCY OFF gate stop, 6–33
Encoder interface, 1–13
24 V encoder, 1–14
In accordance with
RS
422 (5 V),
1
–17
Encoder supply (24 V), 1–16
Encoder supply (5 V), 1–18
EUS, 6–26
EVDI,
6–5
1P
281 Equipment Msnusl
@
siemenS
AG
1992, Order No: 6ES5
998-0KP21 l–l
Index R 11/92
EVFT, 6–5
EVO~6–4
EVTT,6-4
F
Front plate, 1–5
Functional setup, 1–10
Fuse, 1–21
G
GALE, 6–32
GAPU,
6–31
Gate control, 6–30
Activation of, 6–31
EMERGENCY OFF gate stop, 6–33
Hardware gate control
Via level, 6–32
Via pulses, 6–31
Software gate control, 6–33
GEN, 6–30, 6–31
GFS, 3–16
GSS, 6–33
GSTj
6–33
H
Hysteresis
At overflow/underflow, 6–3
Of the interrupt value 4–9
I
IFR (Interrupt enable register), 3–11
IIR
(Interrupt information register),
3–12
input
signals, requirements of, 8–10
Installation width, 1–3
Internal gate, 6–30
Interrupt
Acknowledgement, 4–5
Acquisition, 4–5
Reaction time, 4–4
Sources, 4–6
Interrupt evaluation, 4–3
Interrupt line, 2–6
Interrupt line selection, 4–2
Interrupt processing, 4–1, 4–2, 7–6
Interrupt program, 4–1, 7–6
Interrupt value, 3–7, 4–9
Inverting the input signals, 6–6
IOM,
5–7
L
Limit frequency, 1 –14, 1 –19
Load resistance, 1–1 4
Loading by S5, 6–23
Loading the munter, 6–23
Loading with zero pulse, 6–24
LOS, 6–23
Manual new start, 7–4
Mechanical setup, 1–3
Method of operation of the counters,
1–1
1
Minimum pulse duration, 1–20
Mounting the plug–in
submodule,
1–4
o
OCHG,
6–11
OCSS,
6–9
Offset, 2–3, 3–2
One–time counting, 6–9, 6–1
1
Operating modes, 6–7
Autonomous operating modes, 6–7
Common operating modes, 6–17
Operating modes overview, 5–9
Order number, 1–2
Overflow, 6–3
OVF, 5–5
P
Parameterization DB, 7–4
I–2
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
996-0KP21
R 11/92
Index
Plug connector allocation, 1–7
24 V
SUf@y,
1–9
Basic plug connector, 1–7
Digital inputs and outputs, 1–9
Encoder inputs, 1–8
Plug–in jumpers, 2–7
BASP function, 2–7
Input filter, 2–8
Minimum pulse duration DQ, 2–9
Selecting the encoder interface, 2–11
Selecting the reference potential,
2–12
Wire break recognition, 2–1 O
Plug–in
submodule,
1–3
Potential isolation, 2–1 1,2–1 2
Process interfaces, 1–1 2
Program example, 7–1
Pulse width, 8–10
R
RC filter, 1–14, 1–19
Reading the counter, 6–29
Reference potential, 1–13
Register address, 3–2
Register set, selection of 3–4
Registers, 3–1
Control register, 3–16
Counting value register, 3–9
Interrupt information register, 3–1 2
Interrupt register, 3–7
Load register, 3–5
Overview, 3–1 8
Parameter register, 3–16
Reading, 3–3
Select register, 3–4
Selection, 3–2
Status register, 3–1 4
Writing, 3–3
RESR
behavior, 5–4
Restart after return of voltage, 7–4
s
Saving the register set address, 7–4
1P
281 Equipment Manual
@
Siemens AG 1992, Order No: 6ES5
998-0KP21
SC2A,
6–21
Sn,
6–24
Setting elements
Basic module, 2–1
Plug–in
submodule,
2–2
SPE, 6–23
STA, 6–31 , 6–32
Startup, 7–4
Startup behavior, 5–3
Status register, 5–5
SYC, 6–28
Synchronization, 6–24
SYR, 6–29
T
TCAR, 6–18
TCLR, 6–19
Time relationships
Between counting signals, 8–1 1
For HW gate mntrol, 8–12
For loading procedures, 8–13
u
Underflow, 6–3
UNE
5–5
v
Voltage supply for encoder, 1–21
w
Wire break recognition, 1–1 7
Working DB, 7–4
z
Zero marking pulse counter, 6–20
I–3
To:
Siemens AG
Bereich Automatisierungstechnik
Kombinationstechnik (B1
.2–TI)
Postfach
2355
D–90713
Furth/Bay.
From:
Name
Com~anv/department
Address
Telephone
I
Suggestions
Corrections
For equipment manual
Order no.
If you find typographical errors while
reading this document, please use this form to
let us know.
We would also be grateful for your suggestions,
remarks or ideas.
Please fill in the order no. of the affected
document.
Suggestions orland corrections: