lostcontrol
Lifetime Supporting Member
Hi,
Have an application where we need to detect if a certain event happens more than a no of times within a time window.
What I have so far, is if the event happens, then increment a counter & start a timer.
If the counter reaches its preset before the timer completes, then the condition is captured & indicated.
If the timer times out, then reset the counter.
The issue with this method, is that if 2x events happen within the time window, then the timer should not reset, but rather start again from each occurence of the event happening. This is simply a case of resetting the event detection timer so that it starts again from its preset.
All good so far..?
Where I am geting slightly caught up, is what should I do with the counter if a 2nd event happens, but the preset time has elapsed since the first event..?
Should I then add 1 to the counter & reset the time between events timer?
Basically, we need to create a shifting window that looks for so many events within that time.
I could look at time stamps, but then that would require a lot more memory storage for the no of events required to be detected..
Current PLC is Omron, but is basic logic I think..
Cheers
Have an application where we need to detect if a certain event happens more than a no of times within a time window.
What I have so far, is if the event happens, then increment a counter & start a timer.
If the counter reaches its preset before the timer completes, then the condition is captured & indicated.
If the timer times out, then reset the counter.
The issue with this method, is that if 2x events happen within the time window, then the timer should not reset, but rather start again from each occurence of the event happening. This is simply a case of resetting the event detection timer so that it starts again from its preset.
All good so far..?
Where I am geting slightly caught up, is what should I do with the counter if a 2nd event happens, but the preset time has elapsed since the first event..?
Should I then add 1 to the counter & reset the time between events timer?
Basically, we need to create a shifting window that looks for so many events within that time.
I could look at time stamps, but then that would require a lot more memory storage for the no of events required to be detected..
Current PLC is Omron, but is basic logic I think..
Cheers