AnsweredAssumed Answered

Get value of StringBuilder attribute only at start of event frame

Question asked by tinklerj on Jan 25, 2019
Latest reply on Jan 28, 2019 by rdavin

I have an event frame template with a Status attribute (String Builder data reference) that takes its value from an attribute in the parent element called PI Comms

Status Settings = .\Elements[.]|PI Comms;

Status Value Type = String

This element template attribute is a Formula and is defined in terms of another attribute called Heartbeat_Trigger (PI Point) in the same element template:

PI Comms Settings = A=Heartbeat_Trigger;[if A > 298 then 1 else 0]

PI Comms Value Type = Healthy/Failed

A value of 1 for this attribute triggers an event frame and the Status is set to Failed.

What I am finding is that when I retrieve the event frame attributes after the frame has closed, the Status attribute is showing Healthy (corresponding to the PI Comms zero value that ends the frame).

I only ever want this attribute to show the value (Failed) that triggered the event frame, i.e. the value at the start of the frame.

If the PI Comms attribute were a PI Point data reference this would be easy; simply add TimeRangeMethod=StartTime to the settings for the Status attribute.  But it isn't.

I can't make Status into a PI Point data reference because the attribute it references is not itself a PI Point data reference, so this produces an error when Status is viewed.

I can't use the TimeRangeMethod qualifier for Status because it's a String Builder not a PI Point; all that does is append the string "TimeRangeMethod=StartTime;" to the value Healthy.

 

Any thoughts?

Jeremy

Outcomes