Hi straighteight,
Welcome to the forum.
So in direct response to your answer, you would need a PE similar to:
Code:
if tagval('sinusoid','t') > 'sinusoid' then ((tagmax('sinusoid','t','*') - tagval('sinusoid','t')) + 'sinusoid') else ('sinusoid' - tagval('sinusoid','t'))
You could use the tagmax PE function to find the maximum value for a time period.
There may be issues if you find the instrument is reset multiple times per day, you won't total the spikes during the day correctly using the above.
Have a look at the TagTot PE function - see manual at "..\PIPC\help\PEReference.chm". Maybe the Totaliser sub system is an option for you too.
Cheers.
Principal Consultant
Real-Time Data Management @ Wipro Technologies