Mike.Mander

AF Data Reference output to other attributes

Discussion created by Mike.Mander on Dec 23, 2011
Latest reply on Jan 13, 2012 by MvanderVeeken

Hi, 

 

I have created a data reference that looks at an input value and checks it against thresholds. The Output state attribute is the one that the data reference is set on, however I also output a priority setting to another attribute in the element. 

 

My problem is that I cannot seem to get the priority output to have a time associated with it that changes when the calculation is done over a time range. In the code below I tried setting the Priority as a AFValue, then I use the attribute.SetValue function and pass it the AFValue with the associated timestamp. This works in AF System Explorer and sets the attributes value's time to be the same as the Output State. If I change the query time in System Explorer then the output time also changes so it seems to be working. However when I plot the Output State and Priority attributes in ProcessBook, the output state changes depending on the value at the time but the Priority holds the value for the entire period at the latest calculated value. 

 

 

 

 

 
If Not attriPriority Is Nothing Then
       Priority = New AFValue
       Priority.Value = lngPriority
       Priority.Timestamp = dtOutTime

       attriPriority.SetValue(Priority)
End If

Return New AFValue(intOutValue, dtOutTime, Attribute.DefaultUOM)

 Thanks

 

Mike

 

 

 

 

 

 

 

 

Outcomes