Hi everyone,
PLC: Micrologix 1400
I have a application that is looking at 2 different flow meters and comparing there totalizer for leak detection. I get the data from both meters via Modbus.
What I do is take in both reading compare them, compute a % difference and average the difference. I also keep track of the highest % difference.
Most of the time there is very little if any differences between the 2 totalizers. less than 1% most of the time But every now and then I get a difference that is way off the chart, like 135%. I never catch it happening but I see it in the highest % register. When I finally get to look at it live the difference is back to normal.
I believe it is caused by one meter not responding to a Modbus poll in time or at all. It doesn't happen a lot but just enough to make things a problem. I need to set an alarm bit if the % difference is above 5%.
So I am looking for some ideas on how I might "filter" out those times when the data is bad and only alarm when it is consistently off.
What I am thinking is that every time the difference is above 5% I would throw away that value and add 1 to a counter. When the counter reaches a number say 5 I would then let the value stand and set the alarm bit. If I get a difference less than 5% I would reset the counter.
I would like to solicit other ideas here. You guys are always good at coming up with that ah ha idea. The product is water so there is no big environmental issue in waiting a few minutes before sounding the alarm.
Thanks for the help.
PLC: Micrologix 1400
I have a application that is looking at 2 different flow meters and comparing there totalizer for leak detection. I get the data from both meters via Modbus.
What I do is take in both reading compare them, compute a % difference and average the difference. I also keep track of the highest % difference.
Most of the time there is very little if any differences between the 2 totalizers. less than 1% most of the time But every now and then I get a difference that is way off the chart, like 135%. I never catch it happening but I see it in the highest % register. When I finally get to look at it live the difference is back to normal.
I believe it is caused by one meter not responding to a Modbus poll in time or at all. It doesn't happen a lot but just enough to make things a problem. I need to set an alarm bit if the % difference is above 5%.
So I am looking for some ideas on how I might "filter" out those times when the data is bad and only alarm when it is consistently off.
What I am thinking is that every time the difference is above 5% I would throw away that value and add 1 to a counter. When the counter reaches a number say 5 I would then let the value stand and set the alarm bit. If I get a difference less than 5% I would reset the counter.
I would like to solicit other ideas here. You guys are always good at coming up with that ah ha idea. The product is water so there is no big environmental issue in waiting a few minutes before sounding the alarm.
Thanks for the help.