-
Re: Run Analysis using AFSDK
lmurphyMar 12, 2018 10:59 PM (in response to nthorson)
2 of 2 people found this helpfulHi Nick,
I would recommend upgrading to Analysis Service 2017 R2. In this version, you can enable automatic recalculation for analyses.
As a test, I set up the following PowerShell script to trigger a backfill of a day's data for 2 separate tags: inputtag1 and inputtag2:
$con = Connect-PIDataArchive -PIDataArchiveMachineName lmurphy7910
$value = 0 for($ii=0;$ii -lt 96;$ii++) { Add-PIValue -PointName inputtag1 -Value $value -Time (Get-Date).AddDays(-2).Date.AddMinutes($ii*15) -Connection $con Add-PIValue -PointName inputtag2 -Value ($value*2) -Time (Get-Date).AddDays(-2).Date.AddMinutes($ii*15) -Connection $con $value++ } }
The following analysis was set up to add the values:
Notice the boxed symbol indicating the analysis is set up for automatic recalculation. Also, the analysis is only triggered on only one of the inputs.
We can then see the output only has one timestamp per input:
Hope this helps!
Liam
-
Re: Run Analysis using AFSDK
nthorson Mar 27, 2018 9:52 PM (in response to lmurphy)Thanks for the feedback! This seems to be working. Originally I was concerned pi_point_1 would get updated first and kick off the analysis before pi_point_2 was updated. However, I learned there is a 5 second delay between the time the point is updated and when the analysis runs. Therefore, it should not be an issue.
-
Re: Run Analysis using AFSDK
lmurphyMar 28, 2018 3:23 PM (in response to nthorson)
Hi Nick,
Yes, that is correct. The delay is configurable as well, using the \\<AFServer>\Configuration\OSIsoft\PIANO\AnalysisService\ServiceConfiguration|ServiceConfiguration attribute as well. If you want to alter the delay, you can change the following parameter and restart the Analysis Service:
<CalculationWaitTimeInSeconds>5</CalculationWaitTimeInSeconds>
That being said, if 5 seconds is enough to account for the remaining data flowing in, then I wouldn't recommend delaying the calculations unless necessary for a different use case.
-
-