S5 115U 943B "LIR" instruction ?

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all,
I'm stuck trying to transfer some S5 software to S7.

The S5 PLC is a 115U 943B and the S7 PLC is a 314C-2DP.

I've copied the code below and my interpretation of it but I have a couple of queries:

1) How can I find out what KH E4CA (and the other hex addresses) refer to? I've been searching this forum and google with this problem and, from what I've read, it seems that L KH E4CA is refering to a 'System address' that is specific to the S5 PLC type ?? Is this correct? Or is it just a value, like loading L 58570 in S7 ?

2) Reading the code it seems that the initial loading of the ACCU 1 is redundant as each section eventually just jumps to M003 which overwrites ACCu 1 with KH E4CA anyway? Or am I missing something here?

Code:
C DB 101        (OPEN DB 101)
AN F 237.2      (WITHOUT F237.2 JUMP TO THE END OF THE BLOCK)
JC =M001
AN F 91.1       (WITHOUT F91.1 JUMP TO M002)
L KH E416       (LOAD ACCU 1 WITH HEX E416)
LIR 0           (LOAD ACCU 1 WITH THE VALUE AT ADDRESS E416)
ADD KF+51       (ADD 51 TO THE VALUE IN ACCU 1 AND STORE IN ACCU 1)
 
JU =M003         (JUMP TO M003)
M002: AN F 91.2  (WITHOUT F 91.2 JUMP TO M004)
JC =M004
L KH E418         (LOAD ACCU 1 WITH HEX E418)
LIR 0             (LOAD ACCU 1 WITH THE VALUE AT ADDRESS E418)
ADD KF+51         (ADD 51 TO THE VALUE IN ACCU 1 AND STORE IN ACCU 1)
 
JU =M003 
 
 
... SAME PATTERN REPEATED BUT WITH DIFFERENT HEX ADDRESSES (E41A / E41C / E41E / E420 / E422 / E424 / E426 / E428 / E42A / E42C)
 
 
M003: L KH E4CA   (LOAD ACCU 1 WITH HEX E4CA)
LIR 0             (LOAD ACCU 1 WITH THE VALUE AT ADDRESS E4CA)
ADD KF+51         (ADD 51 TO THE VALUE IN ACCU 1)
TNB 50            (DOES THIS SOMEHOW TRANSFER 50 BYTES TO SOMEWHERE???)
 
M001: BE

Any help on how I can transfer this to S7 would be greatly appreciated.

By the way DB101 (the DB that is opened initially) has 255 words in it and they all just hold arbitary values 250, 80, 25, 10 etc etc

A big thanks for any light you can shed on this.

Cheers

;-)
 
Hi Peter

Thanks for the links. I've read some of them before I posted but I was still stuck.

A BIG thanks for the link to the memory map. I'm now a bit further along. Here's the latest interpretation with my queries regarding this:

