S5 to S7

timodc

Member
Join Date
Nov 2006
Location
near Rotterdam
Posts
14
Like lots of other people I ran into a couple of problems while converting S5 to S7 with the 'SIMATIC S5 converting Tool'. Mainly the problem is the commands from S5 that cannot be converted to S7.

In the S5 converting tool there is the possibelity to insert MACRO's to simulate the S5 commands in S7.

Is there anyone that tried to make these MACRO's? For example, how can I implend this piece of S5 in S7:

T DBW 8;
L DBB 9;
+ L#977920;
LIR 1;
SLD 4;
L MW 214;
+D;
MAB
LRW +0;
L MW 240
OW;
T MW 240
LRW +1;
L MW 242
OW;
T MW 242
LRW +2;
L MW 244
OW;
T MW 244
LRW +3;
L MW 246
OW;


My main concern are the commands LIR, MAB and LRW (Also TIR is a problem, but not in this part)

friendly greetings,

Timo
 
More to the point, what is at address W#16#EEC00 in the step 5 system (this is L#977920) because it will not exist in a Step 7 system. You need to understand the Step 5 functionality and then implement it in Step 7 - the code converter/macro facility are of no use in this situation.
 
I can't really retrieve the version of the CPU..

you mean that the al the adresses have to be changed..? after converting with the Simatic tool this is how it looks:

T DBW 8; // ===> DB-NR.INTERFACE-DB
L DBB 9;
+ L#977920; // )
// LIR 1; // ) // *** Error in Line 925 (FB 34): Command not defined. ***
SLD 4; // ) ADRESSE LESE-DATEN
L MW 214; // )
+D; // )
// MAB // ) // *** Error in Line 930 (FB 34): Command not defined. ***
// LRW 0; // ) // *** Error in Line 932 (FB 34): Command not defined. ***
L MW 240; // ) 1. WORD
OW; // )
T MW 240; // )
// LRW 1; // ) // *** Error in Line 937 (FB 34): Command not defined. ***
L MW 242; // ) 2. WORD
OW; // )
T MW 242; // )
// LRW 2; // ) // *** Error in Line 942 (FB 34): Command not defined. ***
L MW 244; // ) 3. WORD
OW; // )
T MW 244; // )
// LRW 3; // ) // *** Error in Line 947 (FB 34): Command not defined. ***
L MW 246; // ) 4. WORD
OW; // )
 
Are there not some electrical schematics which show the plc hardware - this would normally specify the CPU type and what cards are connected.
 
I only have the program and have to convert it from S5 to S7.. partly done by the converting tool.. and now I have to find a way to implend functions from s5.. in S7..

I know what the functions do in S5.. but this beeing the first time I'm converting I just need a sample how I can do this..

for example, you got LIR.. load register indirectly.. In S7 there are no instructions for absolute addressing. And these are replaced by new instructions (like.. access to data words greater than 255)

And MAB.. transfer the contents of AKKU 1 in to the Baseregister.. and I believe there isn't a basregister in S7.. so in this case I have to use another register.. or such..

So.. how would you handle this.. except for re-writing the whole program.. ?? Like.. what is happening in the this little piece of the program.. I know what the commands do.. but i'm not that pro to see the connections between the commands.. some things are logic.. but I just don't see the light :) I see what happens in big lines.. but I can't explain the lines 1-by-1..

allready many thanks for the help..

greetz TiMo
 
LIr1 is load register with memory contents of memory word n (n being 1 (0-2)

mab is transfer A1 to B (register to register transfer 20 bits)
add value to BR register (result = n ) then load accumulator 1-L with memory word n
TIR = transfer register contents to memory word n
It sounds to me if this is some of siemens own code & you would need to understand where these memory areas are.
 
I'm guessing that the CPU is a 948 because W#16#EEC00 is where the address list for DB's 0 to 255 is located.

So, DBB9 contains the data block number to be opened
MW214 contains the offset (in words) into the data block so the Step 7 code looks like this:

Code:
	 L	 DBB	9					//DB number required
	 T	 #iDBNumber				 //temp variable
	 OPN DB [#iDBNumber]			 //open DB required
	 L	 MW 214					//offset into data block
	 SLD 4						 //convert to pointer format
	 LAR1							 //use address register 1
	 L	 DBW [AR1,P#0.0]
	 L	 MW 240
	 OW	
	 T	 MW 240
	 L	 DBW [AR1,P#2.0]
	 L	 MW 242
	 OW	
	 T	 MW 242
	 L	 DBW [AR1,P#4.0]
	 L	 MW 244
	 OW	
	 T	 MW 244
	 L	 DBW [AR1,P#6.0]
	 L	 MW 246
	 OW	
	 T	 MW 246

Hope this helps.
 
Back
Top Bottom