-
Re: Is date / time of when Pi Archive started?
Dan FishmanJul 1, 2015 1:45 PM (in response to mdspath)
2 of 2 people found this helpfulThere is no PI AF SDK or PI SDK call to obtain an archive start and end date. I believe our powershell tools can obtain the archive start and end dates.
-
Re: Is date / time of when Pi Archive started?
dngJul 1, 2015 1:56 PM (in response to mdspath)
2 of 2 people found this helpfulHi Mike,
As Dan said, there are no SDK calls to obtain the start date of the archive. The main focus of the SDKs is "data access" instead of "system management". For more information, I encourage you to check out this previous discussion here: PI Archive Start Time.
There are several ways you can accomplish what you are looking for:
- Use AFTime.MinValue as the start time (1/1/1970). Note that there is a known issue and you'll have use a start time slightly after AFTime.MinValue for your query.
- Use the timedate in your external database.
- Use powershell or command line utilities to query for the start time.
- Use the SDK to query for the tag creation date. Note that this will not work if you have backfilled data prior to the creation date.
- Use the SDK to query for the timestamp of the first archived value for the tag. This requires more work but will work with backfilled data prior to the creation date.
-
Re: Is date / time of when Pi Archive started?
Rhys KirkJul 1, 2015 1:58 PM (in response to mdspath)
1 of 1 people found this helpfulMaybe you do a crafty PE to get the first event for a given PI Point? A PI Point may not even exist in historical archives so finding it's first value is probably more useful to you. Otherwise stick to 1970 as the first possible date?
NextEvent('Tag','01-01-1970 00:00:00')
Or something along those lines.
-
Re: Is date / time of when Pi Archive started?
mdspath Jul 1, 2015 2:21 PM (in response to mdspath)1 of 1 people found this helpfulThanks all for your quick responses, I think I'll go with the timestamp we will put into our external dB