Greetings TurpoUrpo ...
I think Ron misunderstood what you want.
well, that's quite possible ... basically what I THINK is required is that the data values stored in an array need to "march" step-by-step through the array ... as each cycle is completed, the oldest/stalest data value is discarded from the array – and a new/fresh data value is inserted into the array ...
isn't that what you had in mind when you wrote the following? ...
You Have array[0..80] of <type>. Now you want that Array[1] stays the same, Array[80] gets discarded and Array[1+i] gets copied to Array[1+(i+1)] correct?
but you also wrote this:
In that case you need to start from top, move Array[79] to Array[80] then move Array[78] to Array[79].
no offense intended – but have you actually tried that approach? ... (once again, I might just be misunderstanding what you're saying – and if so, I sincerely apologize) ...
if I understand what you've written, then it looks like you're going to need about 80 MOV (or COP) commands to get the "data shifting" job done ... now there's really nothing "wrong" with that approach – but it's going to take a lot more horsepower to accomplish than most programmers would like to use ...
now then, earlier I offered TWO solutions to what I THINK is the original problem ...
the solution that I offered in Post #3 will make the data values stored in the array "ratchet" FORWARD through the array ... some people like this "ratchet" method because the data flows from LOWER location addresses to HIGHER location addresses (or "forward" as most people phrase it) ... (or from TOP to BOTTOM as others describe it) ...
on the other hand, the solution that I offered in Post #4 will make the data values stored in the array "ripple" BACKWARDS through the array ... and some people prefer this second method because it requires less memory and less processing time to shift the data ... but some find it confusing because the data values move from HIGHER location addresses to LOWER location addresses (or "backwards" as most people phrase it) ... (or from BOTTOM to TOP as others describe it) ...
although it's not in a ControlLogix format, the information in the following post might be helpful ...
http://www.plctalk.net/qanda/showthread.php?p=59916&postcount=3
if NONE of this works out then maybe our original poster needs to draw us a simple sketch of how he wants the data to move through the array ... I'm absolutely CERTAIN that we can make it do whatever is required – but it's a LOT easier to program with a clear-cut goal in mind ...
(disclaimer: I'm late for dinner – and I apologize in advance for any "Copy-and-Paste" errors in this post) ...