Problem interpreting Siemens program

badbatch

Member
Join Date
Apr 2009
Location
tennessee
Posts
4
New member here. I need help understanding some code from a Siemens program. Every proc. in our facility is of the AB SLC/5 variety. I have a firm grasp of ladder logic and can understand some STL. Any help will be appreciated, but be gentle, I am not a programmer by trade. You may have to dumb it down a bit. This code is controlling a gas burner. M 181.7 determines whether the burner is on or off. Too make it worse for me, it's in German. I'll translate where I can.

FB 22
Network 1 0000 Bath Temp Control
Name :BADREGEL (Bath-something??)
0005 :A DB 10 Datablock Bathtemp
0006 :
0007 :L DW 1
0008 :L KF +815
000A :>=F Start Sintern SB bei
000B :S M 181.4
000C :O(
000D :UN M 22.1 -M 22.1 01
000E :UN M 22.2 -M 22.2 01
000F : ) 01
0010 :ON M 2.1 -M 2.1
0011 :O M 152.4 -M 152.4
0012 :R M 181.4 -M 181.4
0013 :
0014 :L DW 1 ABFRAGE Bathtemp
0015 :L +650 >650 GRAD
0017 :>F
0018 := M 181.5 -M 181.5 Bathtemp > 650 GRAD
0019 :
001A :SPA FB 230 2-PUNKT-REGLER BAD
001B NAME :pUNKT-2
001C IST : DW 1 ACTUAL VALUE (TEMP)
001D SOLL : DW 0 SETPOINT
001E HYS : KF +3 HYSTERESE
001F : M 181.7 -M 181.7 CONTROL SIGNAL
0020 :
0021 :BE

Befor line 001A my only problem is the UN. Not familiar with that one and can't find any thing on it. The unconditional jump at line 001A is where I start having the real trouble. I'll show you FB 230 now.


FB 230
Network 1 0000 2-PUNKREGLER MIT HYSTERESE
NAME : PUNKT-2
BEZ : IST E/A/D/B/T/Z: E BI/BY/W/D: W
BEZ : SOLL E/A/D/B/T/Z: E BI/BY/W/D:
BEZ : HYS E/A/D/B/T/Z: D KM/KH/KY/KC/KT/KZ/KG: KF
BEZ : MERK E/A/D/B/T/Z: A BI/BY/W/D: BI

0011 :L =SOLL
0012 :LW =HYS
0013 :-F
0014 :L =IST
0015 :>F
0016 :S =MERK
0017 :
0018 :L =SOLL
0019 :LW =HYS
001A :+F
001B :L =IST
001C :<F
001D :RB =MERK
001E :
001F :BE
 
"UN" (und nicht )is same as "AN" (and not).
As far as I remember, STEP5 can be switched to english notation. So would do that if I were you.

"2-PUNKT REGLER MIT HYSTERESE" means that it is a simple on/off regulation with hysteresis.
"SOLL" = setpoint value
"IST" = actual value
 
It's making a little more sense. Thanks! I suppose the RB would be an R than? I don't have Step 5 and the boss doesn't want to spend the money to get it, being that this the only Seimens in the plant. I'm having to decipher everything from the hard copy. Anyone know what MERK means?
 
If you have a copy of the original S5 program then post it here and someone will switch it from german to english, im sure...
 
"MERK" is an abbreviation for Merker, which is usually translated as "Marker" in English. This is simply a memory area for general usage. You can have Merker-Bits, -Bytes, -Words and -DWords, however in this case line 16 is setting a Bit and using it as a Flag to show whether the MV is above (Flag set) or below the setpoint (plus or minus the hysteresis, as appropriate).
 
To switch to English Mnemonics:

Go into Simatic Manager
->Options Menu
->Custimize
->Language
->Mnemonics

Make sure bullet for English is selected.
 
Code:
FB 22
Network 1 0000 Bath Temp Control
Name :BADREGEL (Bath-something??)
0005 :A DB 10 Datablock Bathtemp  [COLOR=Red]//  Open DB10. Any reference to DW after this will be same as saying DB10.DWx[/COLOR]
0006 :
0007 :L DW 1  [COLOR=Red]//  Loads DB10.DW1[/COLOR]
0008 :L KF +815  [COLOR=Red]// Loads integer 815[/COLOR]
000A :>=F Start Sintern SB bei  [COLOR=Red]// Compares integers[/COLOR]
000B :S M 181.4  [COLOR=Red]//  If greater or equal, set bit[/COLOR]
000C :O([COLOR=Red]  // Or everything in these brackets[/COLOR]
000D :UN M 22.1 -M 22.1 01  [COLOR=Red]//  And not this merker[/COLOR]
000E :UN M 22.2 -M 22.2 01  [COLOR=Red]//  And not this merker[/COLOR]
000F : ) 01
0010 :ON M 2.1 -M 2.1  [COLOR=Red]//  Or not this merker[/COLOR]
0011 :O M 152.4 -M 152.4  [COLOR=Red]//  Or this merker[/COLOR]
0012 :R M 181.4 -M 181.4  [COLOR=Red]//  Reset bit[/COLOR]
0013 :
0014 :L DW 1 ABFRAGE Bathtemp  [COLOR=Red]// Load DB10.DW1[/COLOR]
0015 :L +650 >650 GRAD  [COLOR=Red]//  Load integer[/COLOR]
0017 :>F  [COLOR=Red]// Compares integer[/COLOR]
0018 := M 181.5 -M 181.5 Bathtemp > 650 GRAD  [COLOR=Red]// As long as its greater then, the bit is TRUE[/COLOR]
0019 :
001A :SPA FB 230 2-PUNKT-REGLER BAD  [COLOR=Red]//  Not unconditional jump, but rather unconditional call[/COLOR] [COLOR=Red]of FB230 with following statements as input/output variables[/COLOR]
001B NAME :PUNKT-2
001C IST : DW 1 ACTUAL VALUE (TEMP)  
001D SOLL : DW 0 SETPOINT
001E HYS : KF +3 HYSTERESE
001F : M 181.7 -M 181.7 CONTROL SIGNAL  [COLOR=Red]//  This one is supposed to say MERK :[/COLOR] 
0020 :
0021 :BE


