The example below is intended to demonstrate one or more features or methods and is presented as a configuration example only. Schneider Electric assumes no liability for the use or application of this example or any portion thereof.
LoadDataValue is a method that can be used to insert historic data to a point (more details on the ClearSCADA Database Schema).
Below there is an example on how to connect to a local server and use this method:
using (Connection conn = newConnection("TestApp")) { // Connect to local server SecureString passwd = newSecureString(); string strPassword = "adminexample"; foreach (char c in strPassword) passwd.AppendChar(c); passwd.MakeReadOnly(); conn.Connect("localhost"); conn.LogOn("AdminExample", passwd);
// Get the point TestPoint = conn.GetObject("~Points.A1"); // If Historic is enabled for the point, insert historic data if (TestPoint.Aggregates.TryGetValue("Historic", out HistAgg) == true) { args[0] = 0; args[1] = 192; dt = newDateTime(2019, 4, 3, 7, 21, 52); args[2] = new System.DateTimeOffset(dt); args[3] = 88; HistAgg.InvokeMethod("LoadDataValue", args); } conn.LogOff(); conn.Disconnect(); } }
Can't find what you are looking for?
Reach out to our customer care team to receive information on technical support, assistance for complaints and more.