Head banging S5 conversion help needed

Mrslipmat

Member
Join Date
Mar 2009
Location
Inside a cabinet somewhere....
Posts
199
Hi Guys

I,m currently working on a S5 135U conversion to S7-300, so far I,ve been beavering away for a couple of weeks, it,s a large program and I,m pretty much done but seem to have hit a brick wall with a couple of things. After searching the forums and google, both have thrown up very little info so far in relation to the problems I,ve come across.... So I find myself asking for help after what seems like banging my head against a wall, my head hurts....

A bit of background info, the old S5 unit is connected to a a screen running an applicom card via profibus card, the screen is azonix running wonderware which inturn is connected to another system via fiber cables. The issue I,m having at the moment is the conversion of the FB blocks in S5 don,t seem to have alternatives in S7

In part of the program It,s calling FB120, FB121, and FB123, these are communication blocks which inturn call SF-OB blocks as part of there function. I,m looking for an alternative in S7 but cant find anything and dont know which way to turn at the moment.
The next issue is some of the other errors being generated like LIR, TIR and L BS, I,m not sure what to do with them.
Any help or direction would be greatly appreciated and apologies for the lenght of the question.

Current code:

Network: 1 FB L2_SERVER POUR AG 135U
JU M001
BEU
M001: NOP 0
Network: 2
OPN DB 150
AN DBX 17.1
JC NOWA
L DBW 2
INC 1
T DBW 2
L 10
>I
JC OUT
L 0
T DBW 14
WAIT: NOP 0 // CALL FB 123;
// *** Error in Line 5347 (FB 100): Block does not exist. ***
// ( $$IDENT := B#(255,145)
// , $$IDENT := B#(0,0)
// , $$IDENT := MW 0
// , $$IDENT := MB 255
// );
L DBW 14
INC 1
T DBW 14
L 10
>I
BEC
L DBW 18
// LIR 1;
// *** Error in Line 5361 (FB 100): Command not defined. ***
L 2#10
AW
L 2#10
==I

JC WAIT
OUT: R DBX 17.1
L 0
T DBW 2
L DBW 0
L 1
+I
T DBW 0
ON M 0.0
O M 0.0
// CALL FB 120;
// *** Error in Line 5377 (FB 100): Block does not exist. ***
// ( $$IDENT := B#(255,145)
// , $$IDENT := B#(0,0)
// , $$IDENT := MW 0
// , $$IDENT := lok_kcpar [0]
// , $$IDENT := B#(0,150)
// , $$IDENT := 140
// , $$IDENT := 4
// , $$IDENT := MB 255
// );
NOWA: NOP 0
Network: 3
OPN DB 150 //
L W#16#EE00
T DBW 300
L W#16#EF00
T DBW 302
L W#16#EF80
T DBW 304
L W#16#F000
T DBW 306
L W#16#F100
T DBW 308
L W#16#EC00
T DBW 310
L W#16#ED00
T DBW 312
L W#16#E400 //
T DBW 314
L W#16#0
T DBW 316
L #SSNR #SSNR -- SSNR
T DBW 290
L #ANR #ANR -- ANR
T DBW 292
L #ANZW #ANZW -- ANZW
SRW 8
L 0
==I
JC MEM
// L BS 34;
// *** Error in Line 5418 (FB 100): Invalid operator. ***
L #ANZW #ANZW -- ANZW
SRW 8
+I
// LIR 1;
// *** Error in Line 5423 (FB 100): Command not defined. ***
L #ANZW #ANZW -- ANZW
SLW 8
SRW 8
+I
T DBW 18
L 'DB'
JU NEXT
MEM: L DBW 300
L #ANZW #ANZW -- ANZW
+I
L 1
+I
T DBW 18
L 'MW'
NEXT: T DBW 294
L #ANZW #ANZW -- ANZW

T DBW 296

And other errors..........

