Word shift Logix5000

the_msp

Lifetime Supporting Member
Join Date
May 2008
Location
Northern Ireland
Posts
1,271
I am trying to track product as it advances through a rotary indexing table. Been playing about for the past hour but not making much progress.

The table has 4 nests. Nest 1 is load and 4 unload. I have a DINT array "Nest(0)...Nest(3)". The id is a 4 digit integer. I have a rung where the 1st ID is MOVed to Nest(0) from InitID (initial ID) which is entered on the HMI.

I tried to MOV the data but ended up having the 1 ID entering all nests simultaneously. I tried to resolve this with ONS and OSR but didn't have any joy.

I am now trying to use the COP function. I read you have to do it backwards. So once my initial ID is in nest one, I trigger a COP with the same bit that indexes the table. The COP data is:
Source: Nest(3)
Destination: Nest(2)
Length: 4

...this isn't working either? :unsure:
 
try this:

The COP data is:
Source: Nest(1)
Destination: Nest(0)
Length: 4

if the "going backwards" idea gives you a problem - look up "ratchet" on the forum ...

that method takes up twice as much memory (who cares for just 4 locations in your example?) but the data can be made to "march forwards" - which makes it easier for us humans to visualize what's going on in the system ...
 
Last edited:
Thanks Ron, I had a go at that. I entered 1001 into the HMI and triggered the bit which MOVed this to Nest(0)

I then clicked the button to index the table, and the DINT array filled all elements with the number "-2,147,483,637"
 
When I indexed the table, all 4 nests got the value of the initial ID
The COP instruction and the technique illustrated at the link must also be 'one-shotted' if you don't want your data to quickly transit the file. MOV, COP and suchlike instructions execute whenever rung conditions are true.

Instructions such as: FAL, FSC, and counter instructions (all of which have associated status bits) execute only once for each false-to-true rung transition. The condition must go false and true again to get another operation.
 
If you want to keep your data in order then one shot a series of Copy instructions 2 to 3 then 1 to 2 then 0 to 1 then Int_ID to 0. This way you move your data before you over write you data. I said series or you can branch. This Logic could be solved in a series left to right or with a branch Top to Bottom.
 
try the RIPPLE method like this ... it's working just fine (at least the way that I THINK that you want it to) on my system ...

.

RIPPLE_NEST.PNG
 
Last edited:
series is fine for RSLogix5000 - I usually put them in branches so that other platforms can run the same code ...

glad that you got it working ...
 
I'd strongly suggest just using the FFL/FFU instructions and being done with it.

Shift in data with a one shot each index using a FFL, and then when the .DN bit is set, you shift out data using the same trigger.
I usually use FFL/FFU in the same rung, triggered by a my single shift one shot:

ONS WhatEverBit BST FFL MyFIFO (parameters) NXB XIC MyFIFO.DN FFU MyFIFO (parameters) BND.
 

Similar Topics

Can't find any "word shift" instructions in A-B (Siemens and others have them). I want to shift words left (256 elements), to work just like a...
Replies
7
Views
4,429
I have an array of 10 words. I would like to shift them down for tracking purposes, entering the new value into let's call it "Location[0]". And...
Replies
9
Views
2,515
Hello everyone, I am trying to do a word shift in a bin collection system in CLX 5000. The problem is there are 17 bins in each word. There is a...
Replies
2
Views
1,655
I've got three INT words in RSLogix 5000 Version 12.06. They are Sawset, Sawset1, and Sawset 3. I have three momentary pushbuttons set to assign a...
Replies
11
Views
2,140
Hello, I am using compactlogix L43's on v20 and L27's on v21. I use a MAVE in a periodic routine to bring in and average raw data, sample rate...
Replies
6
Views
2,159
Back
Top Bottom