I am trying the following expression to avoid the bad input of machine data in historian

**if PrevVal('Sensum_MC_1_BatchStatus',PrevEvent('Sensum_MC_1_BatchStatus', '*')) and 'Sensum_MC_1_BatchStatus' = BadVal('Sensum_MC_1_BatchStatus') then "NoOutPut" else "Resume"**

but it shows an error "**Error -2147219650: PI PE syntax error in Expression. [-12315] Performance Equation: Function has bad argument data type".**

please guide me how to correct these expression ?

i also attach screenshot for the same

Thanks in Advance

Hi kaushik,

I think you need to tweak your equation to like following:

if BadVal('sinusoid')=0 and PrevVal('sinusoid', PrevEvent('sinusoid','*'))then "GoodValue" else "BadValue"

Thanks,

Paurav Joshi