+I
T DBW 12
L DBW 6
L 1
+I
// LIR 1;
// *** Error in Line 5702 (FB 100): Command not defined. ***
SLW 8
L DBW 12
// TIR 3;
// *** Error in Line 5706 (FB 100): Command not defined. ***
L W#16#C0
JU SEND
WRIT: NOP 0
L DBW 10
L DBW 6
//CALL SFC 20 (
// SRCBLK := P#????? BYTE 0,
// RET_VAL := conv_ret_val,
// DSTBLK := P#????? BYTE 0
// );
// *** Error in Line 5718 (FB 100): CALL SFC20 generated. Please complete parameter list. ***

 
Last edited:
If FB 120, FB 121 and FB 123 not is own blocks, then it is Siemens standard for communication in the S5-135

FB120 = Function block SEND
FB121 = Function block RECIVE
FB123 = Function block CONTROL

Which CPU is used in the old system?
There are differences between function using the communication blocks depending on the CPU used.


L BS xx = Load system data
LIR = Load register, indirect
TIR = Transfer register, indirect
I = Increment (right byte)
 
Some more help for you:

Manual = Standard Function Blocks Handling Blocks
http://support.automation.siemens.com/WW/view/en/19394521

Manual = Signalling Function Standard Function Blocks
http://support.automation.siemens.com/WW/view/en/19394642

Manual = Handling Blocks for the S Processor S5-135U Programmable Controller
http://support.automation.siemens.com/WW/view/en/19342778

Manual = Basic Functions Standard Functions Blocks Programable Controllers
http://support.automation.siemens.com/WW/view/en/18003966

S5 > S7 Training material:
http://www.automation.siemens.com/m...lt.aspx#B6_-_Conversion_from_STEP_5_=>_STEP_7
 
Hi Jera

Thanks for the info, the CPU is a 928B, it,s finding alternative blocks to do the same in S7 which I,m having problems with along with the few other commands. It,s been many many years since I worked on S5 and have never done a conversion before so hence the need for help. I,ve read through a few manuals and these are the only parts I canrt seem to work around at the moment.

S5 blocks are

FB 120
NAME: SEND
DECL: SSNR DKY
DECL: A-NR DKY
DECL: ANZW IW
DECL: QTYP DKS
DECL: DBNR DKY
DECL: QANF DKF
DECL: QLAE DKF
DECL: PAFE QBY
JU OB 230
BE
FB 121
NAME: RECEIVE
DECL: SSNR DKY
DECL: A-NR DKY
DECL: ANZW IW
DECL: ZTYP DKS
DECL: DBNR DKY
DECL: ZANF DKF
DECL: ZLAE DKF
DECL: PAFE QBY
JU OB 231
BE
FB123
NAME: CONTROL
DECL: SSNR DKY
DECL: A-NR DKY
DECL: ANZW IW
DECL: PAFE QBY
JU OB 233
BE


Kind regards

John Vincent
 
Last edited:
Hi John

The interface for the block is described in the manual "Standard Function Blocks Handling Blocks" om page 171

What blocks you need to use to get also depends on the equipment you are communicate with. So you need to examine what opportunities exist in other equipment - maybe there must be a replacement there.

But the standard send / receive blocks in S7 do the same, and it is the same data you want to send / receive as previously
 
Instead of trying to hammer old S5 code into S7 code, can you find out what the old S5 code did functionally ?
It seems to have to do with communication of some sort. The L2 mentioned in the comment "FB L2_SERVER POUR AG 135U" could hint at that it has to do with either an old pre-profibus comms, or it is profibus compatible comms.
Since you are upgrading to an S7, chances are that you are also changing communication methods, yes ? If so, the old code is irrelevant and you have to implement a completely different solution.
 
Hi Guys,

Thanks for the replies,

Jesper, I think it,s Profibus comms or compatible profibus comms

I,m basically replacing a PLC, the rest of the equipment stays the same, communications is over profibus on the part I,m replacing, operation wise, we have a control chair which has an old S5 plc in, this is used as an interface between hard wired push buttons, the signals are converted via plc to profibus which is then converted to Fiber via media converter, then on the other end it,s converted back via another media converter to profibus and connected to the plc which I,m replacing.

