How do I define a tag as a counter tag. The tag shall count the falling or rising edges of a process point (e. g. valve).
Thanks for your help!
@Kai: You can make use of totalizer points to count transitions from a process point. You can configure PI Totalizer points with the Totalizers plug-in from the PI System Management tools (PI SMT).
I invite you to read the PI Server Applications User Guide that you can find in the Library. This guide describes how the PI Totalizer Subsystem is working and all you should know about it.
You can also take a look at this thread and this thread.
I have added a example of PI Totalizer point that would count the number of transitions: close to open and open to close every 24 hours, resetting at midnight. The results are published in the tag named CounterTag and using the tag ProcessTag as a source of data. The count is filtered by the expresion defined in the EventExpr field to avoid counting when contiguous values are written into the source point.
Tag = CounterTag
archiving = 1
CalcMode = ALLEVENTS
descriptor = This tag counts the number of opening and closing of a valve
EventExpr = (prevevent('ProcessTag', '*') = "Close"
AND tagval('ProcessTag', '*') = "Open")
(prevevent('ProcessTag', '*') = "Open"
AND tagval('ProcessTag', '*') <> "Close")
Function = EVENTS
MovingCount = 1
Offset = +0H
Offset2 = +0M
PctGood = 85
Period = +24H
Period2 = +2M
pointsource = T
pointtype = int32
ptclassname = Totalizer
RateSampleMode = EVENT
ReportMode = RAMPING
sourcetag = ProcessTag
TotalCloseMode = CLOCK
zerobias = 0
Let me know if that helped you.
@Mathieu: Great, thank you very much! Can I recalculate these Totalizer from a point in the past to get a history?
Greatings from Germany
@Kai: PI Totalizer Subsystem utilizes snapshot values only to summarize calculations. It cannot opt in for recalculation. One alternative to recalculate would be to use PI Datalink add-in and Microsoft Excel. You can perform a similar count expression when you get your transition values per 24 hour period and then you push back the results into your CounterTag via PI SDK or AF SDK (if you have the AF SDK CTP version installed).
Retrieving data ...