How do I return a list of pipoints on a server and check each of them for eng units, description, etc. in excel VBA?
Any reasons you are not using PI Datalink 2016 with the Properties function instead?
Thanks for the response. I do not know any tags (pipoints) on the server. However, I want to check them for units, % good over 1d, 7d, 30d, 365d, etc. Basically need to return all the pipoints and have them available to do any queries or calculations that I desire.
Do you mean you don't know the names of any of the tags? Or you don't have permissions to any of the tags? If you don't have permissions to the tags then either VBA or DataLink will not work without security changes to the PI Data Archive. I agree with Eugene that using DataLink, you could search for all tags on the PI Data Archive by filtering with Tag=*, which will return all tags in a column.
You can then use the Properties function to pull information such as Description, EngUnits, etc.
You can then also use Calculated Data or other DataLink functions to query for whatever tag data you are interested in. I must comment, however, that you mention querying 365 days worth of data for potentially all pipoints. There are other options, for example, if the %Good calculations are something that you would want to run continuously, such as creating PI AF Analyses to move these large queries/calculations to server side. That way rather than using DataLink to query all the data values and do the %good calculation, you could just query the value of the PI Tag.
Hope this helps,
Thanks very much for the replies everyone! I have PI datalink only in excel VBA. I do not want to return all tags/values to a spreadsheet. I simply want to use VBA to take each tag on the PI server (tag name, number of tags is unknown to me) and check its % good for various time periods (my choice of time periods). I am not returning 365 days of data for all the tags at once. I want to perform the % good (maybe check for missing eng units also, etc.) and return the results of the tag analysis to the spreadsheet. Does this make sense? I have PI VBA programming experience but am stuck on this one! Appreciate any help from anyone!
You could also use PI Builder to do what you want to do.
Retrieving data ...