How to in code "PI AF calculations either in WARNING or ERROR state"?
As per below two images AFStatus not showing WARNING. So do I get it.
Any suggestion welcome
In the latest release of AF SDK version 2.10.5. You can use AFAnalysisService.QueryRuntimeInformation Method to do this.
// Retrieve query results as ordered fieldsIEnumerable<IList<AFAnalysisService.RuntimeFieldValue>> results = analysisService.QueryRuntimeInformation("path: '*Database1*Steam*' status :in ('Warning', 'Error')", "id name");if (!results.Any()) return;// First resultvar first = results.First();Guid guid = (Guid)first;string name = first;
status represents the Analysis status in the analysis service from the set of "Running", "Stopped", "Starting", "Stopping", "Error", "Warning", and "Suspended"
For more information on other filter fields, you can look at AFAnalysisService.RuntimeInformationFields Property in the AF SDK documentation available when you install AF.
The public AF SDK reference doesn't have version 2.10.5 yet.
You can also view this Tech Talk for some examples.
Is any way there we can do this in lower version?
Thanks for your reply.
I have an another question now. Please find the below screen shot.
How take Error and Warning message in C# code. Highlighted in block box.
You can use the statusDetail as one of your fields argument in the AFAnalysisService.QueryRuntimeInformation Method. This will again require the latest version of AF SDK.
This new feature requires Asset Analytics 2018 SP2, PI AF Server 2018 SP2 and AF SDK 2018 SP2. I just wanted to make that a little clearer.
Prior to 2018 SP2, analysis runtime information was not exposed in the AF SDK. Only PSE could retrieve runtime information.
Retrieving data ...