Lorenzo.Brescia

CHANGE OF STATE TIME STAMP ANALYSIS

Discussion created by Lorenzo.Brescia on Nov 6, 2019
Latest reply on Nov 7, 2019 by Lorenzo.Brescia

Good afternoon peers,

 

I am trying to calculate a time stamp through an analysis that takes a digital state tag and tries to evaluate the Timestamp at which the state changed from one value to another (in my case from 0 = normal status to 1 = alarm)

 

By now I managed to write down an analysis but the problem is that I am not sure whether I am using the right functions in the right order. Moreover, the output attribute does not update by itself. Do you guys have suggestions?

 

 

I copy the code of the analysis

 

if (TagVal('detector',prevEvent('detector','*')) <> TagVal('detector','*') and TagVal('detector','*') = 1) then TimeStamp(TagVal('detector','*')) else NoOutput()

 

I also tried to use PrevVal instead of TagVal and PreEvent together but PI AF considered PrevVal to be equal to TagVal.

 

What am I supposed to add?

Outcomes