AnsweredAssumed Answered

Analysis evaluation and updating values order in Custom DR

Question asked by fokin on Sep 28, 2020
Latest reply on Oct 9, 2020 by fokin

Hello,

I am trying to implement Custom DR based on MS SQL.


I have implemented the methods:

AFDataReferenceMethod.GetValue, AFDataReferenceMethod.GetValues, AFDataReferenceMethod.SetValue

AFDataMethods.Summary, AFDataMethods.Summaries, AFDataMethods.FilteredSummaries, AFDataMethods.Future, AFDataMethods.RecordedValue, AFDataMethods.RecordedValues, AFDataMethods.RecordedValuesAtTimes, AFDataMethods.RecordedValuesByCount, AFDataMethods.ReplaceRange, AFDataMethods.UpdateValue, AFDataMethods.UpdateValues

AFDataMethods.DataPipe


Everything works fine only for the first output of Analysis, but have problems with Analysis depend on others.


There are two Event-Triggered Analysis with the same logic:

1. \\Plant1\AVTFSB\FSB\Analyses[AnalysisFuelHourPlan]

2. \\Plant1\\AVTFSB\\AVT10\\Analyses[AnalysisFuelHourPlan]

They are triggered by setting the value by external program on .Net (AF SDK).


And one Event-Triggered Analysis calculates the sum of outputs the two previous. 

3. \\Plant1\AVTFSB\Analyses[AnalysisFuelHourPlan]


It is necessary that the time of all values be the same.

Analysis 1, 2 (rank: 0) calculates correctly, but Analysis 3 (rank: 1) uses previous time values. As you can see from the logs, the calculation of the third Analysis at 8:00 uses the values of the Analysis 1, 2 at 7:00, but the values for Analysis 1,2 at 8:00 have already been calculated. Output attribute HourValue is wrong time, attribute HourNorm and HourNormMax is "NoOutput".  I see in the Custom DR logs that method GetValue  was called before the UpdateValue method. Perhaps the UpdateValue method takes a long time and the common flush of values (with other Analysis group) is delayed. How do I know the order of evaluation and saving values in AF Explorer. Do I need reduce the execution time of the UpdateValue method or maybe another solution? 

 

Logs:

2020-09-23 09:10:04.8163|TRACE|ANStateCalculation:Evaluation|Evaluated '\\Plant1\AVTFSB\AVT10\Analyses[AnalysisFuelHourPlan] (ID:4d780760-dd1d-11ea-bd92-dc4a3e3de128 Rank:0)' {

 TriggerTime: 23-Sep-20 08:00:00

 Inputs:{

    Attribute:'HourValue' Value:928,0643 Timestamp:23-Sep-20 08:00:00 UOM:

    Attribute:'HourNormAspp' Value:26,6 Timestamp:23-Sep-20 08:00:00 UOM:

 }

 Outputs:{

    OutputTime: 23-Sep-20 08:00:00

    Attribute:'HourNorm' Value:26,6 Timestamp:23-Sep-20 08:00:00 UOM:

    Attribute:'HourValue' Value:24686,5112060547 Timestamp:23-Sep-20 08:00:00 UOM:

 }

}

2020-09-23 09:10:04.8652|TRACE|ANStateCalculation:Evaluation|Evaluated '\\Plant1\AVTFSB\FSB\Analyses[AnalysisFuelHourPlan] (ID:8fae9dba-e1cd-11ea-bd93-dc4a3e3de128 Rank:0)' {

 TriggerTime: 23-Sep-20 08:00:00

 Inputs:{

    Attribute:'HourValue' Value:240,9299 Timestamp:23-Sep-20 08:00:00 UOM:

    Attribute:'HourNormAspp' Value:7,22 Timestamp:23-Sep-20 08:00:00 UOM:

 }

 Outputs:{

    OutputTime: 23-Sep-20 08:00:00

    Attribute:'HourNorm' Value:7,22 Timestamp:23-Sep-20 08:00:00 UOM:

    Attribute:'HourValue' Value:1739,51355560303 Timestamp:23-Sep-20 08:00:00 UOM:

 }

}

2020-09-23 09:10:04.8652|TRACE|ANQueuedAFValues:Evaluation|Thread 'DataWriter Thread Pool thread #1' (15)>Flushing 18 values

2020-09-23 09:10:04.9190|DEBUG|ANPerformanceTrace:Performance|Type: ValuesPublished, Data: {

  "ValueCount": 18,

  "ErrorCount": 0,

  "ElapsedMilliSeconds": 41.1209

}

….

2020-09-23 09:10:05.0759|TRACE|ANStateCalculation:Evaluation|Evaluated '\\Plant1\AVTFSB\Analyses[AnalysisFuelHourPlan] (ID:a9b88955-e2c0-11ea-bd93-dc4a3e3de128 Rank:1)' {

 TriggerTime: 23-Sep-20 08:00:00

 Inputs:{

    Attribute:'HourValue' Value:1168,994 Timestamp:23-Sep-20 08:00:00 UOM:

    Attribute:'HourValue' Value:24687,3067 Timestamp:23-Sep-20 07:00:00 UOM:

    Attribute:'HourValue' Value:1732,3728 Timestamp:23-Sep-20 07:00:00 UOM:

    Attribute:'NormMaxCoeff' Value:0,97 Timestamp:01-Jan-20 03:00:00 UOM:

 }

 Outputs:{

    OutputTime: 23-Sep-20 08:00:00

    Attribute:'HourValue' Value:26419,6795 Timestamp:23-Sep-20 08:00:00 UOM:

 }

}

Outcomes