EN and ENO For Complex Operations: Simatic S7
EN and ENO For Complex Operations: Simatic S7
com
KKOOPP
AAWWLL
FFUUPP
EN and ENO In complex operations, such as multiplication or division, the BR bit of the
in complex status word is also used as an error bit. If, for example, the overflow bit (OV,
operations OVERFLOW-BIT) is set during multiplication, the output will be RLO = "0" and
ENO = 0 (BR = 0). The middle figure shows the implementation of this function
with an error message as an STL program.
Program as Program as
non-parameterizable parameterizable
block FC20 block
A I 1.2
R M 40.0
A I 1.3
FP M 40.1
S M 40.0
A M 40.0
A M 10.3
O
AN M 40.0
A I 1.3
= Q 8.3
(= Q 4.3)
Statement of the problem You must write a program for the message function as a parameterized block.
The figure shows part of the description section and part of the program. If
the instruction with an absolute operand was written, for example, as A I1.2, it
will now be written as A Quittieren.
2.
Call
FC 20
Statement of the problem Call FC 20 in OB 1 twice with different current parameters. Test the function.
Functional block FB 20
Statement of the problem For storing Flankenmerkers and Meldespeichers, static variable values
should be used, which are located in the DB instance belonging to the FB.
This has the advantage that markers do not need to be used for storage.
(A 4.3)
(A 4.4)
Content
Page
Selecting the operating mode ................................................................................................................ 2
Types of launch ....................................................................................................................... 3
Mode switch..................................................................................................................... Reset and new 4
start using the mode switch.................................................................... Selecting the operating 5
mode by software................................................................................... Reset with PG 6
.................................................................................................................... 7
Loading the User Program into the CPU . ... . ... 8
9
10
11
12
13
14
.......................................................................... 15
Example of a software error ............................................................................................... 16
Reading the Diagnostic Buffer .............................................................................................. 17
Interpreting Error Messages ........................................................................................... Opening an 18
Error Block ...............................................................................................……..… Exercise 5.3: Finding 19
Errors That Cause the CPU to STOP ........................................................... Exercise 5.4: Using Error 20
OBs ............................................................................... 21
Exercise 5.5: Estimating Battery Errors .......................................................................... 22
Exercise 5.6: Troubleshooting Logical Programming Errors.................................................... 23
Transitions between The reason for transitions between operating modes is commands in
operating modes the program or user intervention.
From RUN to STOP The transition "from RUN to STOP" is carried out in the following cases:
• Loading the user program into the CPU
• Loading hardware configuration into CPU
• CPU reset
• User memory compression
From STOP to RUN- This transition causes the CPU to process the startup OB100 and only then
NEW START change the operating mode to RUN. This transition is required in the
following cases:
From STOP to RUN- This type of transition can only be made by an S7-400 with an unchanged
RESTART program from the STOP mode. In this case, the CPU processes OB101 and only
then switches to RUN mode.
Processed by OB 100
PIQ is removed (parameterized)
Unblocking outputs
Yes
Specified time
STOR exceeded?
Reading PII
No
Unblocking outputs,
Processed by OB 1
PII reading
Introduction SIMATIC S7 has two types of start-up: new start and repeated start (the latter
only in S7-400 and the corresponding parameterization). During start-up, the
start-up OB 100 and OB 101 are processed, in which, for example, the
necessary preliminary actions are programmed.
During launch:
New start At a new start, the process display and the parameterized non-remanent
markers, timers and counters are first deleted. Then the program in OB 100 is
processed, if it exists. This is followed by a full cycle with reading of PII and the
beginning of processing from the 1st command in OB 1.
Restart The significant difference from a fresh start is that the process display,
markers, timers, counters are not deleted andsoftware processing continues
from where it was interrupted. After the end of the residual cycle, for safety
reasons, the display of the output process can be deleted (parameterized).
When automatically restarting after switching on the network, a time value can
be parameterized that defines the maximum network downtime. During this
time, a restart is possible. If it is exceeded, the CPU remains in the STOP state.
RUN-P
RUN
STOP
MRES
Indication The CPU switches from STOP to RUN mode if no errors are detected.
Reset Before switching to RUN mode after reset, a hardware test is performed. If
there is a MEMORY-CARD, the program is copied from it to the working
memory.
New start When a new start is made, the process mapping and non-remanent data are
deleted. Then, after reading the process mapping, a new cycle begins.
Show and change Using the programming device, the operating mode is displayed and
operating mode changed as shown below.
It makes no difference whether you are offline or online. Follow
these steps:
Introduction When the CPU is reset, all "old" blocks are deleted from memory. Reset can
only occur if the CPU is in STOP mode. The following actions are performed
during reset:
Download button
The user can load the entire
project or selected blocks into
the CPU. To do this, they need
to be marked
and press the button or select PLC-
>Download from the menu
Loading the programWhen testing a user program, it is often required that user
a separate block was loaded into the CPU in STOP or RUN-P mode.
If a program is loaded into the CPU in RUN-P mode, the CPU switches to
STOP mode if the block parameters have changed or if there is no called
block.
Function Individual blocks are always loaded into the boot memory (RAM), while
executable parts of blocks are loaded into the working memory.
CPU memory
Program-
motor
Loading...
Loading Working
zochnaya
programs memory
memory
In CPU RAM
Executable
parts
programs
RAM
Introduction With the Simatic Manager you can load a block or several blocks
simultaneously into the CPU. If the user program consists of more than one
block - OB, FC and FB -, the entire program must be loaded in the STOP
operating mode. This ensures that there are no problems such as loading a
block that calls another block that is not yet in the CPU. If all blocks are loaded
into the CPU, the CPU must be set back to the RUN operating mode.
Position of the CPU operating mode switch and boot capability (in
CPU):
• STOP position (CPU in STOP) All download options are
available
• RUN position (CPU to RUN) Upload not allowed
• RUN position (CPU in STOP) Upload not allowed
• Position RUN-P (CPU in STOP) All download options are
available
• RUN-P position (CPU in RUN) All download options are
available
S1 S2 S3
M1 Indicators
Motor H1 H2 H3 S4
Turning on The device is switched on by switch I 0.0 and switched off by I 0.1 Output Q 8.1
(Q 4.1) reports the status. The switched on device can then be set to the
operating mode: manual or automatic.
Manual mode The manual operating mode is selected by the signal state "0" in
works I 0.4 front in I 0.5. In manual mode, the product can be moved in the direction of the
last stage of installation using switch I0.2 or in the opposite direction using switch
I0.3, until the corresponding contact is closed. At the same time, indicator H1
flashes as a warning for the service personnel.
Filming and Removing the module in S4-400 STOP if the OB is not loaded errors
installation in RUN mode
modules in S7-
400
Type of error In the table you can see the different types of errors that can occur in the
SIMATIC S7 system.
Each of these errors represents a diagnostic event that generates a
diagnostic signal to the CPU. This results in the error being written to the
diagnostic buffer and in the CPU going into STOP mode if no error
organization block has been programmed.
OB errors With the help of the error OB, it is possible to determine the occurrence of an error. If there
is no error OB in the CPU, then in case of an error, the CPU goes to STOP.
Pick-up/Put-in signal The signal module is removed from the S7-400 in OB 831)
operating mode
Time Error By default (standard) the maximum cycle time is set to 150 ms. If the cycle
continues for more than 150 ms, a time error occurs. If this error occurs twice
in a row, the CPU goes into STOP.
Diagnostic Blocks with diagnostics, such as analog blocks, can generate an alarm signal
error in the event of an error.
The block must be parameterized in such a way that diagnostics must be
enabled.
· You can program the desired response into the error OB for this
error
Usage Please note the rules for using error organization blocks.
Statement of the problem As a result of battery failure, an error notification should occur on the
operator's console, and a notification should also occur after changing the
battery.
Description In case of power supply errors, for example, battery failure, the operating
system calls OB 81 once. After the error is corrected, OB 81 is called again.
Error notification should occur when the battery fails (incoming event) and
after the error is cleared (outgoing event).
Program structure
Error block
Software In the upper part of the figure you see the program structure of the
mistakes erroneous program. In OB 1 the function FC 1 is called.
In FC 1, the marker word MW 10 must be stored in the data block DB 10. The
data block DB 10 is not present in the CPU. Since there is no error OB, the CPU
goes into STOP mode.
Finding an error After an error occurs, open the diagnostic buffer. To do this, do: