S5 115u LIR TIR & TNB Command

edomiredo

Member
Join Date
Dec 2014
Location
Jakarta
Posts
15
I have a S5 115U CPU 943B. I have problem with S5 to S7 conversion. I don't know how to change LIR, TIR and TNB command. I've read in many forums about it, but I still can not understand it. Is there anyone can help me? here the sample program,

L FW 214 <------ THIS VALUE KF +150 = KH 0096
SLW 1 <--------- *2 KH 012C
L KH E400 <----- I KNOW THIS THE START ADDRESS OF DB0 BYTE 0
OW <------------ KH E52C => IT'S MEAN DB150 BYTE 0? o_O
LIR 0
T FW 252
L KH 0000
!=F
=F 198.0
BEC
L FW 216 <------ THIS VALUE KF +100
SLW 1
L KF +30
+F
T FW 254
L FW 252
L KF +2
LIR 0
SLW 1
L FW 254
<F
= F 198.1
BEC
L KH 0000
T FY 198
L FW 254
L FW 252
+F
T FW 252
T RS 248

L KH 0000
L KF +244
+F
T FW 254
L FW 252
L FW 254
TNB 32 <------ THIS AUTO CONVERT TO SFC20 BUT ERROR
***

I need the explanation about my program because it's urgent and i still stuck on this project :cry:. i hope somebody can help me. Thanks

nb: if you need full program i can upload the s5d file.
 
Last edited:
Hi!

From a manual:

TNB: Transfer a data block (byte by byte)

A memory area is transferred in the program memory as a block.
End address destination area: ACCUM 1
End address source area: ACCUM 2



I have a S5 115U CPU 943B. I have problem with S5 to S7 conversion. I don't know how to change LIR, TIR and TNB command. I've read in many forums about it, but I still can not understand it. Is there anyone can help me? here the sample program,

L FW 214 <------ THIS VALUE KF +150 = KH 0096
SLW 1 <--------- *2 KH 012C
L KH E400 <----- I KNOW THIS THE START ADDRESS OF DB0 BYTE 0
OW <------------ KH E52C => IT'S MEAN DB150 BYTE 0? o_O
LIR 0 <<< Reads start address of DB150 in RAM
T FW 252
L KH 0000 <<< If address is 0, the DB isn't there
!=F
=F 198.0
BEC
L FW 216 <------ THIS VALUE KF +100
SLW 1
L KF +30
+F
T FW 254 <<< The address of the last byte to be transfered


L FW 252 <<< Start address of the DB header
L KF +2 <<< Offset to DB length (in the header)
LIR 0
SLW 1
L FW 254
<F
= F 198.1 <<< DB too short, jump out
BEC

L KH 0000
T FY 198 ??? Message to another program? Resetting triggers?

L FW 254
L FW 252
+F
T FW 252 <<< Add up start address and number of bytes.
The TNB works from high to low address (decending)

T RS 248 ??? Pass. Probably a message to other programs.


<<< The code below calculates the sink address, but as it is here it gives no meaning to me. ... It copies into a fixed RAM adress from 213 to 244. It sounds strange, because i think this isn't a free user area. (Originally programmed by Dr. Frankenstein?).


L KH 0000
L KF +244
+F
T FW 254



L FW 252 <<< Source address, RAM
L FW 254 <<< Sink address, RAM
TNB 32 <<< moves 32 bytes
***

I need the explanation about my program because it's urgent and i still stuck on this project :cry:. i hope somebody can help me. Thanks

nb: if you need full program i can upload the s5d file.


Good luck!

Kalle
 
Last edited:
Thx Kalle.

but i'm sorry i missed 1 command. 🙃
this is the right program.

L FW 214 <------ THIS VALUE KF +150 = KH 0096
SLW 1 <--------- *2 KH 012C
L KH E400 <----- I KNOW THIS THE START ADDRESS OF DB0 BYTE 0
OW <------------ KH E52C => IT'S MEAN DB150 BYTE 0? o_O
LIR 0
T FW 252
L KH 0000
!=F
=F 198.0
BEC
L FW 216 <------ THIS VALUE KF +100
SLW 1
L KF +30
+F
T FW 254
L FW 252
L KF +2
-F <------- I missed this.
LIR 0
SLW 1
L FW 254
<F
= F 198.1
BEC
L KH 0000
T FY 198
L FW 254
L FW 252
+F
T FW 252
T RS 248

L KH 0000
L KF +244
+F
T FW 254
L FW 252
L FW 254
TNB 32 <------ THIS AUTO CONVERT TO SFC20 BUT ERROR
***

can you give more detail about the explanation? coz i don't know the final address of source and sink. thank you.

-sorry for my bad english-
 
Thx Kalle.

but i'm sorry i missed 1 command. 🙃
this is the right program.

