Siemens S5 troubleshooting

DavidBurg

Member
Join Date
Mar 2015
Location
Denver, CO
Posts
9
Hey guys,

I'm hoping someone here can help me with a client using a Siemens S5 controller. Most of my experience is with Allen-Bradley controllers using ladder logic. A client has sent me an S5 program with the following files:

*st.s5d
*px.ini
*xr.ini
*z0.ini
*z1.ini
*z2.ini
*ls.ini
*[email protected]
*xrefls.ini

I can open and view the *st.s5d program with the "s5/s7 for windows" program provided by Process Informatik.

The client has an issue with an analog low alarm not triggering when it should. I dug through the program I was able to find block FX15 within OB1 that is responsible for Analog Alarm Processing. I see that FX15 is called several times within OB1, however I cannot distinguish which of these calls to FX15 correspond to which analog alarm. The following is a snippet of code from OB1 that is called 6 times. The last 2 instructions change every time it is called. DB# increments by 1 each time (KF +21, KF +22, KF +23, etc.), and system sequence bit # increments by 1 also (D 21.4, D 21.5, D 21.6, etc.)

BAB FX 15 ;call analog alarm function
NAME ANLGALRM
DBCF: KF +21 ;DB# of analog alarm config
U D 21.4 ;system sequence bit #4

I am having trouble finding which analog input corresponds to each of these alarms, where the limits to trigger these alarms are stored, and which bit will turn high when the alarm is activated.

I can upload more of the program if that will help. I apologize if this is a silly question, I have very limited experience with the S5 programming environment.

Thanks in advance :)

-Dave
 
Attached are the s5d, z0, z1, and z2 files.

The client is concerned with the Screw Feeder 306.2 underweight dosing alarm. After a timer, if the weight is too low the alarm should be triggered, but it currently never triggers.

Thank you for taking a look!

Side question: I wasn't able to get any information from the symbol files. For future projects, is there a way to import the z0.ini files into the s5/s7 for windows program to read the symbols?
 
These are the only z files supplied by the client. I can walk them through converting the z0.ini to Z0.SEQ and I will post the Z0.SEQ when I receive it.

Maybe that explains why I was not able to see any of the symbols!

Thanks for looking anyway, I'll get back to you if I can get the Z0.SEQ file from the client.

-Dave
 
This is code directly from a Maintenance man's Hell. There are looping function FX10, FX15, certainly more, getting parameters from DBs everywhere manipulating statusbits and values elsewhere.

I printed the code to a PDF file. It is allmost 1500 pages, mostly data block contents (parameters).

Do you know the address of this particular input?
Is it in the PW, QW or IM (profibus) area? Or does it come from a Modbus node?


I got to walk the dog. Will be back in a long hour.

Kalle
 
Okay, after speaking with the client we discovered that they accidentally sent the wrong program. The correct program is the IOWA1_ST.S5d attached to this post. I have also attached the .SEQ file.

Things are making a lot more sense to me at this point, but I was hoping someone could point me in the right direction to troubleshoot the Screw Feeder 306.2 dosing underweight alarm.

From what I can see the alarm in question would be M165.5, set in FB233 segment 1? The comment "If material not come to scale 2 during dosing, then generate alarm ( M165.5)" leads me to think this is the correct portion of code, but I don't see where we compare the actual weight to a setpoint in order to generate this alarm. Maybe that's the problem, the alarm conditions are missing? I'm still digging around but any help is appreciated :)

Thanks,

-Dave
 
FB233, NW1 - The FB is called once, from FB214, see below

;AFTER DOSING ERROR (7)
;- NO MATERIAL TO SCALE 2 (309)
;If material not come to
;scale 2 during dosing, then
;generate alarm ( M165.5)
;----------------------------

;if material come from silo 4
L MB 71
L KF +4
><F
SPB =M001
;if dosing screw run
UN E 2.5
UN E 2.6

SPB =M001
;set alarm
O M 9.0
ON M 9.0
= M 165.5

XXXXXXXXXXXXXXXXXX

