Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84650members
353993posts

How to call the ClearSCADA built in Time Average function?

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
Kan
Ensign
Ensign
0 Likes
3
1269

How to call the ClearSCADA built in Time Average function?

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.

Tags (1)

Accepted Solutions
BevanWeiss
Spock
Spock
0 Likes
2
1252

Re: How to call the ClearSCADA built in Time Average function?

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:

  • StartTime (Time)... should be easy
  • EndTime (Time)... should be easy
  • Aggregate (Long)... you probably need to find out what number is associated with the aggregate you want.. I forget where this was found, I think it's in the help somewhere, or tprojects
  • Reason (String).. to filter the values if needed

It will return a variant representing the processed value.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..

See Answer In Context

Tags (1)
sbeadle
Janeway Janeway
Janeway
0 Likes
1
1245

Re: How to call the ClearSCADA built in Time Average function?

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());

See Answer In Context

Tags (1)
3 Replies 3
BevanWeiss
Spock
Spock
0 Likes
2
1253

Re: How to call the ClearSCADA built in Time Average function?

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:

  • StartTime (Time)... should be easy
  • EndTime (Time)... should be easy
  • Aggregate (Long)... you probably need to find out what number is associated with the aggregate you want.. I forget where this was found, I think it's in the help somewhere, or tprojects
  • Reason (String).. to filter the values if needed

It will return a variant representing the processed value.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
Tags (1)
sbeadle
Janeway Janeway
Janeway
0 Likes
1
1246

Re: How to call the ClearSCADA built in Time Average function?

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());
Tags (1)
Kan
Ensign
Ensign
0 Likes
0
1227

Re: How to call the ClearSCADA built in Time Average function?

Time Average = 30

StdDev = 5

 

Thanks a lot for your help!

Tags (1)