Responding To Non-Fatal Errors; Designing Your Program To Detect Non-Fatal Error Conditions - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Responding to Non-Fatal Errors

Non-fatal errors can degrade some aspect of the CPU performance, but they do
not render the CPU incapable of executing your program or updating the I/O. As
shown in Figure 4-25, you can use STEP 7-Micro/WIN 32 to view the error codes
that were generated by the non-fatal error. There are three basic categories of
non-fatal errors:
Run-time errors. All non-fatal errors detected in RUN mode are reflected in
special memory (SM) bits. Your program can monitor and evaluate these bits.
Refer to Appendix C for more information about the SM bits used for reporting
non-fatal run-time errors.
At startup, the CPU reads the I/O configuration and stores this information in
the system data memory and in the SM memory. During normal operation, the
I/O status is periodically updated and stored in the SM memory. If the CPU
detects a difference in the I/O configuration, the CPU sets the
configuration-changed bit in the module-error byte; the I/O module is not
updated until this bit is reset. For the CPU to reset this bit, the module I/O
must again match the I/O configuration stored in the system data memory.
Program-compile errors. The CPU compiles the program as it downloads. If the
CPU detects that the program violates a compilation rule, the download is
aborted and an error code is generated. (A program that was already
downloaded to the CPU would still exist in the EEPROM and would not be lost.)
After you correct your program, you can download it again.
Program execution errors. Your program can create error conditions while the
program is being executed. For example, an indirect-address pointer that was
valid when the program compiled may be modified during the execution of the
program to point to an out-of-range address. This is considered a run-time
programming error. Use the dialog box shown in Figure 4-25 on page 4-43 to
determine what type of error occurred.
The CPU does not change to STOP mode when it detects a non-fatal error. It only
logs the event in SM memory and continues with the execution of your program.
However, you can design your program to force the CPU to STOP mode when a
non-fatal error is detected. Figure 4-26 shows a network of a program that is
monitoring an SM bit. This instruction changes the CPU to STOP mode whenever
an I/O error is detected.
Network 5
SM5.0
Figure 4-26
S7-200 Programmable Controller System Manual
A5E00066097-02
Basic Concepts for Programming an S7-200 CPU
When an I/O error occurs (SM5.0), go to STOP mode.
STOP

Designing Your Program to Detect Non-Fatal Error Conditions

4-45

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents