Friends, follow attached an excel file to collect large amount of data.
Please feel free to use, improve and comment.
Hi Luciano, it seems that you have used the PISampDat function to retrieve the sampled values in your application.
Could you explain why you have written a Macro when this function is directly available through PI Datalink?
How are you overcoming the limitations listed in: Extracting large event counts from the PI Data Archive ?
Some suggestions to improve the macro
- Crash prevention/ input checking: Providing invalid input for sampling time or not specifying the tag name crashes the application and excel
- "tag not found" is always displayed at the bottom
The idea of using macros is to avoid that, at every update of the worksheet, all the data is collected again, which makes it very difficult to work with the worksheet. I know that it is possible to use the function to calculate excel cells only when I want, or to calculate only a few cells, but it is not a "friendly" function.
With the base of this spreadsheet that I sent, I adapted the macro to perform searches in shorter periods (1 month), and then save the result (data only) with a dynamic name that identifies month and year, and loop it until all data is collected. I was able to query almost 200 tags, every minute, for a period of 5 years!
Thank you for the suggestions!
Retrieving data ...