0

I am trying to create a simple GE Historian calculation that calculates the time between two values of a tag. For example, I have a temperature tag called "TAG1" that I want to calculate the time it took to go from 100 degrees to 200 degrees in seconds.

In the past I have calculated the time since the last recorded value using:

Result = DateDiff("s",PreviousGoodTime("TAG1","Now-Second"),CurrentTime())

I believe what is giving me a hard time is I do not know how I can return the timestamp of when a certain tag was a certain value last. Has anybody made a Calculation tag like this before?

Note: GE Historian calculations use VB Script, and PreviousGoodTime is a Built-In function that uses a tagname and a time to start calculation (in this case, "Now-Second" is one second prior to the trigger of the calc)

Update: Accomplished the end result using two intermediary Boolean calculation tags. One that is True when the temperature is higher than 100 degrees (TAG2) and another that is True when higher than 200 degrees (TAG3). The final calculation tag (TAG1 from original post) is triggered when TAG3 steps from False to True and calculates the time since the last good value of TAG2.

Still curious if this can be accomplished in one single Historian Calculation tag.

4

0 回答 0