EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-05 09:17 PM . Last Modified: 2023-05-03 12:13 AM
Is it possible to call the ClearSCADA Time Average function from a .NET application using the client library? Any example code will be much appreciated.
Thanks a lot.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-06 10:55 PM
Yes, it's possible.
From the .NET API you can InvokeMethods, you just need to know the name of the Method that you want to call, and what aggregate it is on, and what arguments to provide to it.
Pretty much all of these can be found in the DB Schema.
So I would start there.
If you're on your local GeoSCADA Expert server you can probably just go here:
https://localhost/schema/CHistoryBase
And that should show you the methods available. You can see 'ProcessedValue' which will return 'a single processed historic value', which sounds like what a Time Average would be.
Then if you look at the argument for it, it wants:
It will return a variant representing the processed value.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-07 02:19 AM
Here's some sample code to do that - comments do some of the explaining:
// Retrieve the last day's data
DateTime startTime = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1));
DateTime endTime = DateTime.UtcNow;
// Retrieve an average of the last day's values - Processed Data
// Historic Aggregate code 3 = average of values. Search help for "Animations for Historic Data" for codes.
object[] pParams = new object[4] { startTime, endTime, 3, "" };
object value = (object)myPoint.InvokeMethod("Historic.ProcessedValue", pParams);
Console.WriteLine("Processed Average Value: " + value.ToString());
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-06 10:55 PM
Yes, it's possible.
From the .NET API you can InvokeMethods, you just need to know the name of the Method that you want to call, and what aggregate it is on, and what arguments to provide to it.
Pretty much all of these can be found in the DB Schema.
So I would start there.
If you're on your local GeoSCADA Expert server you can probably just go here:
https://localhost/schema/CHistoryBase
And that should show you the methods available. You can see 'ProcessedValue' which will return 'a single processed historic value', which sounds like what a Time Average would be.
Then if you look at the argument for it, it wants:
It will return a variant representing the processed value.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-07-07 02:19 AM
Here's some sample code to do that - comments do some of the explaining:
// Retrieve the last day's data
DateTime startTime = DateTime.UtcNow.Subtract(TimeSpan.FromDays(1));
DateTime endTime = DateTime.UtcNow;
// Retrieve an average of the last day's values - Processed Data
// Historic Aggregate code 3 = average of values. Search help for "Animations for Historic Data" for codes.
object[] pParams = new object[4] { startTime, endTime, 3, "" };
object value = (object)myPoint.InvokeMethod("Historic.ProcessedValue", pParams);
Console.WriteLine("Processed Average Value: " + value.ToString());
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.