Sum of a moving array

Jiftim

Member
Join Date
Oct 2010
Location
Wisconsin
Posts
10
Hey everyone. I am very new to using RSlogix and from the bit of searching this forum I've done, I found that everyone seems to be really helpful so I'm hoping you'll be able to help answer what I hope to be a simple question.

I am using RSlogix 5000 ladder logic (dont know how to use FB for ST logics)and I need to find the moving average of the last 200 objects past a cull flipper to see which objects passed by and which ones were culled off.

My thought for this was to use a PE as a trigger to count the 200 packages and to use an array and counter to store whether the cull flipper was triggered or not. Now, where I am stuck is being able to sum the values of the array. I would think there would be a single instuction to do this rather than having to use a large amount of ADD instructions to count each individual element of the array. But I may be wrong since I haven't found one yet. At one point, I thought the MAVE instruction was my ticket but isnt available in ladder logic. Does someone have an answer or, perhaps, a better way to do this than what I am thinking?
 
Personaly, I would use indirect addressing run from a counter. Theres no need to add 200 numbers and average them every time a part passes the PE. You only need to subtract the 200th value, remove it from the array and add in the new value at the (array[current counter value])(/200).
 
I use jimfun71 method. It is the best for just averaging.

I am using RSlogix 5000 ladder logic (dont know how to use FB for ST logics)and I need to find the moving average of the last 200 objects past a cull flipper to see which objects passed by and which ones were culled off.
I don't understand the purpose though. Too many questions are asked and answers given but they are the right answers to the wrong question.

If I want to know which objects were culled off I would keep a circular array with zero for the elements that were "culled off".
 

Similar Topics

Hi again, I´m still working on the upgrade from 500 to 5000 of this program. I found something that I cannot explain, in RSLogix 500. It seems...
Replies
0
Views
815
First, a background on the equipment so you know what is going on. I have an AB ControlLogix L63 processor controlling some Mitsubishi...
Replies
17
Views
6,009
hello, I am a beginner and also new here, I was reading something about PID loop, there is two tanks , each with a sensor of pH, the control...
Replies
9
Views
3,078
Hello all, I'm trying to recreate the following checksum calculation in the PLC. The example is written in C++ of which I am not very familiar...
Replies
8
Views
3,055
I'm trying to sum the last part of an array starting at element 70 for 30 elements. I placed a 70 in the .POS element of the FAL and it gets...
Replies
66
Views
14,531
Back
Top Bottom