Siemens S5

leka

Member
Join Date
Oct 2010
Location
Aarhus
Posts
9
Hi

I have to make a change in this plc program but have not seen such a kind of programming before. Are there some who can tell me how this works?

FB121.jpg
 
I have never seen this block either. Is it a standard block from Siemens? If you check the library number, it might reveal something. Are there any IPxxx-cards in the system?

Here is the link to S5-software manuals from Siemens. Many are old, and therefore scanned to PDF. The search function does not work so you will have to read carefully.
đź“š

Kalle
 
It's probably not a siemens standard block if you can open it & see past JU=m001, most siemens blocks were protected however they did write some & left them open.
Most siemens standard blocks were 200-255
 
The code for FB121. it looks complicated!

[1
NAME: CTRLSTD1
DECL: DBNR DKY
DECL: PACT DKF
DECL: PBAD DKF
DECL: PGOO DKF
DECL: NRNI DKF
DECL: NRCT DKF
DECL: CTRL IBI
DECL: SYNC IBI
DECL: OPTI DKM
DECL: INIT IBI
DECL: MEMO IBI
DECL: NMES DKF
DECL: NMEI DKF
DECL: STAT QBY
DECL: FAUL QBI
DECL: INSP QBI

***
]
[2
LW =PACT
T FY 200
LW =NRNI
T FY 201
L KF +1
T FY 218
L KH 0000
T FW 210
***
]
[3
LW =DBNR
T FW 212

L FY 212
T FW 214
DO FW 214
C DB 0

L DW 10
L FY 213
+F
T DW 18
DO DW 18
L DW 0
T FW 220
***
]
[4
AN =INIT
O F 220.0
JC =M001
L KH 0000
T FY 220

JU FB 72
NAME: GETGBPCE
FCT : KF +1
TYPP: KH 0088
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
PREC: FY 210
CREC: FY 210
POWO: FY 210
PONX: FY 204
STAT: FY 206

L FY 204
L FY 200
!=F
S F 220.1
>=F
JC =M002

JU FB 71
NAME: GETBDPCE
FCT : KF +1
TYPP: KH 0012
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
NPC1: FY 210
NPC2: FY 210
ONOF: FY 210
BOMA: FY 204
CODE: FY 210
VIDA: FY 205
SERI: FW 208
STAT: FY 206

L FY 204
L KF +1
!=F
S F 220.2
L FY 205
L KF +1
!=F
S F 220.3

AN F 220.2
O F 220.3
JC =M003
JU =M004
M001: JU =M005
M004:
LW =PBAD
T FY 212
JU FB 72
NAME: GETGBPCE
FCT : KF +2
TYPP: KH 000C
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
PREC: FY 210
CREC: FY 212
POWO: FY 200
PONX: FY 212
STAT: FY 206
L KH 00FD
T FW 212
JU FB 71
NAME: GETBDPCE
FCT : KF +2
TYPP: KH 0030
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
NPC1: FY 210
NPC2: FY 210
ONOF: FY 210
BOMA: FY 212
CODE: FY 213
VIDA: FY 210
SERI: FW 210
STAT: FY 206

JU FB 65
NAME: MEMONOFF
FCT : KF +2
TYPE: KH 0001
NRPO: FY 200
NRST: FY 218
ONOF: F 110.0
BOMA: F 110.0
AN F 221.7
S F 221.7
M002:
JU FB 71
NAME: GETBDPCE
FCT : KF +1
TYPP: KH 0012
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
NPC1: FY 210
NPC2: FY 210
ONOF: FY 210
BOMA: FY 204
CODE: FY 210
VIDA: FY 205
SERI: FW 208
STAT: FY 206
L FY 204
L KF +1
!=F
S F 220.2
L FY 205
L KF +1
!=F
S F 220.3
M003:
JU FB 61
NAME: ONOFFSTA
FCT : KF +1
TYPP: KH 0002
NRPO: FY 200
NRST: FY 218
TYPE: FY 210
ONOF: FY 204
SERI: FW 210
MAPA: FY 205
COPA: FY 205
PREC: FY 205
STAT: FY 206
L FY 204
L KF +1
!=F
S F 220.6
L FW 208
L FW 210
!=F
S F 220.5
AN F 220.0
S F 220.0
M005: ***
]
[5
LW =OPTI
T FW 202
***
]
[6
AN =MEMO
ON F 220.0
JC =M001

AN F 220.1
ON F 220.2
O F 220.3
JC =M002

LW =PGOO
T FY 207

AN F 220.6
O
A F 203.4
AN F 220.5
O
AN F 221.1
O
A F 221.1
A F 221.2
JC =M003

LW =PBAD
T FY 207

JU FB 65
NAME: MEMONOFF
FCT : KF +2
TYPE: KH 0001
NRPO: FY 200
NRST: FY 218
ONOF: F 110.0
BOMA: F 110.0

L KH 0001
T FW 204
L KH 0000
T FW 210

JU FB 71
NAME: GETBDPCE
FCT : KF +2
TYPP: KH 0030
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
NPC1: FY 210
NPC2: FY 210
ONOF: FY 210
BOMA: FY 204
CODE: FY 200
VIDA: FY 210
SERI: FW 210
STAT: FY 206
M003:
JU FB 72
NAME: GETGBPCE
FCT : KF +2
TYPP: KH 000C
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
PREC: FY 210
CREC: FY 210
POWO: FY 200
PONX: FY 207
STAT: FY 206
M002:
L FW 220
L KH FE00
AW
T FW 220
M001: ***
]
[7
A =CTRL
= F 221.0
***
]
[8
AN =SYNC
O
A F 221.1
AN F 221.2
JC =M001

AN F 221.1
S F 221.1
S F 221.2

A F 221.0
A F 202.0
O
AN F 221.0
AN F 202.0
R F 221.2
M001: ***
]
[9
A =SYNC
ON F 221.1
O F 221.3
JC =M001
LW =NRCT
T FY 213
L KH 0000
T FY 207
A F 220.1
A F 220.2
AN F 220.3
A(
A F 220.5
ON F 203.4
)
A F 220.6
AN F 221.2
JC =M002
JU FB 63
NAME: COMPTSTA
FCT : KF +4
TYPP: KH 0000
NRPO: FY 200
NRST: FY 218
NRCT: FY 213
INCR: FY 210
CPTJ: FW 210
CPTC: FW 210
CPTP: FW 210
FLGP: F 207.0
FLGC: F 207.1
STAT: FY 206
JC =M003
M002:
JU FB 63
NAME: COMPTSTA
FCT : KF +6
TYPP: KH 0000
NRPO: FY 200
NRST: FY 218
NRCT: FY 213
INCR: FY 213
CPTJ: FW 210
CPTC: FW 210
CPTP: FW 210
FLGP: F 207.2
FLGC: F 220.7
STAT: FY 206
L KH 0100
T FW 214
A F 220.7
JC FB 61
NAME: ONOFFSTA
FCT : KF +2
TYPP: KH 0030
NRPO: FY 200
NRST: FY 218
TYPE: FY 210
ONOF: FY 210
SERI: FW 210
MAPA: FY 214
COPA: FY 215
PREC: FY 210
STAT: FY 206

L KH 0000
T FY 204

JU FB 71
NAME: GETBDPCE
FCT : KF +2
TYPP: KH 0030
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
NPC1: FY 210
NPC2: FY 210
ONOF: FY 210
BOMA: FY 204
CODE: FY 200
VIDA: FY 210
SERI: FW 210
STAT: FY 206

JU FB 73
NAME: POSA-CNT
FCT : KF +3
PBAS: KF +2
NPS1: FY 200
NPS2: FY 201
NRCT: FY 213
INCR: FY 213
VCNT: FW 210
STAT: FY 206

M003: AN F 221.3
S F 221.3
A F 220.7
S =FAUL
M001: ***
]
[10
A =FAUL
= F 220.7
S F 115.3
***
]
[11
A(
A F 221.0
AN F 202.0
O
AN F 221.0
A F 202.0
)
A F 202.7
A F 80.4
S =INSP
AN F 202.7
RB =INSP
***
]
[12
A =INSP
S F 115.3
***
]
[13
A(
AN =FAUL
AN =INSP
)
O F 120.7
O F 114.4
ON F 80.0
JC =M001
LW =CTRL
L KH 0FFF
AW
T FW 204
L FY 205
T FW 210
L KF +10
T FW 212
JU FB 242
NAME: MUL:16
Z1 : FW 210
Z2 : FW 212
Z3=0: F 217.0
Z32 : FW 216
Z31 : FW 214
L FY 204
L FW 214
+F
T FW 216
A =INSP
JC =M002
LW =NMES
T FY 210
LW =FAUL
JU =M003
M002: LW =NMEI
T FY 210
LW =INSP
M003: L KH 0FFF
AW
T FW 212
L FW 200
T FW 214
JU FB 21
NAME: DETDEF02
NMES: FY 210
REP : FW 212
STAT: FW 214
CAPT: FW 216
RES1: KF +0
TYPE: KY 1,3
FLAG: F 120.7
M001: ***
]
[14
L FY 220
T =STAT
***
]
[15
L FW 220
DO DW 18
T DW 0
***
]
[16
BE
]
 