FB214, NW7

;------------------------
;M32 = 20
;- dosing material to scale
;- wait that the dosing to
; become ready
;-------------------------
L KF +20 ;Dosing to scale 2: sequence number
L MB 32
><F
SPB =M018

A DB 52 ;actual amount of material to PC
L DW 13 ;DB52/DW13 - DB27/FW56
A DB 27
B MW 56 ;Scale2(309) dosing pointer to recipe
T DW 0

A DB 52 ;if dosing error = 7
L DW 25 ;(no material to scale)
L KF +7
!=F
SPB FB 233
NAME: NO/FILL2


XXXXXXXXXXXXX

Looks like the dosing error comes from here:
The comments looks like Finnish to me.

FB221 DOSSERV, NW1

( DB 52 is open)

L DW 13
L DW 157 ;etenee
-F
SPP =M007 ;kasvata etenee laskuria
L DW 154
L KF +1
+F
T DW 154
L DW 73 ;ei viela halya
<F
SPB =M008
L DW 154
L KF +1
-F ;ei etene-haly
T DW 154
L KF +7
T DW 25
SPA =M008 ;nollaa etenee-laskuri

FB 221 is called from FB220

FB220 is called from OB1
SPA FB 220
NAME: DOS900
DBN : KF +52 ; This is the actual DB
AIKA: T 102

Contents of DB52 SCALE 2 (309) PARAMETER
0: KF +0
1: KF +34
2: KF +2
3: KF +0
4: KF +0
5: KF +512
6: KF +17474
7: KF +52
8: KF +75
9: KF +4
10: KF +0
11: KF +15125
12: KF +0
13: KF +15030
14: KF +0
15: KF +95
16: KF +0
17: KF +15030
18: KF +0
19: KF +0
20: KF +0
21: KF +0
22: KF +3
23: KF +0
24: KF +0
25: KF +0
26: KF +1
27: KF +1
28: KF +1
29: KF +18969
30: KF +0
31: KF +414
32: KF +0
33: KF +0
34: KF +0
35: KF +0
36: KF +0
37: KF +0
38: KF +0
39: KF +0
40: KF +0
41: KF +15060
42: KF +0
43: KF +350
44: KF +0
45: KF +0
46: KF +0
47: KF +15
48: KF +0
49: KF +15
50: KF +2000
51: KF +1
52: KF +0
53: KF +0
54: KF +0
55: KF +0
56: KF +0
57: KF +0
58: KF +0
59: KF +0
60: KF +0
61: KF +0
62: KF +0
63: KF +0
64: KF +0
65: KF +0
66: KF +0
67: KF +0
68: KF +0
69: KF +0
70: KF +15
71: KF +500
72: KF +500
73: KF +2500
74: KF +0
75: KF +13392
76: KF +516
77: KF +16
78: KF +22
79: KF +0
80: KF +44
81: KF +0
82: KF +15125
83: KF +0
84: KF +15030
85: KF +0
86: KF +95
87: KF +0
88: KF +15030
89: KF +0
90: KF +0
91: KF +0
92: KF +0
93: KF +3
94: KF +0
95: KF +0
96: KF +0
97: KF +1
98: KF +1
99: KF +1
100: KF +18969
101: KF +0
102: KF +414
103: KF +0
104: KF +0
105: KF +0
106: KF +394
107: KF +5
108: KF +4
109: KF +0
110: KF +10
111: KF +0
112: KF +0
113: KF +528
114: KF +50
115: KF +19
116: KF +38
117: KF +0
118: KF +15060
119: KF +0
120: KF +350
121: KF +0
122: KF +0
123: KF +0
124: KF +15
125: KF +0
126: KF +15
127: KF +2000
128: KF +1
129: KF +1
130: KF +0
131: KF +0
132: KF +0
133: KF +0
134: KF +0
135: KF +0
136: KF +0
137: KF +0
138: KF +0
139: KF +0
140: KF +0
141: KF +0
142: KF +0
143: KF +0
144: KF +0
145: KF +0
146: KF +0
147: KF +0
148: KF +0
149: KF +0
150: KF +50
151: KF +100
152: KF +0
153: KF +0
154: KF +15
155: KF +3550
156: KF +3
157: KF +15030
158: KF +0
159: KF +1
160: KF +0
161: KF +5

