While observing analyses, we came across not so usual behaviour from analyses.
We have one attribute (DR: PI Point) which is triggering every midnight through analyses, and this attribute is trigger input for 10 other attributes(DR: PI Point) through 10 different analyses. Here our expectation is each of these 10 analyses should be triggered at midnight, but surprisingly 7 analyses updated and 3 were not.
The analyses conditions are as follows:
Midnight Trigger: (runs every minute)
if (Hour('*')=0 and Minute('*')=0 and Second('*')=0) then 1 else 0
Output timestamp is selected as Trigger timestamp from Advance tab.
Trigger for other 10 analyses:
IF('Midnight Trigger'=0 or ('Midnight Trigger'=1 And Second('*')<>0) ) Then -- do something Else -- do something
the second or condition is put because we want to track data that come other than midnight.
For 3 analyses that are not working properly, 'Midnight Trigger' remains 0 till 12:00:06 AM and on 07th second it became 1. Now as per above logic this will go into IF loop.In PI ACE, we can get triggering time of input via EXETime , but I am curious how can I get the triggering time in analyses. Because this case can be resolved only if I can store somewhere triggering time or I can fetch it via some function.
- There are 15 other analyses, which have same logic as above and are triggered from another Midnight Trigger, in other database. The surprising moment here is though all 15 analyses triggered at midnight, there timestamp of updated value when fetched from archive is 12:01:00 AM. I want to understand why there is 01 minute delay in timestamp of data although they started and completed on midnight only.