Keep in mind that certain words have certain meanings in different contexts. I am a developer and when I see the term "timer", I tend to think of Windows Forms Timers or System Timers in .NET. Is this what you were thinking of? I'm guessing the first time EffluentFlow dips below a given amount that you want to start one of those timers. Allow me to give the obligatory mention that Windows Timers have nothing to do with PI SDK or AF SDK but the community can still try to help you out.
Nonetheless to help towards that end, it would help to know your application environment. It looks like VBA, though could be VB.NET. Is it in PI-ACE, ProcessBook, Excel, VB 6.0, or other? Guessing it's PI SDK and not AF SDK but then again you really don't reference either of them in the snippet.
Thanks for the reply, I am using PI process book 18.104.22.1684 and the code is done in VBA. Your guess is correct when the effluent flow drops below 500 in the current code I would like a timer to start and if the timer expires then generate the alert. If the effluent flow recovers and the timer has not expired then it dips again I would like the timer re-started.
Basically I am trying to generate an alert if the flow has been below X for Y time.
Keep in mind that VBA (or really the Win32 API) does not have a very high resolution timer. In addition to the link that John passed on, there are plenty of external resources. Here's just 2 of them:
2 of 2 people found this helpful
It does sound like you are using processbook as an alerting engine Mitchell. Have you thought of doing this in an analysis? Then you can write to an attribute and display said attribute in processbook (or coresight /vision or anything else). That way you'll still get your info when processbook is not running (and it's the same for all applications / clients). Just a thought.