The contents of this DB is communicated from a Weight scale.

I think you have enough code to track the setpoint here.
You must compare with the online values.

Kalle (dog walk again)
 
couple comments are Finnish, thanks Kalle...

FB233, NW1 - The FB is called once, from FB214, see below

;AFTER DOSING ERROR (7)
;- NO MATERIAL TO SCALE 2 (309)
;If material not come to
;scale 2 during dosing, then
;generate alarm ( M165.5)
;----------------------------

;if material come from silo 4
L MB 71
L KF +4
><F
SPB =M001
;if dosing screw run
UN E 2.5
UN E 2.6

SPB =M001
;set alarm
O M 9.0
ON M 9.0
= M 165.5

XXXXXXXXXXXXXXXXXX

FB214, NW7

;------------------------
;M32 = 20
;- dosing material to scale
;- wait that the dosing to
; become ready
;-------------------------
L KF +20 ;Dosing to scale 2: sequence number
L MB 32
><F
SPB =M018

A DB 52 ;actual amount of material to PC
L DW 13 ;DB52/DW13 - DB27/FW56
A DB 27
B MW 56 ;Scale2(309) dosing pointer to recipe
T DW 0

A DB 52 ;if dosing error = 7
L DW 25 ;(no material to scale)
L KF +7
!=F
SPB FB 233
NAME: NO/FILL2


XXXXXXXXXXXXX

Looks like the dosing error comes from here:
The comments looks like Finnish to me.

FB221 DOSSERV, NW1

( DB 52 is open)

L DW 13
L DW 157 ;etenee "running/moving"
-F
SPP =M007 ;kasvata etenee laskuria "count up moving time/counter"
L DW 154
L KF +1
+F
T DW 154
L DW 73 ;ei viela halya "no alarm yet"
<F
SPB =M008
L DW 154
L KF +1
-F ;ei etene-haly "not moving, alarm"
T DW 154
L KF +7
T DW 25
SPA =M008 ;nollaa etenee-laskuri "put zero to moving counter"

FB 221 is called from FB220

FB220 is called from OB1
SPA FB 220
NAME: DOS900
DBN : KF +52 ; This is the actual DB
AIKA: T 102 "time"

Contents of DB52 SCALE 2 (309) PARAMETER
0: KF +0
1: KF +34
2: KF +2
3: KF +0
4: KF +0
5: KF +512
6: KF +17474
7: KF +52
8: KF +75
9: KF +4
10: KF +0
11: KF +15125
12: KF +0
13: KF +15030
14: KF +0
15: KF +95
16: KF +0
17: KF +15030
18: KF +0
19: KF +0
20: KF +0
21: KF +0
22: KF +3
23: KF +0
24: KF +0
25: KF +0
26: KF +1
27: KF +1
28: KF +1
29: KF +18969
30: KF +0
31: KF +414
32: KF +0
33: KF +0
34: KF +0
35: KF +0
36: KF +0
37: KF +0
38: KF +0
39: KF +0
40: KF +0
41: KF +15060
42: KF +0
43: KF +350
44: KF +0
45: KF +0
46: KF +0
47: KF +15
48: KF +0
49: KF +15
50: KF +2000
51: KF +1
52: KF +0
53: KF +0
54: KF +0
55: KF +0
56: KF +0
57: KF +0
58: KF +0
59: KF +0
60: KF +0
61: KF +0
62: KF +0
63: KF +0
64: KF +0
65: KF +0
66: KF +0
67: KF +0
68: KF +0
69: KF +0
70: KF +15
71: KF +500
72: KF +500
73: KF +2500
74: KF +0
75: KF +13392
76: KF +516
77: KF +16
78: KF +22
79: KF +0
80: KF +44
81: KF +0
82: KF +15125
83: KF +0
84: KF +15030
85: KF +0
86: KF +95
87: KF +0
88: KF +15030
89: KF +0
90: KF +0
91: KF +0
92: KF +0
93: KF +3
94: KF +0
95: KF +0
96: KF +0
97: KF +1
98: KF +1
99: KF +1
100: KF +18969
101: KF +0
102: KF +414
103: KF +0
104: KF +0
105: KF +0
106: KF +394
107: KF +5
108: KF +4
109: KF +0
110: KF +10
111: KF +0
112: KF +0
113: KF +528
114: KF +50
115: KF +19
116: KF +38
117: KF +0
118: KF +15060
119: KF +0
120: KF +350
121: KF +0
122: KF +0
123: KF +0
124: KF +15
125: KF +0
126: KF +15
127: KF +2000
128: KF +1
129: KF +1
130: KF +0
131: KF +0
132: KF +0
133: KF +0
134: KF +0
135: KF +0
136: KF +0
137: KF +0
138: KF +0
139: KF +0
140: KF +0
141: KF +0
142: KF +0
143: KF +0
144: KF +0
145: KF +0
146: KF +0
147: KF +0
148: KF +0
149: KF +0
150: KF +50
151: KF +100
152: KF +0
153: KF +0
154: KF +15
155: KF +3550
156: KF +3
157: KF +15030
158: KF +0
159: KF +1
160: KF +0
161: KF +5

