Bit shift register for Siemens S7

Peter Nachtwey said:
Why not load a dword and shift the whole dword. The MSB of the low word must be shifted into the low bit of the high word. It avoids the loop.

Shifting bits one at a time is not efficient.

Peter, like this ?

S7
DB???. DBD 0-8 is opened
DWORD: #SRCPointer; #TgtPointer
==================================
L 32
T #SrcPointer // point bit 32 (from 0)in bit-queye
L 33
T #TgtPointer // bit 33

L DBD[#SrcPointer]
T DBD[#TgtPointer]

L 0
T #SrcPointer // point bit 0 (from 0)in bit-queye
L 1
T #TgtPointer // bit 1

L DBD[#SrcPointer]
T DBD[#TgtPointer]

SET // sets RLO true
R DBX0.0
 

Similar Topics

Good morning (EST), I am trying to implement the code below in on an S7-1200. It's barely half a dozen instructions, but I am stuck; I have not...
Replies
26
Views
5,677
Hi all, I am working with TI. I was told to get a utilization percentage. I have wood coming from a dryer, and when there are open spots on this...
Replies
4
Views
1,558
Hi guys, Sorry I haven't had much time to contribute to the forum lately. I still drop in on occasion... :site: Let's say I have a 32-bit shift...
Replies
4
Views
6,134
Hi everybody, I want to use a bit-shift register (BSL) to track a produkt. I´m using 12 conveyor´s and on the end of each conveyor there is a...
Replies
12
Views
9,530
Hi All. I have a very specific question about tracking using an encoder and bitshift register. We would like to use a Compact or Control Logix PLC...
Replies
40
Views
1,741
Back
Top Bottom