The DO instruction is indirect addressing.

for example

'L FY 212
T FW 214
DO FW 214
C DB 0'

The DB address is passed to FW214.

If FW214 = 50

Then

DO FW 214
C DB 0

Will open DB50.
 
It's not that complicated but unless you know what it's supposed to do it could be difficult to decipher.
DO instruction
Like DO FW200
Call DB0
if flagword 200 contains 123 then the call DBO calls Datablock 123
It's a way of calling blocks indirectly so you pass the DB number to scratch flagword then call the block with that number
This can be done using dw in other db's flags etc.
You can also put the MC5 (raw machine code) code for an instruction in a FW then do the flagword then do a system instruction i.e. if 5CEF is the MC5 code for L Timer 5 then putting Hex 5CEf in FW200
Do FW200
L RS0
would load T5 (before anyone comments I know the hex code is wrong but lost my MC5 instruction set years ago)
Trying to trace the pointers could be very difficult as they could be changing all the time.
I have seen code that uses this type of indirect instructions to change code at runtime (very dangerous in my oppinion).
 
Okay thanks for imput. I vil try to read your examples in the program

@kalle
The task is too add a redcontact to one of the stations on the machine. The machine is a NUTT & JAGGI with 30 stations on. So I'm trying to figure out how the program works before I do anything.
 

Similar Topics

Good morning fellow sea captains and wizards, I am being asked to do the above and obtain 4 values from each slave, I know about the MRX and MWX...
Replies
20
Views
153
Hi everyone, I am an omron plc tec , lately I came across a siemens s7 200 cn plc . Can someone help me regarding the software required and...
Replies
26
Views
455
This is the first time I am working with Simatic Manager Step7 as I started my siemens journey with TIA which is pretty easy and do a lot of stuff...
Replies
3
Views
113
Hi, I have PLC S7-1200 and switch XC-208 and Iam trying to implement this SNMP library: SIOS I am not sure, what I am doing wrong, but there is...
Replies
3
Views
119
Hi all, i am the new controls guy at the plant and i have inherited a pc from the previous controls guy with Siemens tia portal version 16 and 17...
Replies
19
Views
670
Back
Top Bottom