The contents of this DB is communicated from a Weight scale.

I think you have enough code to track the setpoint here.
You must compare with the online values.

Kalle (dog walk again)
 
Last edited:
Kiitos Lare!

L DW 13
L DW 157 ;etenee "running/moving"
-F
SPP =M007 ;kasvata etenee laskuria "count up moving time/counter"
L DW 154
L KF +1
+F
T DW 154
L DW 73 ;ei viela halya "no alarm yet"
<F
SPB =M008
L DW 154
L KF +1
-F ;ei etene-haly "not moving, alarm"
T DW 154
L KF +7
T DW 25

*****

So one can interpret this:

DW 13 is the process value - presumably weight
DW 157 is the weight setpoint

DW 154 is filling time
DW 73 is filling time max limit

Kalle
 
Okay, this all makes sense. I'm slightly confused about the order of arithmetic operations still.

In the first 4 lines of code you just posted, the SPP will jump to M007 when DW13-DW157>0?

And the SPB will jump to M008 when DW154<DW73?

So if I understand correctly, the alarm will be set (DW25=7) when the PV is below the SP (DW13<DW157) AND the filling time has elapsed (DW154>=DW73)?

These are the correct alarm conditions, but my operations documentation is confusing me... Maybe I should ask a basic question. When we load DW13 it goes into accum1. Then we load DW157, so DW13 shifts into accum2 and DW157 is loaded into accum1. Then '-F' performs accum1-accum2 so wouldn't the first '-F' instruction be performing DW157-DW13, instead of DW13-DW157?

I apologize for being a novice with these processors, I'm hoping to gain a better understanding through this troubleshooting exercise. I appreciate your help, Kalle.
 
Last edited:

Similar Topics

Hey when I turn on my Siemens PLC CPU 216-2 after runing 10 minute it's stop and showing SF indication after I turn off and some time later turn...
Replies
0
Views
130
I'll preface this by saying this is the first time I've worked on a Siemens system and I'm fairly unfamiliar with them. I might mess up some of...
Replies
29
Views
763
What the heck is this "P", and how is it used for this counter? ....You can't search a "P" in the manual. Thanks!
Replies
5
Views
1,816
Hi guys, Tomorrow I'm heading down to take a look at an existing SCADA system that has failed, and I was wondering if anyone had some suggestions...
Replies
18
Views
12,840
Tomorrow morning I have to use a rented Siemens PC to troubleshoot a Siemens HMI, programmed with WinCC, communicating to a couple of ABB drives...
Replies
5
Views
10,149
Back
Top Bottom