I'd like to generate following event frame, start event when data stop coming for tag and end event when data start coming, I need to capture time frame for data gap.
Please advice what would be equation in analisis template?
First of all, what is a minimum time frame you would consider a data gap? I imagine at least the period of your scan class, right? I mean, if you are collecting data for a tag each 10s, you wouldn't want several data gap events of 9s.
I guess you could compare PrevEvent('*') with '*' to trigger the event frame if the difference is larger than your desired minimum time frame.
Something like this for start trigger:
'*' - PrevEvent('Attribute','*') > 10s (for the example above. This minimum time could be in another attribute)
When the same condition is false, the event is closed.
Would that be somewhat you are looking for?
thanks for reply!
In my case tag is measured every 30 min so for example I have value for : 12:34:30 then no data for 01:04:30,no data for 01:34:30 and it starts coming at 02:04:30,
in this case event frame would be 01:04:30 - 02:04:30. Does equation in your email handle this case, how can I make sure it takes 01:04:30 as start time for frame?
In this case, instead of 10s, you would use 1800 (30 min).
'*' - PrevEvent('Attribute','*') >= 1800
'*' gives you the timestamp for now.
PrevEvent('Attribute','*') gives you the timestamp of the previous value of the 'Attribute' before '*'.
The subtraction of those timestamps gives you the number of seconds.
You could then configure the analysis to run every 30 minutes with an offset of 04m and 30s.
Give it a try and if you need additional help, let me know.
can I use equation below for my case or it's something different, is it the same as equation you provided?
That one should give you the same result indeed!
The only benefit of the other expression would be if you wanted to parameterize the minimum time.
'*' - PrevEvent('Attribute','*') >= 'Minimum Time Attribute'
And I think you might need the "<=" sign.
what do you mean "parameterize the minimum time"?
I'm not sure about <= (for your equation), since I need current time subtruct last time and start event if time difference is more than 30 min so should be >= I think.
<= for your equation
>= for mine
The minimum time value would be in another attribute of your element!
You can create this analysis in a template, for instance, which will be used for a lot of elements.
In each case you might have different values of "minimum time" for your data gaps and you would only need to fill in these values for the correspondent attribute of each element.
Even if you are just going to use the analysis for a single element, but you feel like you might be changing this value every other time, it would be easier to just set the attribute as needed.
Have I made it clear?
thanks, make sense!
Also in your equation it doesn't create event with >=1800, I think it's because of current time minus last time generates format '00:00:00' which seems can't understand 1800 sec
so I put '+30m', I think '+30m' is the same as 1800 seconds, isn't?
You are correct Saken!
I guess Performance Equation's and Analysis' behaviors are not exactly the same anymore...
You can use the Int() function to convert DateTime values to seconds. Int('*' - '*-30m') will be evaluated as 1800.
Retrieving data ...