ControlLogix 5000 Word Shift Register

Guest

Guest
G
Hello All,

Is there an instruction in ControlLogix to shift a word like a Bit Shift shifts bits. We are looking for a number to be equal to a bin number to place the product in. I have used multiple MOV instructions in SLC. It would be nice to reduce them down to one instruction.

Thanks
 
As product is transfered through the system we what to move one word with it. Word 1 moves to 2, 2 to 3, 3 to 4 and so on. With the MOV instruction you would have and so on 3 to 4, 2 to 3, 1 to 2. We would like to clean to logix up by not having a bunch of MOV of COP (lenght of 1) instructions. Is there 1 instruction in ControlLogix to do this? A word shift instruction?

Thanks
 
PhilipW we need more information.

For example we have 20 words to shift, Array[0] to Array[19]. We want to transfer from Array[0] to Array[1], Array[1] to Array[2], Array[2] to Array[3] . Can this be done with 1 COP Instruction?
 
PhilipW

You forgot to tell me to load Array[19]. Works great for shifting words down, Array[19] to Array[18], Array[18] to Array[17], Array[17] to Array[16]. To make adjustment to array and system length would cause a lot of editing. We want to shift the words up.
 
Copy Array_A[0] to Array_B[0] with length = 19

Copy Array_B[0] to Array_A[1] with length = 19

All values in Array_A have now been shifted up by one word and Array_A[0] is ready to accept new input data.
 
To shift words up, You will need 2 COP instructions to prevent filling the array with Array[0] value.

COP
Source = Array[0]
Dest = TEMPArray[0]
LEN = <Length of Array - 1>

COP
Source = TEMPArray[0]
Dest = Array[1]
LEN = <Length of Array - 1>
 
Actually I suggest you actually try the very simple one COP method outlined. It works by shifting all the members of the array UP. The newest member is put at the end of the array and the oldest is overwritten at Array[0].

It works by virtue of the sequence the CLX uses to implement the COP.
 
PhilipW:
COP instruction is not smart to do COPY UP from the top, it will always do copy from the bottom, overriding all values.
COPY DOWN works fine.

I tested this with CLX ver 13:

BEFORE

ARRAY[0] = 0
ARRAY[1] = 1
ARRAY[2] = 2
ARRAY[3] = 3

AFTER COP ARRAY[0] ARRAY[1] 3 (copy up)

ARRAY[0] = 0
ARRAY[1] = 0
ARRAY[2] = 0
ARRAY[3] = 0 (This is not result you want)

AFTER COP ARRAY[1] ARRAY[0] 3 (copy down)

ARRAY[0] = 1
ARRAY[1] = 2
ARRAY[2] = 3
ARRAY[3] = 3

To do copy UP you will need 2 COPs like I described earlier:

AFTER
COP ARRAY[0] TEMP[0] 3
COP TEMP[0] ARRAY[1] 3 (copy up)

ARRAY[0] = 0
ARRAY[1] = 0
ARRAY[2] = 1
ARRAY[3] = 2
 
Last edited:
I guess UP is all relative. I meant 1 > 0, which is the same way it looks when monitoring the array in RSLogix.

Copy Down as you have described Contr_Conn is the simplest way to create a Word Shift Register with ONE instruction and one array...as originally requested. So what if the data goes the opposite way to what might be considered UP or DOWN, it works.
 

Similar Topics

I'm not a PLC programmer, so bear with me here ... I was making an AOI with a bunch of BOOL inputs and realized some of them were actually...
Replies
6
Views
1,804
I'm attempting to read tags from a 1756L81E(FactoryTalk Logix Echo) controller using the PLC4J api. I have one read and one write bool setup in...
Replies
10
Views
2,275
Hey All, I'm currently building a control system for a large building in a industrial setting. Doing lighting, vent, roof control, door access...
Replies
12
Views
3,484
I know there's the DTOS Function, but I have a value of "35" that is really "0035", and that's how I want it converted. Looks like the function...
Replies
2
Views
1,513
I am an Electric Engineer working as a maintenance engineer and manage some technician on the production hall now but in the past, I mostly focus...
Replies
12
Views
3,536
Back
Top Bottom