AnsweredAssumed Answered

How to merge multiple datastreams into one?

Question asked by Roger Palmen on Apr 6, 2018
Latest reply on Apr 9, 2018 by TimCarmichael

I have a great puzzle for the weekend for you!

 

I have two (or more) PI Points, each delivering events. I need one datastream combining the events of both these. E.g. (timestamp, PointName, value):

  • 6-4-2018 10:00, Point1, 32.6
  • 6-4-2018 11:00, Point2, 93.1
  • 6-4-2018 12:00, Point1, 27.2

 

Should be merged into:

  • 6-4-2018 10:00, Output, 32.6
  • 6-4-2018 11:00, Output, 93.1
  • 6-4-2018 12:00, Output, 27.2

 

I can't really change the datasource, so i was looking for a solution in AF Analytics. Best thing i came up with is cascading HasValueChanged (event triggered):

Input1: If HasValueChanged(Point1) then Point1 else NoOutput()

Input2: If HasValueChanged(input2) then Point2 else input1

Input3: If HasValueChanged(input3) then Point3 else input2

 

But i am not a great fan of HasValueChanged, and not sure how Analytics treats multiple triggers at the same timestamp, and probable some other concerns too.

 

Any better ideas?

Outcomes