RSLogix 5000 Structure Shift

BMLLER6758

Member
Join Date
Aug 2006
Location
Kiel
Posts
93
Hallo Everybody !

I was a little confused here. I try to shift a structure with FFL

What I want is to shift a structure of values from Array[2] all the way down to Array[80]

May Source Numbers are in Array[1]

When I made the first shift the numbers come to Array[2]

When I made the second shift new number from Array[1] come to Array[3], but that is not what I want !!

I want it to come to ARRAY[2] and the numbers, that where in Array[2] get to Array[3]

What did I wrong ?????;)

I think there should be a way like bit Shifting with a BSR Instruction ?!?!?!

Hanx in advance !
 
a "RATCHET" for some data ...

if I understand your question correctly (and I think that I do) then I suggest that you try the "ratchet" type operation shown below ... you'll need to set up a "temporary" storage array to make it work – but I've got a hunch this will do what you want ... you might also have to play around with the "length" settings too – but based on how I understand your question, this is pretty close to what you're asking for ... basically I'm just wondering why you specified "starting" at ARRAY[1] - instead of "starting" at ARRAY[0] ... is that a typographical mistake? - or is that really what you want to do? ... either way, you should be able to make this work - but try it out a few times with some sample data to make sure it's doing what you want ...

also ... note that due to the way the ControlLogix scan sequence is set up, there is a chance that some of the data within the array may be changed/altered/updated PART WAY THROUGH THE SHIFTING OPERATION ... if this could have an adverse effect on your system, then read up on the CPS command and consider using it instead of the (somewhat faster) COP ...

RATCHET.JPG
 
Last edited:
and another way of getting the job done - with a "RIPPLE" ...

now then ... if you have no problems with a "backwards" (bottom to top) flow of data through the array, you can save the memory required for the "temporary" array I mentioned above (and some extra COPy time) by using the technique suggested by my distinguished colleague, Alan Case ... I usually call this a "RIPPLE" effect ...

the rung shown below should be helpful in setting it up ... pay careful attention to the [2] and [1] values in the COP command ... (most people get these backwards when they first try this technique) ...

good luck with your project ...

RIPPLE.JPG
 
Last edited:
Hanx Ron !

Thats exactly what I want !

I want to use ARRAY[0] in the Panel view as the "Show ARRAY"

I want to use it for some Protocols of a Batch Process

So in A1 is the actual process when it ready I want to shift it in A2. And so on.

When the boss want to see the protocols, he can see them in A0 !

many thanks !
 
Hi. You have really made it quite complicated. See Rons Post 4. That is all that is required.
Also you are taking 48 scans to do the shift which means you will have to disable use of that array elsewhere in the program because during the 48 scans the data will NOT be correct.
I notice that you company is a "Rockwell Solutions Provider". I am not sure if that means the same as it does in Australia or the USA but here it means that Rockwell has certified your company to the highest level of a "System Integrator"

Regards Alan Case
 
Hallo Alan,

I don´t know if Rons Post 4 will work.

I want to to shift the Array 49 to array 50 then array 48 into arry 49

then array 47 into array 48 and so on till Array 1 into array 2

Array 1 should never be touched by anything then the actual data !

In Rons post the Array 1 will be "killed" each time by the copy

instruction ! Or am I wrong ???

regards

Bernd
 
I think Ron misunderstood what you want.

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?

In that case you need to start from top, move Array[79] to Array[80] then move Array[78] to Array[79].
 
Yes ! Thats correct ! But I think Post 2 will work.

And that looks much nicer than my soulution, so Alan is right, I made it too complicated !
 
Hi. You have really made it quite complicated. See Rons Post 4. That is all that is required.
Also you are taking 48 scans to do the shift which means you will have to disable use of that array elsewhere in the program because during the 48 scans the data will NOT be correct.
I notice that you company is a "Rockwell Solutions Provider". I am not sure if that means the same as it does in Australia or the USA but here it means that Rockwell has certified your company to the highest level of a "System Integrator"

Regards Alan Case

I am a solution Provider with all the certification as you know !

But that doesn´t mean I know everything !
 
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) ...
 
Ron hanx for your words.

Your Post 3 is fine and works great, as I want !

Thats exactly what I want !

Have a nice Dinner

regards

Bernd
 
I am very sorry, but I don´t want to confuse anybody. My last post was wrong. The code didn´t work. I scetch a excel file how I want it work.
So please take a look at it. And give me hint how it should work easier then my solution

Hanx a bunch !!!

Data shift.jpg
 

Similar Topics

Hi all, In my Rslogix 5000 project, I use FAL instruction(File Arithmetic and Logic),Dest and expression are INT data type, When use res...
Replies
12
Views
12,649
Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
95
Greetings ... someone sent me a request for some student handsouts that I developed ... turns out that I had this hosted on my business website...
Replies
0
Views
111
Thank you for any and all responses/help. I have an RSLogix 5000 v20 and a Cognex In-Sight v5.9 spreadsheet (8502P). I can not figure out how to...
Replies
0
Views
102
Hi All, I've been pulling my hair out trying to fix this for a few days and need some advice. I have V19.01, v20.05, V21, V24, V30, V31, V32...
Replies
5
Views
355
Back
Top Bottom