Is it possible to use PI Notifications to report by email on the past 24 hour's worth of events for a particular PI tag?
I understand how to
I'm only aware of how to report the current value of a PI tag in a notification
I'm not sure of a way to put that information inside the email directly, but if you have Coresight you could link to an AdHoc display that could show the information in a trend. The syntax would be similar to:
The Coresight admin guide for your version should have more information on the specific syntax to use.
If what you mean by "24 hours worth of events" as the data (i.e. not annotations, questionable points, etc.), then yes. In AF, you can create Analyses in AF to calculate min, max, avg, etc. for a point within a time period. You could create averages for each hour over the past 24 hours, too. Then, map these results to an AF "output attribute." Then, you can add this mapped attribute value into your email template.
You also have the option of using an AdHoc Trend with a PI WebParts server to display historical information:
Similar to Tom's idea, you could also create an AF attribute for each historical value and use AF Analyses to fill in these attributes . Granted, this would only be feasible if the tag updates infrequently (perhaps a new value comes in once every few hours).
To answer your original question: I don't believe it is possible to directly reference historical PI tag values when configuring a notification.
Unfortunately we are not licensed for either CoreSight or WebParts. We are only licensed/have access to PI DataLink (although Excel is not installed on the PI Server), PI Notifications, PI ProcessBook, PSA
I was essentially looking for a way to schedule a dump of the past 24 hours worth of data for a particular PI tag at 7am - and now I'm learning it should be "dumped" to a text file in a particular file share.
There are many ways to do this. You can write a PIConfig command line script to dump the archived data to a text file and place this on a share. You can write a script/executable (including PowerShell) that use PI SDK or AF SDK code to obtain all the recorded values and schedule it to run once a day. Other people might use ACE to do this and let the ACE Scheduler take care of all the scheduling and write a few simple lines of VB.NET. Other people might use PI OLEDB and use a SQL Server job to complete this. Some might use their VBA skills and will schedule Excel to update a PI DatalLink sheet once a day and automatically save to a network drive.
I've seen people use Notifications using either a custom delivery channel or a custom Web Services to move data as well. There are many ways to dump data at a specific time! Let us know what works best for you given your knowledge of software and OSIsoft products.
Dan has provided many viable solutions.
Let us know if you have questions about which one might be most appropriate for your use case, or if you have any questions about implementing it!
If your email recipients don't have access to a share-drive file and if you don't have too many values for a tag over 24 hours, you can use AF Analysis to (painstakingly) get each point. Start with these analysis equations:
Variable1 = PrevEvent('Sinusoid','*')
Variable2 = PrevEvent('Sinusoid',Variable1)
Variable3 = PrevEvent('Sinusoid',Variable2)
Variable4 = TagVal('Sinusoid',Variable1)
Variable5 = TagVal('Sinusoid',Variable2)
Variable6 = TagVal('Sinusoid',Variable3)
The easiest way to do this may be to set up a scheduled task in Windows to run every day at 7am. The scheduled task can then run a piconfig script to output the tag values to a text file on a file share. Take a look at steps 1-4 under Solution III in KB article 3065OSI8 here: http://techsupport.osisoft.com/Troubleshooting/KB/3065OSI8
The KB article discusses how to delete data, but part of solution III shows how to output data. In the FINDEVENTS.TXT file, replace the line "@output output.txt" with "@output \\server\share\file.txt" where \\server\share\file.txt is the full path to where you want your file saved. You can then make a simple batch file to call "piconfig < findevents.txt", and then call that batch file in the scheduled task.
where do you run your PI AF SQL-Database? is it a standard edition or higher? so you could also use MS SQL Reporting services. you could even create Abonnements to email the reports e.g. in pdf. maybe the solution is a little bit over-sized, but it's a comfortable way to Report informations and open for future requirements.
PI AF SQL database is standard. That is an option we could explore if needed. I was able to use piconfig and a batch script to accomplish this task - thank you all.
Retrieving data ...