You are on page 1of 35

Troubleshooting

SIMATIC S7 Date: 04.03.2019


File: 10_.1
Categories of Errors

Errors Detected by the System


• Recording, evaluating and indicating
errors within a PLC
(as a rule: CPU STOP)
• Module failure
• Short-circuit in signal cables
• Scan time overrun
• Programming error (accessing a
non-existent block)

Functional Errors
• Desired function is either not executed at all
or is not correctly executed
• Process fault (sensor/actuator, cable defective)
• Logical programming error (not detected
during creation and startup)

SIMATIC S7 Date: 04.03.2019


File: 10_.2
STEP7 - Debugging Tools, Overview
Error

Error detected by the System: Functional fault:


General Rule: CPU in STOP General Rule: CPU in RUN
(such as accessing a non-existent DB) (process fault, such as a wire break)
(Diagnostic interrupt of a signal module) (logical programming error, like a double assignment)

Debugging Tools: Debugging Tools:


• Module Information • Enable Peripheral Outputs (modify outputs)
- Diagnostic buffer • Monitor / Modify Variable
- I STACK • Monitor Blocks (Block Status)
- B STACK • Reference Data
- L STACK - Cross References
• Hardware Diagnostics - Assignment of I/Q/M/T/C
- Program Structure
- Addresses without Symbols
- Unused Symbols
Regardless of the cause of the error you could use:
• Force
• Enable Peripheral Outputs
• Set Breakpoints

SIMATIC S7 Date: 04.03.2019


File: 10_.3
System Diagnostics - Overview

CPU diagnostics CPU I/O module


detects
a system
CPU error
diagnostics Diagnosti Diagnostics-
detects errors in the interru
c capable
user program pt module
detects an
error and
generates a
Erro Diagnosti System diagnostic
r c status interrupt
OB buffer list

CPU
message
s

SIMATIC S7 Date: 04.03.2019


File: 10_.4
Displaying CPU Messages

SIMATIC S7 Date: 04.03.2019


File: 10_.5
Calling the "Module Information" Tool
SIMATIC® Manager LAD/STL/FBD Editor

Module Information

SIMATIC S7 Date: 04.03.2019


File: 10_.6
Module Information Tab: "Diagnostic Buffer"

SIMATIC S7 Date: 04.03.2019


File: 10_.7
Interpreting Error Messages in the Diagnostic Buffer

SIMATIC S7 Date: 04.03.2019


File: 10_.8
Opening a Block Containing an Error

SIMATIC S7 Date: 04.03.2019


File: 10_.9
Diagnostics with I Stack, B Stack, L Stack
Block containing error
Program structure

Point of interruption

The B stack shows a list of the Point of interruption


blocks that were executed up
to the point of interruption.

You can see the contents of the You can see the values of the
accumulators, registers, status temporary variables at the
word etc. at the time of interruption
time of interruption in the L stack.
in the I stack.

SIMATIC S7 Date: 04.03.2019


File: 10_.10
Contents of the B Stack

SIMATIC S7 Date: 04.03.2019


File: 10_.11
Contents of the I Stack

SIMATIC S7 Date: 04.03.2019


File: 10_.12
Contents of the L Stack

SIMATIC S7 Date: 04.03.2019


File: 10_.13
Displaying the Hardware Diagnostics

twice

SIMATIC S7 Date: 04.03.2019


File: 10_.14
Calling the "Monitor/Modify Variables" Tool

SIMATIC S7 Date: 04.03.2019


File: 10_.15
Establishing Trigger Points for "Monitor/Modify Variable"

PII

Trigger point
"Beginning of Scan
Cycle"
Monitor / Update Status /
Set Modify Modify Values
Trigge depending on (one time monitor
r Trigger / modify)
setting
Cyclic
program
executio
n Trigger point
"Transition to
STOP"

Trigger point
"End of Scan
Cycle"
PIQ

SIMATIC S7 Date: 04.03.2019


File: 10_.16
Opening a Variable Table and Establishing a Connection to the CPU

Accessible CPUs
Configured
Directly CPU
connected
Station 1 (VAT from Station 2 Station 3
CPU HW Station
"Station 2")

PG

SIMATIC S7 Date: 04.03.2019


File: 10_.17
Testing (Debugging) Blocks using "Monitor" (Block Status)

SIMATIC S7 Date: 04.03.2019


File: 10_.18
Information Displayed with "Block Debug > Monitor"
LAD/STL/FBD Editor -> Options ->Customize ... or
in running status:
right mouse click
on

SIMATIC S7 Date: 04.03.2019


File: 10_.19
Selecting Process and Test Operation

SIMATIC S7 Date: 04.03.2019


File: 10_.20
Displaying Reference Data

SIMATIC S7 Date: 04.03.2019


File: 10_.21
Displaying the Program Structure

SIMATIC S7 Date: 04.03.2019


File: 10_.22
Displaying Cross References

SIMATIC S7 Date: 04.03.2019


File: 10_.23
Filtering Cross References

SIMATIC S7 Date: 04.03.2019


File: 10_.24
Block Correction using Cross References

SIMATIC S7 Date: 04.03.2019


File: 10_.25
Go to Location

1xright

SIMATIC S7 Date: 04.03.2019


File: 10_.26
Assignment of I,Q,M,T,C

SIMATIC S7 Date: 04.03.2019


File: 10_.27
Unused Symbols / Addresses without Symbols

SIMATIC S7 Date: 04.03.2019


File: 10_.28
Comparing Blocks (1)

...see
next page

SIMATIC S7 Date: 04.03.2019


File: 10_.29
Comparing Blocks (2)

SIMATIC S7 Date: 04.03.2019


File: 10_.30
Writing User Messages in the Diagnostic Buffer

CPU Node

e.g. PG, OP
Send buffer

SEND =
TRUE
1 2

SFC 52 Sending
asynchronous
to user program
Diagnostic buffer

SIMATIC S7 Date: 04.03.2019


File: 10_.31
Configuring Your Own Message Texts

SIMATIC S7 Date: 04.03.2019


File: 10_.32
Calling the SFC 52 Block

Network 2: User message when limit value exceeded

CMP>R
#analog value_
normalized IN1 M 90.1 SFC 52
P
5.000000e+003 IN2 EN

>=1
M 0.1

M 0.1 SEND

W#16#A901 EVENTN RET_VAL #error_sfc52

#dummy INFO 1

#analog value_
normalized INFO 2 ENO

SIMATIC S7 Date: 04.03.2019


File: 10_.33
Structure of the EVENTN Parameter of the SFC 52 Block

EVENTN 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

Event class Identification Event number

1..9 are standard texts for the different events


(see the Standard and System Functions manual)
Event class A..B free texts, that are specified using Message Configuration

C..F reserved for expansions in the future

Specifies if it is an incoming or an outgoing event, or, an internal


or an external event, for example:
Identification Bit 8= "1" --> incoming message
Bit 8= "0" --> outgoing message
Bit 10= "1" --> internal fault
Bit 11= "1" --> external fault
Continuous message number from 1 to 255 within an
Event number
event class

SIMATIC S7 Date: 04.03.2019


File: 10_.34
Diagnostics-Capable Modules
Assigning parameters for a diagnostics-capable module:

... trigger a diagnostics


interrupt OB 82
when an error occurs

SIMATIC S7 Date: 04.03.2019


File: 10_.35

You might also like