FB 230 Call,
BEZ signifies parameters, input, output etc.

E/A/D/B/T/Z signifies what kind of parameter.
E: Input
A: Output
D: Beats me
B: Same as above
T: Timer
Z: Counter

BI/BY/W/D signifies what data type it is.
BI: Bit
BY: Byte
W: Word
D: Double

KM/KH/KY/KC/KT/KZ/KG also signifies what type it is. don't know them all but:
KM: Binary
KH: Hex
KF: Int
Don't know the others.

So you basically declare input/output parameters, type and datatype. Then each time you call the block you can designate values to these parameters.
Don't know AB SLC/05, but I bet they can do something similar.

Code:
FB 230
Network 1 0000 2-PUNKREGLER MIT HYSTERESE
NAME : PUNKT-2
BEZ : IST E/A/D/B/T/Z: E BI/BY/W/D: W  [COLOR=Red]//  E = Inputvariable W = Word[/COLOR]
BEZ : SOLL E/A/D/B/T/Z: E BI/BY/W/D:   [COLOR=Red]//  [/COLOR][COLOR=Red]E = Inputvariable W = Word (guessing it's lacking a W here at the end)[/COLOR]
BEZ : HYS E/A/D/B/T/Z: D KM/KH/KY/KC/KT/KZ/KG: KF  [COLOR=Red]//  D = unknown, but think constant or data (lack of knowledge my side)  KF = integer[/COLOR]
BEZ : MERK E/A/D/B/T/Z: A BI/BY/W/D: BI  [COLOR=Red]//  A = Ouputvariable  BI = Bit I guess[/COLOR]
 
0011 :L =SOLL  [COLOR=Red]//  Loads Inputvariable SOLL, a bit up in FB22 you have declared DB10.DW0 to this variable[/COLOR]
0012 :LW =HYS  [COLOR=Red]//  Loads HYS, constant KF +3[/COLOR]
0013 :-F  [COLOR=Red]//  Subtracts HYS from SOLL
[/COLOR] 0014 :L =IST  [COLOR=Red]//  Loads IST, DB10.DW1[/COLOR]
0015 :>F  [COLOR=Red]//  Compares[/COLOR]
0016 :S =MERK  [COLOR=Red]//  If greater then, Set MERK[/COLOR]
0017 :
0018 :L =SOLL  [COLOR=Red]//  Loads Inputvariable SOLL[/COLOR]
0019 :LW =HYS  [COLOR=Red]//  Loads HYS[/COLOR]
001A :+F  [COLOR=Red]//  Adds HYS to SOLL[/COLOR]
001B :L =IST  [COLOR=Red]//  Loads IST[/COLOR]
001C :<F  [COLOR=Red]//  Compares[/COLOR]
001D :RB =MERK  [COLOR=Red]//  If smaller then, Resets Bit MERK[/COLOR]
001E :
001F :BE

And this concludes todays Step5 tutorial.

Hope it helps a bit.......
 
Last edited:

Similar Topics

Hi, I have had problem with upgrading some projects from v16 to v18. I tried it on 3 diffrent computers. I want to post this so that anyone that...
Replies
3
Views
101
Hi, I am having a challenge installing a new drive ACS355-03E-44A0-4 as it keeps on displaying Fault code F00018 even when the load is not...
Replies
3
Views
125
I have an issue on my vessel, we have water tight door system created in China, company is no longer operating. We have 7 doors each with their...
Replies
3
Views
113
Hi all. Simple as simple can be, I don't understand what's happening. I'm toggling he OSR on, GX_LUB_PUMP1_LEAD should switch. It doesn't. The...
Replies
27
Views
643
Hi; In a cabinet of a machine, a Fatek PLC with an Ethernet communication card is working. In the same cabinet, there is a 1 kW inverter. When...
Replies
16
Views
489
Back
Top Bottom