PLC CL550
PLC CL550
PLC CL550
108
Edition
PCL and CL550
1999 - 2002
Table of Contents
1. Safety Instructions..................................................................................................................................1-1
1.1 Standard Operation................................................................................................................................1-1
1.2 Qualified Personnel................................................................................................................................1-2
1.3 Safety Markings on Components ...........................................................................................................1-3
1.4 Safety Instructions in this Manual ..........................................................................................................1-4
1.5 Safety Instructions for the Described Product........................................................................................1-5
1.6 Documentation, Software Release & Trademarks.................................................................................1-7
8. Processing Times...................................................................................................................................8-1
8.1 PCL Processing Intervals.......................................................................................................................8-1
8.2 CL550 Processing Intervals ...................................................................................................................8-6
1. Safety Instructions
Before you start working with the Bosch PCL Software PCL or the CL550
Hardware PLC, we recommend that you thoroughly familiarize yourself
with the contents of this manual. Keep this manual in a place where it is
always accessible to all users.
With regard to the foregoing, please read the information about our
comprehensive training program. The professional staff at our training
centre will be pleased to provide detailed information. You may contact
the centre by telephone at (+49) 6062 78–258.
DANGER
This symbol is used wherever insufficient or lacking observance of
this instruction can result in personal injury.
CAUTION
This symbol is used wherever insufficient or lacking observance of
instructions can result in damage to equipment or data files.
DANGER
Fatal injury hazard through ineffective Emergency-STOP devices!
Emergency-OFF safety devices must remain effective and
accessible during all operating modes of the system. The release
of functional locks imposed by Emergency-STOP devices must
never be allowed to cause an uncontrolled system restart! Before
restoring power to the system, test the Emergency-STOP
sequence!
DANGER
Danger to persons and equipment!
Test every new program before operating the system!
DANGER
Retrofits or modifications may interfere with the safety of the
products described hereunder!
CAUTION
Danger to the module! Do not insert or remove the module while
the controller is switched ON! This may destroy the module.
Switch off or disconnect controller power supply module, external
power supply and signal voltage. Only then will it be safe to insert
or remove the module!
CAUTION
Only Bosch-approved spare parts may be used!
CAUTION
All ESD protection measures must be observed when handling
modules and construction elements! Prevent electrostatic
discharges!
Documentation
The present instruction manual provides the user with comprehensive
information about programming and operation of the
! Bosch PCL Software PLC
! Bosch CL550 Hardware PLC
However, commonly accepted procedures for project planning and
installation of controllers and related hardware have been excluded from
the following manuals:
⇒ Throughout this manual, the floppy disk drive and hard disk are
always designated drive A: and drive C:, respectively.
Version
⇒ The information in this manual applies to the following versions:
Software WinPanel 2.x
PLC Utility Program 3.x
Trademarks
All trademarks of software installed on Bosch products when shipped
from the factory represent the property of their respective owners. At the
time of shipment from the factory, all installed software is protected by
copyright. Software may therefore be duplicated only with the prior
permission of the respective manufacturer or copyright owner.
As is the case with all Bosch PLC systems, control software programs
are created and placed into operation with the use of the Windows-based
WinSPS programming system. In this context, a significant extension of
features is provided by the option to utilize the "C" high-level language.
The present documentation is designed to support the PCL user with his
programming tasks and with the system startup of the controller. It
discusses the following subjects:
• Hardware & System Configuration
• Operating & Displaying
• Interfacing with Peripherals
• Programming Basics
• Addressing Conventions
• Command Set Description
• Programming Samples
⇒ Because the data field and data buffer are included in every
hardware expansion level, they do not reduce the size of the user
memory! Just like the program and organization modules, the data
modules are stored in the PLC user memory.
The following events are relevant to the data flow between WinPanel
(hard disk) and PCL (dynamic RAM):
• Startup Loading application program and data
• Post-loading Adding PCL modules
• Shutdown Saving user/application data
For the PCL Software PLC, this would inevitably result in the loss of
remanent data. This emergency situation will be prevented by a
function that is currently under development, which will be utilizing
the static memory onboard the supplementary hardware for the
storage of remanent data. A sudden power failure will then no
longer cause the loss of remanent data. The manner and extent of
defining this memory area for backup purposes are left to the
individual user.
2.2.6 Simulation
A function which is integrated in WinSPS version 3.2 and WinPanel
version 2.32 and higher allows you to simulate a PCL. This simulation
can be started via a switch on the WinPanel (cf. chapter 2.3.2).
2.3.1 WinPanel
“WinPanel” is the designation for the supplementary module required for
operating and displaying PCL functions and statuses which are shown in
plain text. In addition, WinPanel serves to define the Windows calculation
time and the number of real-time accesses.
Program loading
Back Up Program
Shut Down
Outputs disabled
Run/Stop
Fixation On/Off
Program Information
Rho4-PLC
Rho4-SPSInterface
The switches are entered in the "Destination" text box in the WinPanel
Properties window.
Examples:
/Y1 " Hardware switch enabled
/Y68 " Trace information output to Telnet
port (Y64), and run INTERBUS-S I/O
inconsistently (Y4).
/Znn Fixed cycle time (nn = time in ms)
This switch is used to declare a fixed cycle time for the PCL.
NC 5
Field bus
connector
When using Windows without its own display terminal, the operating
system may pause while waiting for user input. Windows requests this
type of input after an uncontrolled shutdown, for example. If this is the
case, connecting a keyboard and monitor will be mandatory.
⇒ Shutdown
The Bosch PC-based Control Terminals feature an integrated buffer
with defined shutdown which ensures a controlled shutdown of all
Windows applications. This means that the control terminal can still
be switched off once the PLC has been halted via STOP on the PCI-
BMxx card.
Initialization
PCL startup
yes
Startup
STOP?
no
Startup
characteristics
Cyclical
program
processing
I/O state
no
Processing
STOP?
yes
Initialization values
SM26 = FFFFH
SM31.1 = 1
All others = 0
Exceptions
SM20.0 Trigger pulse upon each startup and restart; is set HIGH upon
PCL startup and restart. Marker is deleted if OM1 has been
processed at least once.
SM20.1 Buffer failure; is set upon incorrect buffering of remanent data
into static RAM.
See also Section 2.5.8, Startup Characteristics
SM20.2 Flashing marker; flashes 2 times per sec after PCL startup.
SM20.3 Disable outputs; is set in accordance with the "Disable
Outputs" request. Always updated during I/O state.
SM20.4 Fixation marker; is set in accordance with the "Fixation"
request. Always updated during I/O state.
SM20.5 Data save error; goes HIGH when the system was unable to
save data to the hard disk.
See also Section 2.5.8, Startup Characteristics
SM20.6 Nonremanent cold start; goes HIGH when the cold start has
occurred, and all remanent areas were deleted.
SM20.7 Trigger pulse for restart and program loading; goes HIGH
upon restart, and subsequent to loading of PCl program.
Marker is deleted if OM1 has been processed at least once.
SM21.0 Windows (WinPanel) fails to respond.
SM21.7 Backup of operands into static RAM is not supported by the
hardware version in current use.
2.4.2 Startup
Startup
The actual startup occurs once the PCL has been initialized. Provided
that no Stop causes or errors are present, the switch position of
WinPanel/external control elements or WinSPS command will determine
one of various available startup modes.
Startup-STOP mode
In the event that during the startup subsequent to Power-ON a hardware
fault or STOP request occurs, the PCL will remain in Startup-STOP
mode. Startup STOP mode is exited as soon as the error has been
corrected and the RUN/STOP switch has been toggled once in the
RUN/STOP/RUN combination. Provided the switch is set to RUN, the
STOP mode can also be exited by means of the Programming Unit (PG).
Startup characteristics
Startup-STOP is always followed by a new start (Power-On sequence),
and Processing-STOP is always followed by a restart.
In the event that the respective OMs have not been programmed, the
startup will be carried out without OM processing.
All startup modes adopt the definitions made in the OM2. If an OM2 is
absent, the startup will always be nonremanent.
⇒ The PCL does not utilize default settings for remanence limits.
The data affecting the system area (times for time-controlled OMs,
remanence limits) can then be modified in the respective startup OM.
Once the inputs have been loaded, the fixation is superimposed, which
means that it now acts in the case of direct access from within the startup
OM. However, the output to the peripherals does not occur directly, and
the output image is not updated.
Provided the respective setting has been made in the OM, the specified
data module is copied into the data buffer.
As a next step, the time matrix processing of timer values is started, and
the processing of the time OM is enabled.
In the event that an error occurs while backing up to the hard disk, the
data required for initialization will be taken from the static RAM.
To effect the backup, into static RAM, of remanent areas and of the data
modules identified as remanence DMs, only the measures outlined below
are required:
• The remanence identifier "E" for the maximum of 128 data modules
(example: DM1,E DM_K01) must be predefined in the symbol file.
• If the OM2 is available, the remanence areas for M / T / C / DM / DF
must be defined in the OM2.
⇒ Please note that the PCL is started with startup switch /M (refer to
section 0). This is the only way to ensure that the controller, in the
case of a panel not equipped with uninterruptible power supply
(UPS), will perform – without security query – a shutdown that
includes the backup of online changes, current DB contents and
remanent data.
If the /M switch has not been set, and the security query "Do you
really want to shut down?" remains unanswered, the modified
and/or remanent data cannot be written to the hard disk when the
PC is shut down.
A subsequent restart of the PCL will cause the controller to use the
"old" modules.
To safeguard the data backup and remanence in the PCL in the case of a
power failure or Power-OFF without shutdown, the supplementary
hardware is equipped with a buffered static RAM. This storage area is
128 kbytes in size, and is backed up for brief interruptions by a gold foil
capacitor. If the static RAM is to be backed up over an extended period of
time, an external backup battery must be used (see also Section 2.3.4,
External control elements).
Backup time
Gold film capacitor 10 – 40 min w/ fully charged capacitor
(standard equipment)
Battery (type .........) on request
Order no. ...............
For each of the operands M, C, T, DM, DF and DM, a bit array in the
OM2 defines whether or not a cyclical backup shall be performed. In
addition, the cyclical backup of the specified areas must be enabled.
Also, the remanent areas for operands M, T, C, DP and DF can be
changed if they deviate from the default setting. See section 2.5.3.4 ,
Defining Remanence Areas in the OM2.
All data modules that are to be backed up are marked with a remanence
identifier in addition to the OM2 entry. The data modules so identified are
written to static RAM, for example, DB1,E DB_K01.
When created under WinSPS, the fixation lists are written directly to the
hard disk. If an active fixation is recognized during the controller start
sequence, the fixation lists of this file are again loaded. If the file is not
available or faulty, the PCL will remain in Startup-STOP mode until a
fixation list is loaded. Loading an "empty" list deletes the fixation
identifier.
In the event that the backup to the hard disk was faulty or could not be
performed, the remanent data (a subset of all remanent operands) in the
dynamic RAM will be overwritten by those from the static RAM at the time
the PCL is newly started. Subsequent to operand initialization, the
remanent operands are again written back into static RAM.
Because the process of writing to static RAM is much slower than that of
writing to dynamic RAM, and thus causes the PLC cycle to be extended,
the remanent areas to be selected must be kept as small as possible.
Sample calculation
We shall assume that the entire marker range, the entire data field, and
20 DMs with 512 bytes ea. must be backed up:
Total: 10000 µs
DEFW W 2#0000000100000100
; *******|*****||* *: not used
; | |+------- Check nominal cycle time
; | +-------- Remanent start if possible
; +-------------- Copy data module into data buffer
DEFW W 128
DEFW W 128
DEFW W 128
DEFW W 256
DEFW W 16384
The user can shift the so-called "remanence limits" as desired. To this
end, both OM2 and system area provide appropriate measures.
⇒ The remanence limit for the data field affects only the backup into
static RAM, and not the backup to hard disk.
All data modules are always remanent because they are stored on the
hard disk.
⇒ Backing up the data modules into static RAM accounts for only
those DMs that are marked with the remanence ID (E) in the symbol
file.
A standard rule applying to both the data field and remanent DMs is that
the backup into static RAM takes precedence over the backup to hard
disk. Accordingly, in the event that a backup turns out to be faulty or
could not be carried out, the remanent data (a subset of all remanent
operands) in the dynamic RAM will be overwritten by those from the static
RAM at the time the PCL is newly started.
Buffer failure
The special marker SM20.1 (buffer failure) identifies a backup error when
saving remanent data into the static RAM onboard the PCL hardware.
⇒ With the special marker SM20.1 set HIGH, the backup of all
remanent operands into static RAM – both cyclically and via PLC
instruction – are rejected, although the PCL remains in RUN mode.
The interpretation of the SM20.1 and/or of system area word S116
permits error handling.
RAM test
During the controller startup sequence, a test of the static RAM is carried
out. If the test fails, special marker SM20.1 will go HIGH, and the test
results are stored in system area S116.
RAM test Backup to Backup to Backup to SM20.1 set SM20.5 set Contents of rem. Remanent startup
static RAM, static RAM, hard disk during during S116 Start w/ data from
shutdown prog. proc. startup startup (binary) up
NOK x x NOK x x 00001xx1 No
OK NOK NOK NOK x x 00001110 No
NOK x x OK x 00000xx1 Yes Hard disk
OK NOK NOK OK x 00000110 Yes Hard disk
OK NOK OK OK 00000010 Yes Hard disk
OK OK NOK OK 00000100 Yes Hard disk
OK OK OK OK 00000000 Yes Hard disk
OK NOK OK NOK x 00001010 Yes Static RAM backup,
last program
processing
OK OK NOK NOK x 00001100 Yes Static RAM backup,
shutdown
OK OK OK NOK x 00001000 Yes Static RAM backup,
shutdown
x = don’t care
Ideally suited for industrial applications, the unit also features excellent
EMC characteristics and vibration resistance. All of the above, in concert
with the proverbial excellence of Bosch manufacturing quality, ensures
highest reliability and availability ratings even in critical applications.
The innovative concept inherent in the CL550 supports the consistent im-
plementation of decentralization in automation technology. Distributed
peripheral devices are connected via the PROFIBUS-DP standard field
bus or via InterBus-S, respectively.
To handle communications at the control unit level, an Ethernet-TCP/IP
connection is already integrated. Centralized programming is thus provi-
ded already in the basic unit. The Ethernet-TCP/IP connection also facili-
tates communications between external PLC, control terminals, and PCs.
Display /control
Pentium 166 MHz elements
platform
under VxWorks V.24 interface
CMD Interface
(ZS550-DP-IBS only)
32 MB RAM
Ethernet Back Front
side B
a
32 MB Ethernet Front c
Flash disk k
s
i
I/O Port d
Buffered SRAM PROFIBUS DP-V1 e
for remanent data
I/O Port
InterBus-S
(ZS550 -DP-IBS only)
3.1.2 Memory
To accommodate the memory size of the control program, 1500 k words
were reserved in RAM. At an average length of 6 words per instruction,
approximately 250 instructions can be programmed.
Upon startup, control program and data are loaded from the FLASH Disk,
and written into RAM. This is followed by reading the remanent data from
the buffered SRAM, and writing it to RAM where it is superimposed over
the data that is already there.
• One serial interface which can be operated with the use of the Bosch
BÜP03, BÜP64 or BÜP19E transfer protocols.
The clock is set through a command by the WinSPS editor, and cannot
be influenced via the PLC program.
3.1.6 Simulation
A function which is integrated in WinSPS version 3.2 and WinPanel
version 2.32 and higher allows you to simulate a CL550. This simulation
can be started via a switch on the WinPanel (cf. chapter 2.3.2).
Within the rack, each hardware module possesses a clearly assigned slot
ID. In conjunction with the rack ID which can be individually assigned to
each rack, this facilitates the precise identification of the ZS550 within a
system or network.
ZS Stop
RUN/STOP switch
Outputs disabled
I/O fixed
Mainboard
SELECT button (scrolling)
SELECT LED
Module status
Select
Dev
Top display: ZS550 functionality (device)
The status code indicated in the bottom display always refers to the
ZS550 functionality indicated in the top display.
When the unit is in RUN control status, the presence of messages only
cause the Select LED to illuminate. Pressing the button causes the
highest-priority message to be moved to the foreground. Releasing the
button causes the current message to disappear after 10 seconds,
extinguishing the display.
Stop
Run
AS
Fix
STOP / RUN
switch
RUN Program is running, outputs are active.
Timer and counter values are being
processed.
When a control unit enters Stop mode, the cause may be as follows:
Stop mode causes all outputs to be deleted, and the bus master to be
switched to Clear. All other operands retain the contents they had during
the preceding (last) cycle.
While in Stop mode, the central processing unit can continue to function
as a server, processing tasks from partner units.
Upon transition from RUN to STOP mode, the error and/or information
status is updated. The status can be visualized via the WinSPS and
WinDP utility programs.
When the control unit function reports an error, the top display always
indicates code “1”. Because messages of this type always cause a ZS-
Stop, the display is always instantaneous. It is also possible that several
codes are present at the same time, a condition which is signaled by the
Select LED, meaning that the messages can always be scrolled through
by pressing the Select LED
Select
Dev
Select: Control unit function
Status display of control unit functions
Status
Status Explanation
display
Select
Status Explanation
display
Off OPERATE mode (fault-free operation). DP/V1 bus master engaged in
cyclical data transfer.
CLEAR mode ; sources for CLEAR are the following:
- Control unit in STOP mode
- Control unit in CLAB mode (outputs disabled)
The DP is engaged in cyclical I/O data transfer. Value 00H (outputs
cleared) is transferred for outputs.
Loading new master parameter set (MPS)
At least one slave is not reachable (SNE), or not ready for cyclical data
traffic (SNB).
At least one slave reports static diagnosis (DPS)
Bus error – Bus master is unable to access the bus (no idle level)
Possible causes:
- Short-circuit on PROFIBUS
- Terminating resistor not switched on
- Terminating resistor not powered
Fatal error in DP bus master (system error)
Frontside Backside
Select Select
Dev
Select: TCP/IP COM functions
Dev
Status
Status display of
Status
TCP/IP COM functions
Status Explanation
display
The displays of the TCP/IP communication section also include the LEDs
of the Ethernet interface on the front panel:
L S
X
Ethernet
7
1
Select
Status Explanation
display
The displays of the DP/V1 communication section also include the SEND
LED of the PROFIBUS interface:
Send
COMNET-DP
X
7
2
Select
Status Explanation
display
Select
Anzeige Bedeutung
Status
ACTIVE: InterBus-S in active status
Bus error – Busmaster cannot access the bus (no idle state level)
Possible causes:
- Short circuit on the field bus
- Terminating resistance not switched on
- Terminating resistance has no voltage
Error on the interface module/HW
Clears fixation
Enable outputs
Outputs disabled
Select
Stop
Run
Version indicated
Stop via display change
(available w/ v1.1 & up)
Run
Outputs Serial port Delete
enabled disabled BUEPxx Tacer MPS all BIN
file files
If this is the case, the function of the STOP/RUN switch will be limited to
acknowledging the display visible in Configuration mode; the control unit
itself will not respond to a change in the position of this switch.
The next program to be executed loads and starts the VxWorks operating
system. The operating system has been adapted to the available
hardware, and comprises all required hardware support functions.
During the system startup, a check is made to verify and initiate the
communications capability of the hardware module in conjunction with the
other components in the system.
The overall system will be enabled and the floating contact of the power
supply closed only after all hardware modules have started without fault.
In the event that a buffer error is found, and batteryless operation was not
preselected via the power supply, the data field will be subject to a
defined deletion, and special marker SM20.1 set HIGH to identify the
data loss. However, if the buffer is fully functional, the data field will be
retained, and the remanent data modules copied from static RAM into
program memory.
The definition of operand remanences are derive from the OM2 through
interpretation of the remanence bit. If the bit is HIGH, all operands
upward of the defined address limits will be kept remanent. Up to these
limits, the operands are subject to defined deletion. If the bit is LOW, all
operands will be deleted. In the absence of the OM2, the default takes
effect, meaning that the upper half of the operands remains remanent.
The data field and the data modules defined in the PG programming
device are normally remanent.
In the case of defined remanences, the buffer status and the flag for
batteryless operation are checked. If batteryless operation is not selected
and the buffering is faulty, all operands will be subject to defined deletion
which is indicated in special marker SM20.1. The controller exhibits error
code "1" for remanence error, and remains in Startup-Stop mode. The
controller remains in this state until the error condition has been
specifically removed.
Error status ‘2’ can be acknowledged only by loading a new program via
the PG programming unit. By contrast, status ‘1’ is canceled either by
loading a program while deleting the remanent areas, or via direct user
intervention on the display, and selection of the “Nonremanent Startup”
menu option.
The control unit always exits the Startup-STOP status with a valid PLC
program and valid operands.
Determine batteryless
Batterieloser- Betrieb aus
operation via signals
Netzteilsignalen from
ermitteln
power supply
Ermittle vorhandenes no
nein Lösche Operanden
Delete operands
Determine available
Anwender-program
Programm Lösche Datenfeld
Delete data field
application via
Sondermerker
Special markerSM21.1
SM21.1
über FLASH-Disk
FLASH disk
Load
Anwenderprogramm
application program
aus
FLASHfromladen
FLASH disk
ODetermine
peranden-P operand
ufferung
buffering via power supply
über Netzteilsignale und
signals and data
Datenmuster patterns
ermitteln
Batterieloser-
Batteryless Betrieb
operation yes
ja
oder Operanden
or -
Pufferung-Fehler
operand buffering error
Datenbausteine aus
Copy data modules Lösche
Delete data
Datenfeld
field
statischem from
RAM kopieren und
andremanente
remanent data
Datenbausteine
modules,
static RAM Setze
set special
Sondermerker
marker SM21.1.
SM21.1
ADetermine
nwender R application
emanenz
remanence
aus from OB2
OB2 ermitteln oder
or set defaults
Voreinstellung setzen
O peranden
Faulty -Pufferung
operand buffer
fehlerhaft und Anwender
and application ja
Remanenz
remanence selectedund
eingestellt
yes Lösche Operanden WaitWarte auf
for operand Wait
Warte
to load
auf
Delete operands Operanden
buffering, Pufferung
reset error. Anwender-P
application program
rogramm
and
kein Sondermerker
Special marker20.1
20.1 via PG progr. device.
Fehler rücksetzten über PG laden
noBbatteryless
atterieloser operation
Betrieb Display shows 1
Anzeige 1 Display shows
Anzeige 22
Startup
Anlauf
The controller startup checks the flags for batteryless operation, operand
remanences, and Power-ON, and selects from these the startup OM and
remanence characteristics.
The trigger pulses for Power-On or “Program loaded” are set accordingly.
Startup-STOP Module-STOP
no
Power-ON flag is set.
PLC cycle
as well as areas
• data field
• data buffer
• markers
• timers
• counters
Upon renewed Power-ON, the data is then copied from flash memory to
dynamic RAM (working memory). This is followed by updating the
remanent areas with information from static RAM.
⇒ The NT4 power supply module is the only power supply which
ensures that remanences are backed up c o m p l e t e l y and
w i t h o u t additional programming effort, and that there is no
limitation in terms of equipping.
3.5.2 Remanence with use of NT1, NT2, NT3, and NT24 power supplies
When using the NT1, NT2, NT3, and NT24 power supply modules,
remanence cannot be fully guaranteed because after being switched off,
these power supplies fail to maintain the voltages required to save the
remanent data.
⇒ When using the backup commands for remanent areas, the data
held in static RAM always correspond to the respective last save
operation.
Example:
In the case of cyclical backup, the data is taken from the preceding
complete PLC cycle and NOT from the current PLC cycle!
Because the process of writing to static RAM is much slower than that of
writing to dynamic RAM, and thus causes the PLC cycle to be extended,
the remanent areas to be selected must be kept as small as possible.
Sample calculation
We shall assume that the entire marker range, the entire data field, and
20 DMs with 512 bytes each must be backed up:
Total: 12400 µs
DEFW W 2#0000000100000100
; *******|*****||* *: not used
; | |+------- Check nominal cycle time
; | +-------- Remanent start if possible
; +-------------- Copy data module into data buffer
DEFW W 128
DEFW W 128
DEFW W 128
DEFW W 256
DEFW W 16384
The user can shift the so-called "remanence limits" as desired. To this
end, both OM2 and system area provide appropriate measures.
⇒ The remanence limit for the data field affects only the backup into
static RAM, and not the backup to hard disk.
All data modules are always remanent because they are stored on the
hard disk.
⇒ Backing up the data modules into static RAM accounts for only
those DMs that are marked with the remanence ID (E) in the symbol
file.
A standard rule applying to both the data field and remanent DMs is that
the backup into static RAM takes precedence over the backup to Flash
disk. Accordingly, in the event that a backup to Flash disk turns out to be
faulty or could not be carried out, the remanent data (a subset of all
remanent operands) in the dynamic RAM will be overwritten by those
from the static RAM at the time the PCL is restarted.
Buffer failure
The special marker SM20.1 (buffer failure) identifies a backup error when
saving remanent data into the static RAM onboard the ZS550 hardware.
The marker goes HIGH in the following cases: During the startup of the
CL550 is noted that the system was unable to effect a proper backup of
the remanent data to static RAM on Power-Off of the previous controller
cycle. The special marker is set while processing a startup OM, and is
reset once the PLC startup has concluded.
Data backup error
The special marker SM20.5 (data backup error) is set when, at the time
of shutdown, the backup of remanent data to the FLASH Disk was faulty.
The special marker is set after Power-On, and while processing the OM5
startup module, and is reset prior to the OM1 PLC startup module.
RAM test
During the controller startup sequence, a test of the static RAM is carried
out. If the test fails, special marker SM20.1 will go HIGH, and the test
results are stored in system area S116.
RAM test Backup to Backup to Backup to SM20.1 set SM20.5 set Contents of rem. Remanent startup
static RAM, static RAM, hard disk during during S116 Start w/ data from
shutdown prog. proc. startup startup (binary) up
NOK x x NOK x x 00001xx1 No
OK NOK NOK NOK x x 00001110 No
NOK x x OK x 00000xx1 Yes Hard disk
OK NOK NOK OK x 00000110 Yes Hard disk
OK NOK OK OK 00000010 Yes Hard disk
OK OK NOK OK 00000100 Yes Hard disk
OK OK OK OK 00000000 Yes Hard disk
OK NOK OK NOK x 00001010 Yes Static RAM backup,
last program
processing
OK OK NOK NOK x 00001100 Yes Static RAM backup,
shutdown
OK OK OK NOK x 00001000 Yes Static RAM backup,
shutdown
x = don’t care
4. Peripheral Operation
The connection with the periphery is in each case accomplished via a
field bus system. The I/O data of the PCL is held in the dynamic RAM of
the PC (PCL and/or ZS550), and is transferred to the image of the field
bus master either in the I/O state or by command. The configured I/O
modules (slaves) are serviced from there.
PC RAM I*
Bus master Config. I Peripherals
Config. O
O*
I/O image Bus master I/O modules
of PLC I/O image (slaves)
Acyclical transfer
*
PROFIBUS-DP: Config. I/O
CAN: Config. I/O
INTERBUS-S: All I/O
The bus master creates diagnostic tables on the basis of the I/O
configuration list. The error messages and error diagnostic functions
generated in this manner depend on the bus system being used, and
must be evaluated with the aid of the bus-specific software tools.
The asynchronous access from two sides may cause the PLC to load
only part of the data of a contiguous function block from the dual-port
RAM at a given time.
Example:
The bus master wants to transfer 20 bytes of data to a slave.
After 10 bytes have been transferred, the PLC writes new data into this
memory area. This causes the remaining 10 bytes, along with new
contents, to be sent to the slave. This means that the 20 transferred
bytes of data originate in different PLC cycles. They are therefore
inconsistent!
For our case in point, this means that before the PLC will be permitted to
write new data into the memory area, the bus master transfers the entire
20 bytes of data to the slave.
4.2 PROFIBUS-DP
I/O configuration
The I/O configuration for the PROFIBUS-DP is accomplished with the aid
of the WinDP Configuration & Diagnostic Tool.
Data exchange
The data exchange between bus master image and peripheral devices is
limited to those slaves that have been configured.
Data consistency
Data consistency is maintained only for those bus stations that have been
appropriately configured. The data width depends on the default values
taken from the device specification files.
Peripheral errors
The PROFIBUS-DP field bus features a comprehensive diagnostic
system whose messages are made available by the bus master. The
WinDP software also incorporates the corresponding diagnostic system.
Properties
● PCL: PROFIBUS-DP protocol, to EN50170
● CL550: PROFIBUS-DPV1
● Max. 124 slaves
● Max. 244 bytes each for inputs / outputs per slave
(max. 122 bytes consistent inputs or outputs)
● Max. 8kbytes (65536 bits) each for inputs and outputs
● Baud rates: 9.6 kbit/s through 12 Mbit/s selectable on PROFIBUS-DP.
I/O configuration
The I/O configuration for the CAN (Control Area Network) field bus is
accomplished with the aid of the WinCAN Configuration & Diagnostic
Tool.
Data exchange
The data exchange between bus master image and peripheral devices is
limited to those slaves that have been configured. In addition to the data
exchange with peripherals, the exchange of SDO (Service Data Object)
data with the configured slaves is possible.
Data consistency
Data consistency is ensured for each slave (as per CAN specifications).
Peripheral errors
The CAN bus continues to operate with all slaves that are error-free,
whereas slaves with active peripheral errors are not served.
Properties
● CANopen protocol, to EN50235
● Max. 30 slaves
● Max. 512 bytes (4096 bits) each for inputs and outputs
● SDO (Service Data Object) data exchange
● Baud rates: 10 kbit/s through 1 Mbit/s selectable on CAN bus.
4.4 INTERBUS-S
I/O configuration
The INTERBUS-S provides two I/O configuration options:
● Physical addressing of inputs and outputs
● Process data description via the CMD software by Phoenix Contact.
⇒ For CL550 only: To load the I/O configuration into the bus master
ZS550-DP-IBS release level 4.5 or higher of the Phoenix Contact
CMD software is required. Here, the CMD software can act in both
modes, physical addressing as well as process data description. As
an interface module for the CL550, Type IBS PC 104 SC-T has to be
specified in the CMD software.
Data exchange
Data exchange in the PCL for INTERBUS-S is limited to the input range of
I0 through I511, and the output range from O0 through O511. Higher
addresses can not be used!
In the CL550 it is limited to the input range of I0 through I1023, and the
output range from O0 through O1023. Max. 512 bytes inputs/outputs can
be occupied.
Data consistency
When starting WinPanel, byte consistency can be selected in the PCL
with the use of the /Y4 start parameter. Without this entry, data
consistency is selected for the entire I/O range by default.
Peripheral errors
In the event of peripheral faults on the bus, an attempt to restart
INTERBUS-S operation will be made at each STOP/RUN switchover!
The intervals shown in the table were measured directly at the input
and/or output of a B~IO 16DI/16DO Digital I/O Compact Module, and
therefore also contain the input delays for transitions from LOW " HIGH
(approx. 3.5 ms), and from HIGH " LOW (approx. 1.5 ms).
Task:
5. Programming Basics
Programmable memory controllers process a program whose code
describes the controller task. This is accomplished with the use of special
programming languages that can be represented and printed out in
various modes.
5.1 Programming
Examples
U I0.0
U W -Name ,A
L B O0 ,B
T D C , M12
MUL W 1234 ,D
All modules are enabled by being invoked and/or activated in the course
of program processing. This may occur unconditionally or dependent on a
condition. The condition may be the result of a linking or compare
operation or arithmetical operation.
OM8 Module that is called upon shutdown; here the application can be
brought to a defined state.
OM30-OM63 reserved
The OM1 module must be concluded with either the EP (end of program)
or EM (end of module) instruction to ensure subsequent processing of the
input/output cycle (I/O state). With the exception of the OM2, all other
organization modules can be concluded with either EP or EM, depending
on the respective tasks being carried out.
Start,
startup,
initialization
Application
program
processing
I/O state,
In the event that the user avails himself of program module calls from
within time OMs, he should disable any other time-controlled
processes,also see Section 5.16, Time Controlled Interrupts
⇒ When using the OM8 shutdown module (see also Section 5.12,
Shutdown module (PLC only)), the cycle time is disabled while the
module is processed. However, the hardware still remains active
during OM8 processing.
Remanent operands are saved to hard disk even if the hardware cycle
time in the OM8 has expired (timed out. As a prerequisite, the UPS must
be appropriately equipped.
Fixed inputs
Prior to entering the OM1 of the PLC program, the loaded status (input
image) is covered by the fixation mask. As a consequence, all input
queries return the status taken from the fixation mask.
Fixed outputs
Prior to entering the OM1 of the PLC program, the output status (output
image) is covered by the fixation mask. As a consequence, all process
outputs have the status imposed by the fixation mask. However, the
queries within the PLC program will return the fixed status only until the
program overwrites the outputs.
Fixed markers
Prior to entering the OM1 of the PLC program, the status of the markers
from the preceding PLC cycle is covered by the fixation mask. However,
the queries within the PLC program will return the fixed status only until
the program overwrites the markers.
Startup modules
Two startup modules, OM5 and OM7, are available to handle the
program start. If a startup module is linked with the PLC program, it will
be automatically processed during the startup routine of the controller.
Program loading
Program loading is followed by processing the OM7. In conjunction with
the two trigger pulses, this facilitates the selection of any possible startup
option.
A cycle time ceiling that can be software defined via OM2, DW2/DW5 has
not yet been implemented in the startup modules. This means that the
startup modules permit the starting and processing of initialization
routines that are independent of cycle time monitoring.
In the event that, during the processing of startup OMs, program modules
are called, the close instructions of such program modules will have the
established meaning:
EM: Return to the startup module that included the call.
EP: Cancel, continue with OM1.
Program
EM
CM 2nd DM 2. DM
EM
→ PM2
CM PM2 → PM3
← CM PM3,2
P0 I1 A P0
P1 O1 = P1
←
CM PM3,2 EM
P0 I10
P1 O10
←
EM
→ PM4
CM PM4 → PM5
← CM PM5 → PM6
← CM PM6
EM ←
EM
PE EM
↑ I/O state
← Module nesting depth →
Level 1 2 3 4 .....n.... 63
Program
EM
Program
EM
Program
EM
Deviations from the preselected system defaults are declared in the OM2
through manipulation of the entered values. It is essential that the user
neither removes nor adds DEFW instructions.
This may be used for example, to shift remanence limits, set cycle time
limits, etc.
The time matrix definition for the time OMs is also handled in the OM2.
The declarations and definitions stored in the OM2 are adopted by the
system upon Power-ON or in the case of a STOP/RUN command, even
before processing a startup OM that may be present; a part of the OM2 is
copied into the system area.
;*************************************************************************
;*** ***
;*** I N I T I A L I Z A T I O N T A B L E ***
;*** ***
;*** 'P C L' S O F T P L C ***
;*** ***
;*************************************************************************
;*** Last modification: 25.04.00, zi ***
;*************************************************************************
;
;*************************************************************************
; OM2 : PCL - Initialization table
;*************************************************************************
;
; - Must be integrated in each application program
; that uses different default settings.
;
; - If no OM2 entry is made in the symbol file,
; default settings will be used.
;
; I M P O R T A N T N O T E , please observe in any case
; ============================================================
;
; Each change of data words (W) in forbidden address ranges
; ====
; may result in undefined PLC system performance.
;
;*************************************************************************
;
;DW 1: empty
;--------------
DEFW W 16#0000
;
;DW 4: empty
;--------------
DEFW W 16#0000
;
;
; !!! Internal system memory data !!!
; ===========================================
;
; The following default settings must not be changed.
; ===================================================
;**************************************************************************
EM
;*************************************************************************
;*** ***
;*** I N I T I A L I Z A T I O N T A B L E ***
;*** ***
;*** 'Z S 5 5 0' ***
;*** ***
;*************************************************************************
;*** Last modification: 25.04.00, zi ***
;*************************************************************************
;
;*************************************************************************
; OM2 : ZS550 – Initialization table
;*************************************************************************
;
; - Must be integrated in each application program
; that uses different default settings.
;
; - If no OM2 entry is made in the symbol file,
; default settings will be used.
;
; I M P O R T A N T N O T E , please observe in any case
; ============================================================
;
; Each change of data words (W) in forbidden address ranges
; ====
; may result in undefined PLC system performance.
;
;*************************************************************************
;
;DW 1: empty
;--------------
DEFW W 16#0000
;
;**************************************************************************
EM
Examples
; Check module attendance
;-------------------------
; Checks for the existence of modules OM8, DB8, and FC8.
; direct addressing
A OM8 ; OM8 present?
A DM8 ; DB8 present?
A FC8 ; PM8 present?
; indirect addressing
L D 8,A ; load module No. in register A
A OM[A] ; OM8 present?
A DM[A] ; DB8 present?
A PM[A] ; PM8 present?
Examples
; Extract module size
;---------------------
; Extracts module lengths of modules OM8, DM8, and PM8.
; direct addressing
L D OM8,A ; size of OM8 in register A
L D DM8,A ; size of DM8 in register A
L D PM8,A ; size of DM8 in register A
; indirect addressing
L D 8,A ; load module No. in register A
L D OM[A],B ; size of OM8 in register B
L D DM[A],B ; size of DM8 in register B
L D PM[A],B ; size of PM8 in register B
Examples
; Read module start address
;----------------------------
; Extracts module start addresses for modules OM8, DB8, and F8.
; direct addressing
L D &OM8,A ; start address for OM8 in register A
L D &DB8,A ; start address for DB8 in register A
L D &FC8,A ; start address for FC8 in register A
; indirect addressing
L D 8,A ; Baustein-Nr. in Register A laden
L D &OM[A],B ; start address for OM8 in register B
L D &DM[A],B ; start address for DB8 in register B
L D &FC[A],B ; start address for FC8 in register B
The user can employ a special instruction to evaluate this data. The
function of this instruction is explained in the following example.
Example
; Write module header contents on marker
;-----------------------------------------
; 20 bytes of the FC100 module header shall be stored
; from marker M20 and up.
The user can utilize this command sequence to read the module header
information of OMs, PMs and DMs. It should be noted that DMs do not
feature version identifiers in the module header, i.e., the respective bytes
have a content of = 0.
During OM8 processing, inputs can be read directly from the dual-port
RAM of the bus master, and outputs can be written to that location.
⇒ Please note that the hardware watchdog (approx. 2.5 sec) comprises
strictly a security function, and that it will terminate the PLC
program processing with instant effect. For this reason, the user
must ascertain that the processing time of the OM8, when
processed with the use of a program loop, does not exceed this
interval length. However: Even if the hardware watchdog times out,
this is in any case followed by a backup of the remanent data.
The triggering criteria are defined errors that can be interpreted by setting
a special marker bit in SM14 / SM15 and in SM28 / SM29.
Upon calling the OM9, the cycle time monitoring function is restarted with
the defined value (definition in OM2 or default value of 1.5 sec). While the
module is being processed, countermeasures for possible error
occurrences can be programmed.
For example, certain data, including the special error markers, can be
moved to nonvolatile areas.
Once the OM9 error module has been processed, the PCL enters STOP
mode.
5.14 Fixation
The PCL provides the option to fix operands.
Remanence of fixation
An existing fixation is retained in the following cases:
• Always after a STOP/RUN change in operating mode.
• Always after reloading.
• Always after Power-Off/On cycle.
;
CM -SOLL_IST,5
;
; +--------------------+
P0 -Start ; | BOOL VAR_INPUT | Start of function
P1 W -Sollwert ; | WORD VAR_IN_OUT | Expected piece count
P2 W -Istwert ; | WORD VAR_INPUT | Current piece count
P3 -Soll_Ist ; | BOOL VAR_IN_OUT | Nominal value attained
P4 -keinErg ; | BOOL VAR_OUTPUT | No valid reading
; +--------------------+
+-----------------------------------------------------------------------+
!Parameter header
+-----------------------------------------------------------------------+
P0 BOOL Start VAR_INPUT Start of function
P1 WORD Sollwert VAR_IN_OUT Expected piece count
P2 WORD Istwert VAR_INPUT Current piece count
P3 BOOL Soll_Ist VAR_IN_OUT Nominal value attained
P4 BOOL keinErg VAR_OUTPUT No valid reading
+ ----------------------------------------------------------------------+
! Program module file
+ ----------------------------------------------------------------------+
; Compare values
A -Start P0 Start of function
JPCI keinVergleich
L W -Sollwert,A P1 Expected piece count
CPLA W -Istwert,A P2 Current piece count
A Z ; Result=0 -> values are equal
= -Soll_Ist P3 Nominal value attained
R -keinErg P4 No valid reading
keinVergleich:
EM
For each time the timer OM is called, the following must be true:
1. The designated time interval has expired.
2. Sequential processing has reached a change of module.
Within the group of timer interrupts, the highest priority is given to the
interrupt that is assigned to the lowest OM number.
To perform the actual enabling of the interrupts declared in the mask, the
additional instruction EAI (Enable All Interrupts) must be issued. A
general disabling of the interrupts without influencing the mask is
accomplished with the DAI (Disable All Interrupts) instruction.
When the interrupt is disabled, the bit remains in the interrupt register,
and the interrupt awaits its being enabled.
The interrupt register can be loaded with the use of the LAI (Load All
Interrupts) instruction, and active interrupts can be deleted with the RAI
(Reset All Interrupts) instruction.
Example
PUSH A ;Shift contents of register A to applic. stack
PUSH B ;Shift contents of register B to applic. stack
PUSH C ;Shift contents of register C to applic. stack
PUSH D ;Shift contents of register B to applic. stack
Both application stack (AST) underflow and overflow conditions will cause
the central processing module to enter STOP mode, returning an error
message pointing to the cause of the error.
6. Addressing Conventions
A, B, C, D Standard arithmetical X, B, W, D, R, L
registers
I I[R] Input Image/ in I/O state
X, B, W, D, R, L
Q Q[R] Output Image/ in I/O state
X, B, W, D, R, L
M M[R] Marker X, B, W, D, R, L
SM SM[R] Special marker X, B, W, D, R, L
T T[R] Timer X (status), W (value)
C C[R] Counter X (status), W (value)
D D[R] Data word, 1st current DM X, B, W, D, R, L
DX DX[R] Data word, 1nd current DM
DB DB[R] Data buffer X, B, W, D, R, L
DF DF[R] Data field X, B, W, D, R, L
S S[R] System data range X, B, W, D, R, L
P P[R] Parameter X, B, W, D
FI FIFO max. 512 bytes
TI Time-controlled interrupt
b#www Constant X, B, W, D, R, L
DM DM[R] Data module CM DMnn ; calls 1st DM
BX DMnn ; calls 2nd DM
PM PM[R] Program module
In the above enumeration, R is replaced by X = bit, B = byte, W = word,
the register IDs A, B, C or D. D = double word, R = REAL, L = LREAL
Module list
The PCL manages the following modules:
The unused addresses are reserved for internal system functions, and
may not be changed.
Segments of the system area are used by default function modules which
make data available that is also used by other PLC program parts.
Example: Date and time.
The unassigned addresses in the system area are reserved for internal
purposes, and may not be modified.
S120
S122 Field bus type 1: PROFIBUS-DP, 2: CAN, 3: INTERBUS S
S124 I-size I/O information
S126 O-size
S128 Hardware / software version
S510
Bit Explanation
0 BMF Bus master fault
1 KSD Classified slave diagnostics
2 SD Slave diagnostics / System diagnostics
3 Reserved
4 Init Init phase: Waiting until periphery is operation-ready, or until
PLC STOP time has elapsed.
5 BmClab Bus master has switched DP bus to CLEAR status: BmClab
= [SNE ∨ SKF ∨ SNB] & Error_Action_Flag = 1. The timing
for the restart after the remedy of BmClab causes can be
controlled by the PLC program.
6 PgStop Programming Unit keeps DP bus in STOP state.
7 Aktiv Active ID
8 SNE One or more slaves are not reachable on the bus.
9 SKF One or more slaves report configuration errors.
10 DPS One or more slaves report static diagnostics.
11 EXD One or more slaves report extended diagnostics.
12 SNB One or more slaves not ready for cyclical data exchange.
13 SF One or more slaves report error of another type.
14 reserved
15 reserved
The bits Init, BmClab, and PgStop are not relevant to the PLC program
because, in the RUN state of the PCL, they always have the value 0..
The individual error types for the KSD are indicated in bits 8 though 13 of
the DP status word.
The KSD messages for each slave are saved in the status words range
from S256 to S351.
The SD bit in the DP status word represents the OR link of all system
diagnostics bits. Therefore, when SD = HIGH, at least one slave reports
diagnostics.
Active ID
This bit must always have a value of 1. If this is not the case, this
indicates a fatal error in the bus master software.
Bit
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
31 2523 1615 87 3 0
Byte = B
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
31 25 23 16 15 8 7 0
This addressing mode differentiates between load and transfer
instructions:
Load instruction
The source operand may be either the even-numbered (LOW) byte or the
odd-numbered (HIGH) byte. In the case of the destination operand
(register), the LOW byte is always addressed.
Examples
L B M1,A
M0
HIGH byte LOW byte
Register A
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
L B M2,A
M2
HIGH byte LOW byte
Register A
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
Transfer instruction
For the source operand, the LOW byte is addressed. The destination
operand (DEST_OPD) may be both the even-numbered (LOW) byte and
the odd-numbered (HIGH) byte.
Examples
T B A,M1
Register A
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
M0
HIGH byte LOW byte
T B A,M2
Register A
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
M2
HIGH byte LOW byte
Word = W
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
31 25 23 16 15 8 7 0
Without exception, for the Load instruction, the specified byte and its
subsequent byte are loaded into the LOW word of the Register (32-bit);
the HIGH word of the Register remains unchanged.
Without exception, for the Transfer instruction, the specified byte and its
subsequent byte are loaded into the LOW word of the Register (32-bit).
M2
HIGH byte LOW byte
Register A
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
Double word = D
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
31 25 23 16 15 8 7 0
For double word processing when loading or transferring, the base byte
address, which must be divisible by 4, is always specified.
Loading always requires the base byte and the following 3 bytes to be
loaded into the specified Register (32-bit).
Transferring always requires the base byte and the following 3 bytes from
the specified Register (32-bit) to be written to.
Examples
L D M4,A
M6 M4
HIGH byte LOW byte HIGH byte LOW byte
Register A
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
T D A,M4
Register A
HIGH word LOW word
HIGH byte LOW byte HIGH byte LOW byte
M6 M4
HIGH byte LOW byte HIGH byte LOW byte
Register A, B, C, D
31 24 23 16 15 8 7 0
HIGH byte LOW byte HIGH byte LOW byte
HIGH word LOW word
For operations that exceed the 32-bit format, the registers are combined
to form permanent register pairs.
Register pair A + B
31 24 23 16 15 8 7 0
Word 4 = HIGH word B Word 3 = LOW word B
Word 2 = HIGH word A Word 1 = LOW word A
Register pair C + D
31 24 23 16 15 8 7 0
Word 4 = HIGH word D Word 3 = LOW word D
Word 2 = HIGH word C Word 1 = LOW word C
Status bits
N O C Z
Zero
Carry
Overflow
Negative
Reading
Byte / Word / I, O, M, T, C and P for T/C, actual values apply
Double word / REAL / LREAL K, DF, DB, D, DX, SM, S
Writing
Byte / Word / A, M, P P writing, depending on assigned operand
Double word / REAL / LREAL DF, DB, D, DX, S
Register A
Register C
Register D
Example
Register A
Register B
Register C
Register D
Example
Register B
Register C
Register D Peripherals
Example
A P3 ;I7.3
A P4 ;Status of T2
A P5 ;Status of C13
= P6 ;O10.0
Direct addressing
In direct addressing, addressing limits are determined by the operand
attribute.
Operand B W D R L
M0 x x x x x
M1 x
M2 x x
M3 x
M4 x x x x
M5 x
M6 x x
M7 x
M8 x x x x x
Indirect addressing
Indirect addressing is subject to the same addressing limits as direct
addressing.
Example:
Parameterized addressing
Parameterized addressing is subject to the same addressing limits as
direct addressing.
Example:
7. Instruction List
Examples
U I0.0
U W -Name ,A
L B O0 ,B
T D C , M12
MUL W 1234 ,D
7.2 Flags
The flags are influenced by the following instruction groups:
Starting the nonremanent starting timers SP, SPE, SR and SRE requires
a positive transition of the timer start condition. However, they are started
also if the start condition, at the time of first addressing (1st PLC cycle)
equals 1.
In the case of remanent timers, the flank marker is retained, i.e., whether
a 1 will start the timer at the time of first addressing (1st PLC cycle) after
startup or restart, depends on the start condition prior to STOP or Power-
OFF.
In the case of the start time as falling delay, a 0 will not start the timer
during the initial processing. Predefining the timer start condition with 1 is
possible as early as in the startup OM, provided that the information
about remanence characteristic (see Section on Remanence
Characteristics) is considered.
The timers are decremented in the I/O state. A timeout is thus recognized
only in the I/O state, and not during the program cycle!
The timer starts immediately upon a positive transition of the timer start
condition.
Example:
Start condition
Reset condition
Start condition
Reset condition
Start condition
Reset condition
Start condition
Reset condition
Timer status ← t → ← t →
Start condition
Reset condition
In advance of the reset, the required counter content is loaded into the
register being used.
The counter status for logical links depends on the counter content. For
counter contents > 0, the status is = 1 (HIGH); counter content = 0 will
have status = 0 (LOW).
Also, for reasons of compatibility, the purely logical CPL instruction was
implemented; it is used to map binary result queries also in special
markers.
The logical compare operation regards the bytes, words, or double words
to be compared as unsigned integers, i.e., as "unsigned 8", "unsigned
16", or "unsigned 32".
Examples:
⇒ The special markers that are influenced only by the CPL instruction
will remain unaffected until the next CPL instruction.
In the event that the status of inputs is to be loaded directly from the dual-
port RAM of the bus master during the program cycle, this status must be
loaded into the image with the use of the load instruction LD before the
load instruction L is issued.
LD E[A],[B] Load I statuses into image (start address in A), byte* count in
B.
In the event that the statuses of outputs are to be sent directly to the
dual-port RAM of the bus master during the program cycle, the TD
transfer instruction will be used.
By way of illustration, a 4-bit number (nibble) is used here; the nibble data
format ("tetrade") is not supported by the controller.
0 1 1 0 positive number 6
1 0 0 1 Negation, one's complement
+ 1
1 0 1 0 Two's complement = negative number 6
1111 0000
-1 0
1110 0001
-2 +1
1101 0010
-3 +2
1100 0011
-4 +3
1011 negativ positive 0100
-5 e +4
1010 0101
-6 +5
1001 0110
-7 +6
1000 0111
-8 +7
Logical SHIFT
MSB LSB CY
SLR B,n
o→ o • → • → o
MSB LSB CY
SLL B,n
• ← • o ←0 o
↓ ↑
→
Arithmetical SHIFT
All bits being vacated are filled up with the contents of the MSB.
MSB LSB CY
SAR B,n
• → • → • → o
In the case of shift operations exceeding one space (n > 0), the overflow
bit is set HIGH after a "1" was shifted through CY.
Rotate RIGHT
MSB LSB CY
ROR B,n o • → • o
↑ ←--- ↓ → ↑
Rotate LEFT
MSB LSB CY
ROL B,n
• ← • ο o
↓ → ↑ → ↑
Rotate RIGHT THROUGH CARRY
MSB LSB CY
RCR B,n
ο • → • → ο
↑ ←--- ↓
Rotate LEFT THROUGH CARRY
MSB LSB CY
RCL B,n
• ← • ο ← ο
↓ → ↑
In the case of a rotation by more than one space, the following applies:
• The overflow bit goes HIGH when a 1 has been rotated through CY.
• The negative bit goes HIGH when the MSB contains a 1.
MSB: Bit 7 when OPA = B
MSB: Bit 15 when OPA = W
MSB: Bit 31 when OPA = D
ADC OPA C, A sg A
+
sg C
+
CY
=
sg A
HIGH DW
ADC D C, A sg A
+
sg C
+
Cy
=
sg A
SBB OPA C , A sg A
-
sg C
-
CY
=
sg A
HIGH DW
SBB W C, A sg A
-
sg C
-
CY
=
sg A
Double-word multiplication
31 0
MUL D B, A ; SRC-D sg B
x
; DEST-D sg A
=
; DEST-D A
and
; DEST-D sg B
+1
In division, the dividend always occupies the double width of the divisor.
Double-word division
63 32
DIV W C, A ; DEST-D sg B
+1
31 0
; DEST-D A
31 : 0
; SRC-D sg C
=
; DEST-D sg A: Quotient
; DEST-D B: Rest
+1
Two data formats, REAL and LREAL, are defined in accordance with
IEC1131.
When calculating with the REAL data format, inaccuracies in the decimal
range will occur sooner than with the LREAL format. If a high degree of
accuracy is required, the LREAL format should be used. The appropriate
conversion routines are available in WinSPS v2.4 with WinPanel, v1.5
and higher.
Operands
Depending on the instruction, the following may be used as floating-point
operands:
• M, S, DM, DF, D, DX
with both direct and indirect addressing.
The specified operand address must be divisible as follows: - by 4 for
REAL data format REAL
- by 8 for LREAL data format.
• K, register
• P
A PM parameter may not be used as a floating-point constant. In the
event that this is required, the constant may first be loaded into a
marker word, for example.
Instructions
The floating-point data formats and operands may be used in the
following instruction types:
• LOAD floating point value
• TRANSFER floating point value
• CONVERT
• COMPARE floating point values
• Basic arithmetic functions
• Forming absolute value
• Extracting square root
• Logarithmic functions
• Trigonometric functions
Examples:
For large numbers at high resolution the LREAL data format must be
used.
The instructions handling the four basic arithmetic functions offset the
contents of the destination register or register pair against the contents of
the SRC operand. The results are always written to the destination
register or register pair.
7.19.10 Exponentiation
Y
For exponentiation X , the following procedure is used:
• In REAL format, registers A and C are used, with register A holding
the base, and C the exponent. The result is written to register A.
• In LREAL format, register pairs AB and CD are used, with AB holding
the base, and CD the exponent. The result is written to register pair
AB.
Realisiert sind:
• Natural logarithm
• Base-10 logarithm
• Forming exponential function from base-10 (common) logarithm
Realized are:
• Sinus, with entry in radian measure
• Cosine, with entry in radian measure
• Tangent, with entry in radian measure
• Arc sine, main value
• Ant cosine, main value
• Arc tangent, main value
7.21 Local Symbol Names & Auxiliary Markers for Program Tracking
Example:
PLC program
JP End
PLC program
JP End
:
:
:
:
:
Zieln: ;Program part n
PLC program
JP End
:
:
End
PLC successor program
:
Two data modules may be kept enabled at the same time. For this
purpose the following module calls are available:
CM, BAB, BAI DMx: enables DMx as 1st DM
BX, BXB, BXI DMy: enables DMy as 2nd DM
Exception: In the event that register contents are written to or read from
FIFO buffers, the number of bytes will be defined via the operand
attribute W/BY. Accordingly, operand attribute BY = one byte; operand
attribute W = two bytes.
The FIFO buffer is flushed with the RFI (Reset FIFO) instruction.
Block transfer
Block transfers are accomplished by shifting data block of defined size, whereby
the data block may not overlap. Block transfers use only ascending addresses
(incremental).
Example 1
CM DM10 ; 1st DM
BX DM9 ; 2nd DM
L D 50,C ; Block size = 50
BLT W D20,DX40 ; Copy 50 words, from DM9/D20 up, to DM10/D40.
Example 2
L D 50,A ; DEST address offset
L D 50,B ; SRC address offset
L D 50,C ; Block size = 50
BLT D DF[B],M[A] ; Copy 50 double words, from DF50 up, to M50.
Block COMPARE
The function compares two data blocks.
When the compare condition is met, processing is stopped, and the
number of uncompared bytes/words written to register C. When using
prefix addressing, the operand addresses too are output to registers a
and B.
The zero flag goes HIGH when the compare conditions were not met
throughout the entire range.
OPP Explanation
Compare Forward operation for the following:
CFZ Equal
CFN Unequal
CFAG Arithmetical greater
CFM Arithmetical less
CFLG Logical greater
CFCY Logical less
CFCN Logical greater or equal
CFCZ Logical less or equal
Compare Backward operation for the following:
CBZ Equal
CBN Unequal
CBAG Arithmetical greater
CBM Arithmetical less
CBLG Logical greater
CBCY Logical less
CBCN Logical greater or equal
CBCZ Logical less or equal
DEST block address direct or in register A, SRC block address direct or
in register B, block size always in register C.
Example 1
CM DM10 ; 1st DM
L D 50,C ; Block size = 50
CFLG W D20,M20 ; Compare forward 50 words f. Logical Greater,
; starting at DM10/D20 with marker from M20 up.
Example 2:
L D 50,A ; DEST address offset
L D 50,B ; SRC address offset
L D 50,C ; Block size = 50
CBZ D DF[B],M[A] ; Compare backward 50 double words for Equal,
; starting at DF50 with marker from M50 up.
Block search
The function searches for a character within a data block.
When the character is found, the number of bytes/words that were not
searched is stored in register C. With the use of prefix addressing,
register A will also contain the operand address.
If the character was not found (search condition not met) throughout the
entire range, the zero flag goes HIGH.
OPP Explanation
Search Forward for character:
SFZ Equal
SFN Unequal
SFAG Arithmetical greater
SFM Arithmetical less
SFLG Logical greater
SFCY Logical less
SFCN Logical greater or equal
SFCZ Logical less or equal
Search Backward for character:
SBZ Equal
SBN Unequal
SBAG Arithmetical greater
SBM Arithmetical less
SBLG Logical greater
SBCY Logical less
SBCN Logical greater or equal
SBCZ Logical less or equal
Block start address direct or in register A, search values as constants or
in register B; block size always in register C.
Example 1
L D 50,C ; Block size = 50
SFLG B 35,M20 ; Search forward 50 bytes, starting at M20,
; for the value 35.
Example 2
CM DM10
L D 10,C ; Block size = 10
L D 50,B ; Search value
L D 20,A ; DEST address offset
SRZ D B,M[A] ; Search backward 10 bytes , starting at M20,
; for the value 50.
In the case of markers and the data field, specific areas of the defined
remanence area (Offset, Number in table below) can be specified for the
backup / loading procedures.
8. Processing Times
• WinPanel startup with fixed default cycle time. The PLC cycle time can
be preset to a fixed value. This is accomplished by means of one of
the WinPanel startup parameters, i.e., WinPanel/Zn, where n is the
value in ms. In this context, care must be taken that the actual PLC
processing time is smaller than the selected value because otherwise
the preselected cycle time will be exceeded. See Example 5.
• I/O image transfer time to bus master. The image transfer time to the
bus master handling the decentralized peripherals is approx. 1 ms.
This time value is integrated in the PLC processing time in the
following sample diagrams.
⇒ Default setting:
System clock = 1 ms, share in Windows calc-time = 50 %. In normal
circumstances these values do not require user modification. Only
in the event that a specific application necessitates another setting
– because significantly more calc-time is required for Windows
applications – should these values be changed.
When using an integration of the MMI-MADAP and the PCL in the
same device, the following settings have produced good results:
System speed = 5 ms, Windows calc-time ratio = 50 %.
Die SPS-Zykluszeit ist als die Zeit definiert die von einem
Programmanfang bis zum nächsten vergeht.
System clock
OM1 ... ... I/O image Windows calc-time OM1 ...
PE
PLC
Windows
← <75 % →
Next PLC Next PLC
cycle cycle
A more critical controller behavior occurs when the PLC processing time
exceeds this 75% limit. In this case, all settings must be optimized.
Example 1
Preconditions:
• System clock = 2 ms
• System clock / Windows clock ratio = 3/1
• PLC processing time = 1.2 ms
← 2 ms →
1 2 3 4 5 6 System clock
PLC
Windows
Next PLC Next PLC Next PLC Next PLC Next PLC
cycle cycle cycle cycle cycle
The PLC program finishes in time, and Windows is given sufficient time
for processing Windows applications.
Example 2
Preconditions:
• System clock = 2 ms
• System clock / Windows clock ratio = 3/1
• PLC processing time = 1.6 ms
← 2 ms →
1 2 3 4 5 6 System clock
PLC
Windows
<25%
for
Windo Next PLC Next PLC
ws cycle cycle
The length of the PLC processing time exceeds 75% of the system clock
rate.
In this case, a stipulation takes effect stating that >25% of the system
clock rate must be provided for Windows applications. Because this is not
the case, there remains insufficient time for processing Windows
programs, and an additional pulse for Windows is inserted. In this
example, the system clock / Windows clock ratio of 1/3 has no effect.
Example 3
Preconditions:
• System clock = 2 ms
• System clock / Windows clock ratio = 3/1
• PLC processing time = 2.2 ms
← 2 ms →
1 2 3 4 5 6 System clock
PLC
Windows
2 ms PLC 0.2 ms leftover
processing time PLC processing
time Next PLC cycle
← 25 % PLC → ← 75 % Windows →
The PLC program takes longer than the selected system clock speed.
Upon conclusion of the first system cycle, Windows receives 3 cycles for
processing. The remainder of the PLC program is processed during the
5th system cycle. The next PLC cycle will start only in the 6th system
cycle. In this example, the system clock / Windows clock ratio of 3/1
takes effect.
Example 4
Preconditions:
• System clock = 2 ms
• System clock / Windows clock ratio = 3/1
• PLC processing time = 5.6 ms
← 2 ms →
1 2 3 4 5 6 System clock
PLC
Windows
5.6 ms PLC processing time
Next PLC cycle
← 75 % PLC → ← 25 % Windows →
The PLC program takes longer than the selected system clock speed.
Upon conclusion of the first system cycle, Windows receives 1 cycle for
processing. The next PLC cycle will start only in the 5th system cycle. In
this example, the system clock / Windows clock ratio of 3/1 takes effect.
Example 5
Preconditions:
• System clock = 2 ms
• System clock / Windows clock ratio = 1/1
• Fixed predefined PLC cycle time = 20 ms, WinPanel start parameter
/Z20
• Actual PLC processing time = 3.0 ms
← 2 ms →
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 System clock
PLC
Windows
2 ms PLC 1 ms Windows, until predefined time has elapsed.
processing leftover
time PLC Next PLC
processi cycle
ng time
The PLC program takes longer than the selected system clock speed.
Upon conclusion of the first system cycle, Windows receives 1 system
cycle for processing. The remainder of the PLC program is processed
during the 3rd system cycle. At the end of this interval, Windows is able
to use the CPU performance until the 20 ms have elapsed. In this
example, the system clock / Windows clock ratio of 1/1 takes effect.
9. Sample Programs
nicht_fertig:
; Check DMs and write results
U DM[A] ; Check DM, indirect module attendance check
= D[B] ; If applicable, set attendance bit HIGH, ind. bit addressing.
PUSH D A ; Save DM no.
L D DM[A] ; Load DM size, indirect module length verification.
T W A,D[C] ; Write to size word, indirect double word addressing
POP D A ; Write back DM no.
; Increment address
INC D A,1 ; next DM
INC D B0.1 ; next DM attendance bit
INC D C0.2 ; next DM size word
; All 16 predefined DMs processed?
CPLA D 16,A
JPCZ nicht_fertig; Jump on less than or equal
EM
; 2. Range/area monitoring
;------------------------
Bereich_niO:
(range NOK) ; Delete markers M0-M1 and counter C0 via trigger pulse
U -RI_Anl
JPCI kein_RI
L D 0,A ; Write value 0
T W A,M0 ; ... to markers M0-M1
SC A,Z0 ; ... and T0
T D A,M4 ; ... on markers M4-M7
kein_RI:
EM
;Delete FIFO:
A -RFI ; Delete locked?
JPCI noreset
A B -log1
R B -RFI ; Lock delete sequence to prevent repeat execution of same.
noreset: