AnsweredAssumed Answered

Derive, collect 3Lab Tag values to 1 tag

Question asked by AHSchipper on Oct 15, 2020

Hi, I'm looking for a solution where I can collect/derive 3 Lab Tags into one collection Tag which collects all stepped values from TagA, TagB and TagC.

Every time a new Lab value is received in one of these 3 Tags, automatically this same value should be received/transferred into this collection Tag including the original timestamp.

 

I've tried to implement this in PI-AF but I see sometimes timestamps does not match the value from the source Tag.
(See attached Excel screenshot)

Only a few does match the original value and/or timestamp.

Tried different setups but fails every time.

 

if PrevEvent('TagA', '*')>PrevEvent('TagB', '*') Then if PrevEvent('TagA', '*')>PrevEvent('TagC', '*') then 'TagA'
Else if PrevEvent('TagB', '*')>PrevEvent('TagA', '*') Then if PrevEvent('TagB', '*')>PrevEvent('TagC', '*') then 'TagB'
Else if PrevEvent('TagC', '*')>PrevEvent('TagA', '*') Then if PrevEvent('TagC', '*')>PrevEvent('TagB', '*') then 'TagC'
Else 'TagC'
Else 'TagC'
Else 'TagC'
Else 'TagC'

 

 

Please help me on this, thanks.

 

I also like to check:
When TagA and TagB receives at the same time a new value/timestamp then only the value of TagA should be stored into the collection Tag.
When TagA and TagC receives at the same time a new value/timestamp then only the value of TagC should be stored into the collection Tag.
When TagB and TagC receives at the same time a new value/timestamp then only the value of TagC should be stored into the collection Tag.

Attachments

Outcomes