How can we detect that a PI tag has the value "I/O timeout" (or another system digital state) and then be notified via a mail?
(PI version 2018 SP3)
Johan Van Acker you can use PI Notifications and configure a notification to be triggered using the BadVal function.
But we want to check all of the PI tags, lets say every hour.
I also found https://customers.osisoft.com/s/knowledgearticle?knowledgeArticleUrl=KB00384 .
Hi Johan! If you want to scan all PI tags - or many PI tags - then you may want to script it in PowerShell.
Loop over the PI tag list and accumulate an email message, then send it.
This post has code to loop over PI tags and examine the values. You'll want to use the .IsGood attribute of what's returned from Get-PIValue to see if it is I/O Timeout or another bad value.
Then you can use Send-MailMessage to email... or write a flag back to a PI tag that will trigger a PI notification.
Hi Johan Van Acker
I went ahead and wrote a PowerShell script that does identify pi tags that have a current value of "I/O Timeout". Please note that under the hood the value to search for is actually "System: 246(Set:0)". When PI client tools 'see' that value they display "I/O Timeout". I generally doubt you want a notification every hour in case any pi tags have that value, unless you only have a few thousand tags, because if you have hundreds of thousands of tags or more your PI server is likely to have at least some with that value at any given time.
The attached script can be modified to output the results to csv files or something else. It can also be modified to write a value to a pi tag that in turn triggers an event frame that sends a PI Notification with the resulting csv file attached.
Retrieving data ...