L FW 214 <------ THIS VALUE KF +150 = KH 0096
SLW 1 <--------- *2 KH 012C
L KH E400 <----- I KNOW THIS THE START ADDRESS OF DB0 BYTE 0
OW <------------ KH E52C => IT'S MEAN DB150 BYTE 0? o_O
LIR 0
T FW 252
L KH 0000
!=F
=F 198.0
BEC
L FW 216 <------ THIS VALUE KF +100
SLW 1 <<< = 100x2 = 200
L KF +30 <<< Start addr. bias is byte 30
+F
T FW 254 <<< Should now be 230

<<< The code below checks if the DB is long enough

L FW 252
L KF +2
-F <------- I missed this.
LIR 0
SLW 1
L FW 254
<F
= F 198.1
BEC
<<< ... to here


L KH 0000
T FY 198

<<< The source addres for TNB is...

L FW 254 <<< 230 plus...
L FW 252 <<< ....Start adr. of DB150 in RAM
+F
T FW 252
T RS 248

<<< TNB starts from DB150, DW115 (230/2) and moves 32 bytes (= 16 DW) ascending, inclusive DW100.



<<< Please double check this bit of code. It is strange.
L KH 0000
L KF +244
+F
T FW 254
<<<<<<<<


L FW 252
L FW 254
TNB 32 <------ THIS AUTO CONVERT TO SFC20 BUT ERROR
***

can you give more detail about the explanation? coz i don't know the final address of source and sink. thank you.

-sorry for my bad english-

Hope it helps
Kalle
Ps! Your English is surely better than mine.:D
 
Many thanks Kalle,
it's mean that source address is DB150.DW100-DB150.DW115, right?
and for that code i will check tommorow, because my project files are on my office. but i think it's already the right code.
 
oh my bad, i wrote the wrong code. 🙃

L FW 214 <------ THIS VALUE KF +150 = KH 0096
SLW 1 <--------- *2 KH 012C
L KH E400 <----- I KNOW THIS THE START ADDRESS OF DB0 BYTE 0
OW <------------ KH E52C => IT'S MEAN DB150 BYTE 0? o_O
LIR 0
T FW 252
L KH 0000
!=F
=F 198.0
BEC
L FW 216 <------ THIS VALUE KF +100
SLW 1
L KF +30
+F
T FW 254
L FW 252
L KF +2
-F <------- I missed this.
LIR 0
SLW 1
L FW 254
<F
= F 198.1
BEC
L KH 0000
T FY 198
L FW 254
L FW 252
+F
T FW 252
T RS 248

L KH EE00 <----- this is the right code thx Kalle.
L KF +244
+F
T FW 254
L FW 252
L FW 254
TNB 32 <------ THIS AUTO CONVERT TO SFC20 BUT ERROR
***

Now can you explain me about the code and the sink address? Thx.
 
oh my bad, i wrote the wrong code. 🙃


L KH EE00 <<< Start address of the M-area
L KF +244 <<< add 244 to point to MB244
+F
T FW 254 <<< TNB will move values from the DB mentioned before and into the range MB(244-31) to MB244.
L FW 252
L FW 254
TNB 32 <------ THIS AUTO CONVERT TO SFC20 BUT ERROR

Now can you explain me about the code and the sink address? Thx.

Kalle
 
Thx Kalle.
now i knew that the source address is DB150.byte100-byte115 and the destination address is FY214-FY244 (31 bytes). right?

ps: sorry the right command is TNB 31. :oops:
 
I have some problems again. Can you help me to edit the program below? Thanks.

S M 214.0
L W#16#E400 //Datablock 0
L DBB 2 //offset
SLW 1 //*2
+I //DB(offset*2).byte0
// LIR 0;
// *** Error in Line 3482 (FB 159): Command not defined. ***
T MW 224
L 0
==I
L W#16#230
BEC
L MW 224
L -2
+I
// LIR 0;
// *** Error in Line 3492 (FB 159): Command not defined. ***
L -5
+I
T MW 200
L MW 224
L DBW 6
SLW 1
+I
T MW 224
L DBW 4
T MW 226
 
Last edited:
Hi!

You should look at the original S5 code, and not at the misconverted S7 code.

What is it you don't catch in this code bit?

I added the description of the block header of an S5 block so that you are able to do the manual converting yourself.

Kalle
 
i'm sorry. here the source code from S5.

...
S F 214.0
L KH E400
L DL 1 -----> it's from DB158 the value is F+100=KH0064
SLW 1
+F
LIR 0
T FW 224
L KF +0
!=F
L KH 0230
BEC
L FW 224
L KF -2
+F
LIR 0
L KF -5
+F
T FW 200
...

Thx Kalle, but i don't understand about the block header. where it is???:confused:
 
Last edited:

Similar Topics

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...
Replies
7
Views
4,762
I am working with a Siemens S5 115U 944 program. I have several questions, but probably the most frustrating so far is the following code. I have...
Replies
4
Views
6,844
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,464
I have a S5-115U, 941B.... In OB1, I can see some block calls Like JU PB16, JU PB17 and so on.... But in the Directory I don't see these blocks at...
Replies
44
Views
10,790
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,159
Back
Top Bottom