1 of 1 people found this helpful
This info is not stored in the archives. It is in the pipoint table. You can use piconfig to get that info. Open up a command prompt. Navigate to %piserver%\adm directory. Then enter the commands below.
piconfig @tabl pipoint @ostr tag,pointid @ends
Thank you. This seems to extract what is in the PI database and not in the piarch file. How do i read that with cmd?
2 of 2 people found this helpful
pidiag -archk <path to archive file>
shows you the records and point ids that are available in the archive. An example is shown below:
recno: 1 id: 1 indices: 3 records: 413 events: 81521 fr: 99.3%
recno: 2 id: 2 indices: 0 records: 1 events: 145 fr: 96.3%
recno: 3 id: 3 indices: 3 records: 412 events: 81557 fr: 99.6%
recno: 4 id: 4 indices: 1 records: 111 events: 54434 fr: 98.8%
recno: 5 id: 5 indices: 1 records: 3 events: 427 fr: 97.6%
recno: 6 id: 6 indices: 1 records: 47 events: 9216 fr: 99.1%
recno: 7 id: 7 indices: 1 records: 48 events: 9374 fr: 98.7%
recno: 8 id: 8 indices: 1 records: 46 events: 8886 fr: 97.7%
recno: 9 id: 9 indices: 0 records: 1 events: 205 fr: 78.2%
recno: 10 id: 10 indices: 1 records: 3 events: 610 fr: 81.5%
recno: 11 id: 11 indices: 0 records: 1 events: 1 fr: 0.8%
recno: 12 id: 12 indices: 0 records: 1 events: 1 fr: 0.8%
recno: 13 id: 13 indices: 0 records: 1 events: 1 fr: 0.8%
recno: 14 id: 14 indices: 0 records: 1 events: 1 fr: 0.8%
0 errors detected
0 warnings detected
12 total index records
1089 total data records
246379 total events
226.2 events per record
0 total annotations
This example shows that the archive has events from point ids from 1 to 14.
1 of 1 people found this helpful
What end goal are you trying to accomplish here? As Eugene Lee mentioned, the RecNo and PointID attributes associated with each PI Point can be extracted from the pipoint table either from piconfig, or using PI SMT- > Operation -> Point Builder -> System Tab.
If you are trying to extract actual data from the PI Archives, you should use an appropriate client tool such as PI Vision, PI ProcessBook, PI DataLink. If you are trying to export flat files of data from the PI Archives, then you can use PI Config, PowerShell, or DataLink to do so. In piconfig, you would target the @piarc table. For example, the following would get archive values of sinusoid for the last 2 hours:
piconfig @table piarc @ostr tag,value,timestamp @ostr ... @istr tag,starttime,endtime sinusoid,*-2h,*
Thank you for your answers.
We have received a piarch file from a customer and we have to look into the stored data and analyze it.
As far as we know the piarch file have been extracted in a proper way so it should not be corrupted yet we are unable to combine tags with the stored data.
We load the PI with tags from Excel.
I have now tried many different things without success. I have even got a taglist containing PointID, RecNo and Tag numbers from the customer.
We believe if there is inconsistency between RecNo, PointID and Tag number the Pipoint list and the Piarch file cannot be linked together.
We thought it would be like these four steps but we are stuck at step 3.
1. Register piarch file into PI
2. Load taglist into PI with Excel
3. Check if data are linked with Data > Archive Editor
4. Link archive with FT Historian
Should we approach this in another way?
Yes, you should definitely approach this differently. What you are trying is not supported and I believe it is not even permitted as the PI Data Archive file base is considered OSIsoft's intellectual property.
Valid options could be
- Install a PI System and clone the customers installation by restoring a PI Backup. You can than chose from many different options to access the data e.g. by using a Developer Technology, OSIsoft.PowerShell module, PI DataLink etc. For this approach you will need a PI System license with the size of the customers tag count. Our joined customer may want to talk to their account manager about available options.
- Ask the customer to export the time series data. There are again many different options including the before mentioned ones.
We wasn't aware of that. Do you have any link to a walktrough so we can do this correctly?
Please see PI Server 2017 R2 documentation -> PI Data Archive -> PI Data Archive System Management -> PI Data Archive backups.
The same manual has a piconfig.exe sample titled Generate a text file of archive data for sinusoid for the last day. Here is a direct link.
There are some pitfalls when retrieving data over larger periods of time. Rick Davin has a great blog which I consider a must read because he explains the background and offers an AF SDK sample which well shows how to use paging when working with larger amounts of data: GetLargeRecordedValues - working around ArcMaxCollect
I have myself blogged about How to write PI Data to files in XML format? The samples are intentionally pretty basic and e.g. will not work without adjustments when recorded data is to be extracted for months or even years.
Because the question on how to extract time series data from PI is pretty common you will find other resources in the forums. If you let us know about your preferences, we may also be able to suggest you something more specific.