kcox1980

Is there an instruction for this?

6 posts in this topic

So I've been asked to trigger an alarm condition when we see a sudden deviation in some data. The numbers themselves don't really matter and are constantly changing. Management has asked me to take a running average of the data over a small period of time and compare it to either the most recent single data point or a smaller running average.

I know I can do this by moving the data into a bunch of DINT tags and doing the math, but is there an instruction specifically designed for something like this? Seems like it would be a common thing so I'm hopeful.

*Edit* Woops, forgot to mention this is an RSLogix5000 project.

Edited by kcox1980

Share this post


Link to post
Share on other sites

Start by tell us the platform or programming software you are using.

 

A quick look at the instruction help for RSLogix5000 shows an ALM function block that does what your are asking for.  Or look at Ladder Element ALMA.

Edited by pcmccartney1

Share this post


Link to post
Share on other sites
28 minutes ago, pcmccartney1 said:

A quick look at the instruction help for RSLogix5000 shows an ALM function block that does what your are asking for.

Looking at the description of the ALM instruction I don't know if this will work, though it might. It looks like the Rate of Change for an ALM instruction seems like it is based on a time reference. The example they gave uses a ROC of 2 degrees/second to trigger the alarm. I'm measuring the width of our material on the fly, and the alarm should trigger if we see if we see a sudden change of more than 1/2" off the running average.

I was looking at the MAVE instruction too, would it work here?

Edited by kcox1980

Share this post


Link to post
Share on other sites

I built a rate of change AOI that is pretty simple to use and would give you a rate of change PV to use in an alarm. I built the MAVE routine into the rate of change AOI to help smooth the output. We use it to measure the rate of change of oil flow in and out of a tank (80,000 - 250,000 barrel) which uses a comparatively long 20s sample time and for gas pipeline pressure rate of change to predict a leak, which uses a sample time of a second or two. Sample time is set by how you call the block. Delta T is calculated (in ms) by the AOI. 

I can add it to the post later (traveling today) if your interested in it. It’s not password protected so you can customize it if you want to

Share this post


Link to post
Share on other sites
46 minutes ago, Michael Lloyd said:

I built a rate of change AOI that is pretty simple to use and would give you a rate of change PV to use in an alarm. I built the MAVE routine into the rate of change AOI to help smooth the output. We use it to measure the rate of change of oil flow in and out of a tank (80,000 - 250,000 barrel) which uses a comparatively long 20s sample time and for gas pipeline pressure rate of change to predict a leak, which uses a sample time of a second or two. Sample time is set by how you call the block. Delta T is calculated (in ms) by the AOI. 

I can add it to the post later (traveling today) if your interested in it. It’s not password protected so you can customize it if you want to

Sure, I'll give it a look.

Share this post


Link to post
Share on other sites

You can't run the AOI in a continuous task and have any control over the sample time. Put it in a periodic task. The AOI reads the elapsed time from the periodic task and uses that to calculate delta T. Other than that it's just a simple AOI. If it won't open (for viewing or editing) let me me know and I'll post an unprotected version. This one should not be protected.

 

 

Rc.L5X

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now