RS Logix 5000 MAVE instruction

Carolinaash

Member
Join Date
Mar 2008
Location
SC
Posts
5
I have a use for the MAVE instruction this is a moving average instruction. I cannot use this in ladder only structured text and function block. My preference would be ladder but I guess I will use function block for this. I am going to use this on a pressure reading to give me a better output. Anyone with any help on this instruction or other ideas?
 
why don't you tell us what you need the "moving average" to do? ... for instance, how many items? ... what types (DINT, INT, etc.) of items ... what will be the maximum - and minimum - values allowed in each of the locations? ...

even without seeing your application, I can just about guarantee that whatever you want to do can be done in ladder logic ...

so where in SC are you? ... and welcome to the forum ...
 
We have reactor pressure readings on RS View and we also trend this info and record this to a database. I was ask to clean up the numbers so that the operators can get a better feel and control. I picked the MAVE instruction. We are reading in inwc (inches water column), and the readings are critical. Not sure how to setup the MAVE instruction.
From Lexington,SC
 
Additionally, a liitle more information may help us help you, because depending on why you need a "better ouput" there may be a better instruction, such as one of the lag filter instructions.
 
Carolina your MAVE in block instructions is the same as a using a fifo queue in ladder, where the numbers of samples is the size of the fifo array, sampling time depends on how fast you want to collect data, then you average what is in your fifo array and this average value is the same as your MAVE output value.
 
for instance, how many items? ... what types (DINT, INT, etc.) of items ... what will be the maximum - and minimum - values allowed in each of the locations? ...

if you don't mind answering those questions for us, we'll be glad to set it up and post a specific example for you ...
 
Greetings Carolinaash ...



and I am not sure on the number of samples.



I can't think of any way to say this without sounding "snotty" but I ASSURE you I don't mean it that way ... so here goes ...



until you nail down specifics like that, you aren't going to be able to set up the MAVE - or ANY type of averaging operation ...



let's see where we stand ...



here is a "fresh out of the box" MAVE instruction on a FBD sheet ...

MAVE.JPG


if you click the circled button, you'll go "inside" the instruction ... these are the types of "blanks" that you'll have fill in to make it work ...



is this helping - or do you already know this part? ... no offense intended - just trying to find out where we stand ... we're really trying to help ...
 
this is getting picky - but we might as well go ahead and cover it ...

We are reading in inwc (inches water column), and the readings are critical.

when you say "critical" do you mean that it's "important that they be precisely recorded" ... or maybe something else ...

the point is that by recording these values in a DINT array, you're not going to get any "fractional" parts ... for example: you can have 88 "WC - but you can't have 88.88 "WC ... is that OK? ... if not, then we need to explore deeper into how the data is presently being collected and recorded ...
 
thanks for the help. I have looked up the instruction and clicked on the view block properties box. Is the number of samples something I choose or how do I calculate this? i am very comfortable in ladder just not FB.
 
the other members will probably help you nail this down very soon - but I've got to leave "computer land" for today ...

feel free to call me ... see the "Contact Us" page by clicking the link under my signature ...

good luck with your project ... wish I had more time to help ...
 
The number of samples is asking how many readings do you want to average together to get an average. I usually work with 5, or 10, it just depends on how realtime you want it. If it is just for display and not control 10 or more is probably best. All that also depends on how often you take a sample. I usually set up a timer to sample enable every 200-300 ms. It may not make a difference depending on how much your process bounces around.
 
Carolinaash said:
thanks for the help. I have looked up the instruction and clicked on the view block properties box. Is the number of samples something I choose or how do I calculate this? i am very comfortable in ladder just not FB.

I have a very tidy ladder based example I can post for your tomorrow (when I am at work) being used in a SLC 5/05. I get the impression (but you need to clarify) that you need to have a quick responding but filtered value for your operators to view.

Since you mentioned that the readings are critical, we need to nail down exactly what you want the behavior to be in situations like:

a. First running the program with potentially invalid readings (like powering up with yesterdays numbers still in there).

b. How fast you need the average to respond to actual changes (1/2 a second might be too slow? 3 seconds might be just fine?)

c. "Noisy Data": Do you want to clamp the reading between known or recorded limits before averaging? Do you want to discard values that can be proven as "noise"? In most cases, you will include them in your average and be able to get good averaging from just a few samples within a second or less...but there are exceptions...

A great tool for us to see what you are dealing with, is a graphic trend. If you chart the raw value as it is right now, and post a jpg of it with your next post, a picture is worth lotsa words...

Paul
 
here's a little "getting started" example for an MAVE operation ...

mave.JPG


this is NOT intended to be the "answer" to your question, but only a hands-on demonstration to get you used to what's going on ...

if I were you, I'd put it in a spare processor and play around for a few minutes ...

hope this helps ... again, feel free to call if I can be of more assistance ... good luck with your project ...
 
Not MAVE but you get average value

Carolina here is what I mentioned two days ago, this is done for RSlogix500, but can be converted to RSlogix5000 easily.
At the end you have the average values, your sample time depends on how fast you want it.
 

Similar Topics

I am trying to use the moving average instruction. Getting a little caught up on the details. What is the "Storage Array" and what type of tag...
Replies
2
Views
2,671
I have been averaging a number of values using the MAVE function and have been having good luck with them. The question I have is the time it...
Replies
3
Views
2,284
Hi all, First post in this forum. I am having trouble with a moving average (MAVE) instruction on an RSLogix 5000 controller. I have very...
Replies
3
Views
6,572
I am trying out the MAVE instruction to give me a 24 Hour Rolling Average and a 1 Hour rolling Average for the same Input. I have it in a periodic...
Replies
2
Views
4,524
Back
Top Bottom