AnsweredAssumed Answered

Basic expression logic

Question asked by owen1r on Mar 2, 2019
Latest reply on Mar 12, 2019 by TimCarmichael

Hi all,

 

I'm quite new to PI and the language required to write expressions effectively. I've got a tag which is prone to large changes (errors) in it's value when the sensor is reset. It would probably help to add that this value is cumulative. Basically, I'm wanting to fix another error in the data and I can't get it to work, hoping to get some feedback here.

 

The top expression is the original, I'm wanting to add in a correction for data after 1-Nov-18 at that specific time (shown in red), down to the second.

 

if '*' > ('6-Jun-18' + 15*60*60 + 5*60 + 51) And '*' < ('11-Jun-18' + 8*60*60 + 39*60 +52) then 'WE1E01_D_NONRST' + 2153228754 Else if '*' > ('11-Jun-18' + 8*60*60 + 39*60 +51) then 'WE1E01_D_NONRST' + 3721925 Else 'WE1E01_D_NONRST'

 

if '*' > ('6-Jun-18' + 15*60*60 + 5*60 + 51) And '*' < ('11-Jun-18' + 8*60*60 + 39*60 +52) then 'WE1E01_D_NONRST' + 2153228754 Else if '*' >( '11-Jun-18' + 8*60*60 + 39*60 +51) then 'WE1E01_D_NONRST' + 3721925 Else if '*'>('1-Nov-18' + 4*60*60 + 51*60 + 7) then 'WE1E01_D_NONRST' + 56214410 Else 'WE1E01_D_NONRST'

 

I will be continuing to do this changes as more sensor errors appear, so if I could be shown how to make future changes too that would be fantastic.

 

Thanks in advance.

Outcomes