This plc inturn controls the equipment after the code maps out S flags in the software. along with this the plc is also connected to a Screen via Profibus and VFD drives via another S5 profi card in the S5 rack, I have this part for the VFD,s done, it,s just the communication side between the PLCs I,m havin a problem with....

With this in mind I was assuming the code and addressing would be the same for the S7 code using alternative fc or fb blocks to the old S5 ones... am I shooting off up teh wrong ally so to speak ?

Thanks in adavance

John Vincent
 
All these devices controlled by the old S5 PLC via profibus, do you have the GSD files for all of them to integrate into the HW Config of the new S7 PLC ?

Do you have the COM PROFIBUS for the S5 PLC ?

edit: I am certain that there no simple 1-to-1 replacement of the old S5 blocks with similar S7 blocks.
There is no other way than understanding what the old code does and implement the same functionality from scratch in the new S7 PLC.
 
Hi Jesper

The only GSD files I have are for the VFD drives other than that I cant find any for the other equipment, the media converters are inline so have profibus going in and fibers comming out then fibers going in and profibus comming out... it,s basically a link between the two plc,s allowing them to communicate with each other. I don,t think there is any GSD files involved with the media converters. the screen is being used as a simple HMI device for monitoring I/O via wonderware.

The entire system stays the same other than the one PLC. I have the config for the CP module but that only gives me basic Profibus settings like address speed etc.

It may be easier to post the S5 program if allowed so it,s easier to understand ?

Regards

John Vincent
 
I suggest you make a sketch of how everything is connected with each other. I cant fully understand your description.
I wont use my time to load your S5 program.
But I do suggest that you look for how the profibus is setup. Maybe there is a COM PROFIBUS project.
 
I dont understand your description, but since you now mention that there is another S5 PLC which communicates to the to-be-replaced PLC, then the program of the other S5 PLC may very well be affected also.

I think that the most important thing before you do anything else is to nail down the big picture of what is what and who communicates with what.

It may very well be the only reasonable solution to replace everything S5 in one go. But that is too early to say based on the information so far.

edit: Please specify the EXACT type numbers of the PLCs and communication cards in question.
 
Last edited:
Hi Jesper

Thanks for the reply

my apologies, I posted the program for referance so people would have something to look at, far better than trying to describe it.

we dont have the option of replacing all of the old S5 plc,s at the moment so need to keep the settings in all of the old stuff as they are.

system diagram is attached

Regards

John Vincent
 
Is it correct that it is only the handdrawn S5 PLC that is the problem now ?

I am not an expert in Profibus in an S5 PLC.
Does the PLC to be replaced have an IM308B or IM308C module ?
I think that the SEND, RECEIVE and CONTROL blocks are only for exchanging the data with the IM308B or IM308C. The actual setup is done in the IM308B or IM308C module with COM PROFIBUS.
I believe that you must investigate the COM PROFIBUS project if you can locate it.
Also, as I said before, the EXACT type numbers of the PLCs and modules in question will be helpful.
 
If the SEND/RECV blocks are adressed to the Profi card's SSNR, I rather think it is a Profibus FDL connection. If it is the case, the card is not an IM308, but a CP 5(and something...CP5431?).

Kalle
 

Similar Topics

Hello have a BK9055 which is driving me nuts... Just want to allocate the IP address, but is fighting me. Am using KS2000 to configure, and have...
Replies
1
Views
1,319
Good Afternoon , I'm sure there are many Ishida Muti-Head Weigh Systems . We have a Ishida CCW-M-214W Multi-Head system . We are...
Replies
1
Views
535
Hi all, have a project which requires reading a weigh head weight over ASCII. Never really touched ascii so struggling a bit. The weigh head is in...
Replies
11
Views
1,243
Good Morning , We have a Ishida Multi-Head Scale . I had experiece with them for chips , crackers , etc. , but now we are using them for...
Replies
7
Views
464
Hello expert I have migrate legacy project that use Applicom OPC DA with 3rd client and S7-400. I see in client code add item string call...
Replies
0
Views
366
Back
Top Bottom