Can someone help me with the codes to count days since a parameter has a specific value and generate an event frame if it stayed at that value for say 2 days?
What is the mean of "doesn't have the timestamp history."? Is it archiving = off?
If it is manual entry tag, I believe you can use scheduling option instead of Event trigger in the analysis configuration. (If you have not tried it)
So anlaysis can run for example every 1 minute and you can generate event frames after 2 days.
Do you mean that the tag is manual entry, so after creating event frame, still there is a possibility that the event will be written and it will not match the condition?
If it is the case, it is good to compare the past archived events. For example TimeEq('TAG', '*-3d', '*-1d', VALUE) =172800.
If the manual entry is done within the 1 day, it should work. (it takes 3 days to generate event frame though)
Anyway, if you need more appropriate answers, please let us know more details.
Here's one way to do that. Suppose you had a tag X that you wanted to trigger an event frame if it was at a certain value "VALUE" for 2 days.
You would first create an attribute in an AF element that referenced that PI tag. Let's be unimaginative and call that attribute 'TAG'.
In the same AF element, create an event frame generation analysis and for the start trigger, use TimeEq('TAG', '*-2d', '*', VALUE) = 172800.
The TimeEq() function returns the number of seconds that the tag equals the supplied value.
Thanks for the input Steve! Problem is, the I am trying to generate an event frame based on the value of an attribute that's been input by a user. So it's not a proper tag and doesn't have the timestamp history. Any workaround for that?
So it's an attribute without a tag reference? As you say, it doesn't have the timestamp history. Why aren't you using a tag reference?
Retrieving data ...