Non-Fatal Errors And I/O Errors - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

Programming concepts
5.7 PLC error reaction
5.7.1

Non-fatal errors and I/O errors

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.
The following sample program shows a network of a program that is monitoring two of the
global non-fatal error bits and changes the CPU to STOP whenever either of these bits = 1.
Table 5- 3
Example logic for detecting a non-fatal error condition
LAD
Non-fatal errors are those indicating problems with the construction of the user program or
with certain instruction execution problems in the user program. I/O errors are those
indicating problems with the I/O of the CPU, signal board, and expansion modules. You can
use STEP 7-Micro/WIN SMART to view the error codes that were generated by the non-fatal
and I/O errors.
Click the PLC button from the Information section of the PLC menu ribbon strip, to see the
current error status of a PLC connected to STEP 7-Micro/WIN SMART.
Table 5- 4
Non-fatal error types
Description
Program-compile
The CPU compiles the program as it downloads. If the CPU detects that the program violates a
errors in the CPU
compilation rule, it aborts the download and generates an error code. (A program that was already
downloaded to the CPU would still exist in the permanent memory and would not be lost.) After you
correct your program, you can download it again.
I/O device errors
After power-up and after a system block download, the CPU verifies that the I/O configuration
stored in the system block matches the CPU, signal board, and expansion modules that are actual-
ly present. Any mismatch results in the generation of a configuration error for the device. During
runtime, devices can detect other I/O problems (such as missing user power or input value exceed-
ing limits) that cause the CPU to generate an I/O error.
The CPU stores module status information in special memory (SM) bits. Your program can monitor
and evaluate these bits. SM5.0 is the global I/O error bit and remains set while any I/O error condi-
tion exists.
Program execution
Your program can create error conditions during execution. These errors can result from improper
errors
use of an instruction or from the processing of invalid data by an instruction. For example, an indi-
rect-address pointer that was valid when the program compiled could point to an out-of-range ad-
dress if the program modified the pointer during execution. Modifying a pointer to an invalid address
is an example of a run-time programming problem. The CPU sets SM4.3 upon the occurrence of a
run-time programming problem. SM4.3 remains set while the CPU is in RUN mode.
The program can execute the GET_ERROR instruction (Page 356) to get the current non-fatal error
code and reset SM4.3 to OFF.
128
When an I/O error or a run-time error
occurs, go to STOP mode
STL
Network 1
LD SM5.0
O SM4.3
STOP
System Manual, V2.3, 07/2017, A5E03822230-AF
S7-200 SMART

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents