admin管理员组

文章数量:1124758

In the GE Historian, I am trying to code a calculation tag to result in the following:
Using a tag that reports 1/0, I want the calculation to result in the timestamp of when the tag transitions from 1 to 0. To note - there will be multiple times where it switches from 1 to 0.

Here is what i've tried:

IF CurrentValue("RAW MILL ON SIGNAL - CALC") = 0 AND PreviousValue("RAW MILL ON SIGNAL - CALC","Now - 1Second") = 1 THEN
RESULT = CurrentTime()
QUALITY = 100
END IF

Am I on the right track or is there a different way to do this?

本文标签: sqlGE Historian Calculation tagStack Overflow