Code:
C DB 101        (OPEN DB 101)
AN F 237.2      (WITHOUT F237.2 JUMP TO THE END OF THE BLOCK)
JC =M001
AN F 91.1       (WITHOUT F91.1 JUMP TO M002)
L KH E416       (LOAD ACCU 1 WITH MEMORY MAP ADDRESS OF DB 11)
LIR 0           (LOAD ACCU 1 WITH POINTER POINTING AT DB11.DW0 ) - [COLOR=#ff0000]IS THIS CORRECT?[/COLOR]

ADD KF+51       (ADD 51 TO THE VALUE IN ACCU 1 AND STORE IN ACCU 1) - [COLOR=red]ACCU 1 NOW HOLDS POINTER DB11.DW51 ? IS THIS CORRECT? IS IT AN OFFSET OF 51 BYTES OR WORDS ?[/COLOR]
 
JU =M003         (JUMP TO M003)
M002: AN F 91.2  (WITHOUT F 91.2 JUMP TO M004)
JC =M004
L KH E418         (LOAD ACCU 1 WITH MEMORY MAP ADDRESS OF DB 12)

LIR 0             (LOAD ACCU 1 WITH POINTER POINTING AT DB12.DW0)

ADD KF+51         (ACCU 1 POINTER NOW POINTS TO DB12.DW51 ?)
 
JU =M003 
 
 
... SAME PATTERN REPEATED BUT WITH DIFFERENT HEX ADDRESSES (DB 13 through to DB 22 inclusive)
 
 
M003: L KH E4CA   (LOAD ACCU 1 WITH MEMORY MAP OF DB 101) - [COLOR=#ff0000]HAVE WE NOT JUST OVERWRITTEN OUR POINTER WE CREATED EARLIER??[/COLOR]
[COLOR=#ff0000][/COLOR]
LIR 0             (LOAD ACCU 1 WITH POINTER POINTING AT DB101.DW0)

ADD KF+51         (ACCU 1 NOW EQUAL TO DB101.DW51)

TNB 50            [COLOR=red](LOGICALLY I WOULD SAY THAT THIS COPIES 50 BYTES OF DB11.DW51 - DB11.DW101 ACROSS TO DB101.DW51 - DB101.DW101 BUT HAS ACCU 1 NOT BEEN OVERWRITTEN WITH THE L KH E4CA INSTRUCTION?? )[/COLOR] 
M001: BE

I've got a great block written by "L D[AR2,P#0.0]" from one of the links earlier in the thread to transfer DB's over but I just need to understand 'what' I need to be transfering.

Thanks again for your continued help.

;-)
 
Right... after doing some digging and searching and muddling... I think I've sussed what's happening.

I'll post it here in the hope that it might help someone who finds this thread in the future but I would be grateful if someone could confirm this is correct:

Code:
C DB 101        (OPEN DB 101)
AN F 237.2      (WITHOUT F237.2 JUMP TO THE END OF THE BLOCK)
JC =M001
AN F 91.1       (WITHOUT F91.1 JUMP TO M002)
L KH E416       (POINTER TO  DB11.byte 0)
LIR 0           (LOAD ACCU 1 WITH POINTER POINTING AT DB11.byte 0 )

ADD KF+51       (ADD 51 BYTES TO POINTER - DB11.BYTE 51) 
JU =M003         (JUMP TO M003)

 
M003: L KH E4CA   (DB 101.BYTE 0 POINTER )
 
LIR 0             (LOAD ACCU 1 WITH DB101.BYTE 0)

ADD KF+51         (ACCU 1 NOW EQUAL TO DB101.BYTE 51)

TNB 50            [COLOR=red](SRC IS DB11.BYTE 51 - DESTINATION IS DB101.BYTE 51 AND IT COPIES FROM BYTE 51 TO 0 ACROSS)[/COLOR] 
M001: BE

As I said. Can someone confirm that is correct.

It seems to be right from what I've read...

Many thanks for all your help (PeterW) in pointing me in the right direction. Much appreciated.

;-)
 
hi every body please if some one can help me
i need to megrate a program from s5 to Rslogix 5000 how can i translate the (LIR) instruction
 

Similar Topics

Hello Dear, I am using a PLC SIMATIC S5 115U CPU 943B my problem that there is no output on CPU (943 B) ⚫️RUN STOP 🔘RUN 🔘STOP 🔘QVZ 🔘ZYK...
Replies
3
Views
2,452
I did this once before but it was about 30 years ago I just tried it on a plc this morning and,when i fitted the eeprom and downloaded the...
Replies
6
Views
2,153
Dear friends, happy new year 2013. I have a problem with the s5 plc 115u 943b, the stop and basf lights are "on" and the digital output is not...
Replies
9
Views
3,757
Hello Friends I have in use a S5 115U CPU943B Siemens PLC , the my problem is, that I do not have the procedure to download /upload the program...
Replies
1
Views
3,192
In S-115u cpu943b plc i removed eprom & battery then i done the overall reset , after overall reset , i put the switch in run mode (only with...
Replies
10
Views
2,785
Back
Top Bottom