S5 TNB instruction clarification...

uptown47

Lifetime Supporting Member
Join Date
Feb 2008
Location
Over there, next to those boxes
Posts
1,146
Hi all,

I have read the manual section covering the S5 TNB instruction and realise that it copies a source datablock over to a destination datablock. The number of bytes it copies are specified in the instruction (for instance: TNB 50 copies 50 bytes).

My question is this...

In the following code:
Code:
L KH E4C8
LIR 0
ADD KF +431
L KH E416
LIR 0
ADD KF +431
TNB 52

I'm pretty sure that this is copying 52 bytes from DB11 (E416) to DB100 (E4C8) but is it copying from DB11.DBB431 or DB11.DBB0 ?? And therefore is it copying to DB100.DBB431 or DB100.DBB0 ??

The "ADD" instruction is throwing me ?

Thanks for any light you can shed on this.

;-)
 
TNB uses the accumulators to specify the end addresses of the transfer and the add instruction only modifies accumulator 1 so DBB431 is both the source and destination end address.
 
Thanks for the info. So am I right in thinking that in the example above it is copying bytes DB11.DBB431 - DB11.DBB483 across to DB100.DBB431 - DB100.DBB483 ??

Thanks again for your continued help.

;-)
 
Just to add to my original post in case someone else finds this and needs clarification.

The TNB instruction copies the bytes backwards. In other words, the pointer you give it is the last byte and then it copies back from that address.

So, in my example in my first post:

Code:
L KH E4C8
LIR 0
ADD KF +431
L KH E416
LIR 0
ADD KF +431
TNB 52

We are putting the pointer at DW215 (byte 431) and copying 26 words backwards to word 189 (26 words is 52 bytes)

Hope that helps somebody...

;-)
 

Similar Topics

Slogging my way through re-writing a Step 5 program in RS Logix, I have come across this segment: A F 60.7 A T 28 A I 3.4...
Replies
3
Views
1,706
Hi all, The TNB instruction in S5 transfers bytes from one location to another but I'm not sure which is the Src and which the Destination...
Replies
2
Views
2,279
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...
Replies
10
Views
4,758
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,758
Hello all, I am currently trying to establish a message instruction to pass data from a 1756-L73 to a 1756-L71. My communication path from the...
Replies
6
Views
115
Back
Top Bottom