Rate of Change Alarm

I am looking to generate a Rate of Change alarm on some floating values. I am in the process of converting a Wonderware site to Ignition. In WW, there is a simple checkbox with the % per Sec/Min/Hour that generates the alarm. Any suggestions for an easy way to generate/re-create this alarm?
Thanks!

There are a few ways that I can think to do this, but none of them are all that simple.
You could:
create a UDT
-with a trigger expression tag, evaluating on the Sec/Min/Hour,
-and a memory tag, that stores the value of the source tag.
On a tag value change script in the expression tag, you could write to the memory tag, which would have another tag value change script where you could then compare the previousValue vs the currentValue and determine if the threshold had been surpassed and alarm if it did.

EDIT: Another UDT structure you could use that might be a little easier.

RateOfChangeUDT.json (1.2 KB)

3 Likes

Hi @KMuldoon im also trying to implement a rate of change alarm for a temp, idea is to analyze the ROC as well as high and highhigh alarms, because in some instances the ROC implications far exceed the high temp average, your comment is the closest ive seen to what appears to be a working structure but i was hoping you could assist me more by breaking down your script so i can better understand it?
particularly the tags that need to be replaced and how to implement it to alarm at a particular ROC.

thanks ! much appreciated

Honestly, I never implemented it. It wasn’t of concern to the customer. Sorry.

Sure! I’d be happy to go over any part of the script. Feel free to PM me and we can talk about it.

This works really well, thank you!

@ wbaker did I you use the script in the chart I am looking to possibly do a rate of change alarm and seen that you said it work’s really well and was interested in knows what you done to make it work.

Thanks

could this be what you are searching for ?

Thats exactly what I was looking for thanks

Can you share how you set the UDT up?

With a little bit more explanation on what you try to achieve with this UDT, we will be able to help you.

I have it working now. But let me ask if the rate is 1000ms, then it calculates the RoC for every second, correct?

Yes

l would double-check that. There will be some jitter in the OPC which will affect the accuracy of your calculation so you might want to use the actual timestamps and then do rate = (v1 - v0) / (t1 - t0).

Thank you for the clarification.

I guess the same could be said if the rate was for 30 secs. It would help me determine the RoC % based off of 30 secs, right?

Good feedback, i didn't see like that.
So instead of the system time just take the previous opc read timestamp and the actual opc read timestamp for calculation?