Our Brands

Impact-Company-Logo-English Black-01-177x54

Welcome to the Schneider Electric Website

Welcome to our website.
		
How can we help you today?
You are currently viewing the content available in Vietnam. If you are looking for information for another region, please select the correct country from the top-left dropdown in the page and 'Navigate to Browse FAQs' in the Support menu.
How to use LoadDataValue in C#
DISCLAIMER

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:

private void button9_Click(object sender, EventArgs e)
{
DBObject TestPoint;
Aggregate HistAgg;

Object[] args;
DateTime dt;
args = new Object[4];

using (Connection conn = new Connection("TestApp"))
{
// Connect to local server
SecureString passwd = new SecureString();
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 = new DateTime(2019, 4, 3, 7, 21, 52);
args[2] = new System.DateTimeOffset(dt);
args[3] = 88;
HistAgg.InvokeMethod("LoadDataValue", args);
}
conn.LogOff();
conn.Disconnect();
}
}

Schneider Electric Vietnam

Explore more
Range:
Users group

Discuss this topic with experts

Visit our community and get advice from experts and peers on this topic and more
Explore more
Range:
  • Products Documentation
  • Software Downloads
  • Product Selector
  • Product Substitution and Replacement
  • Help and Contact Center
  • Find our Offices
  • Get a Quote
  • Where to buy
  • Schneider Electric Community
  • Careers
  • Company Profile
  • Report a misconduct
  • Accessibility
  • Investors
  • EcoStruxure
  • Job Search
  • Blog
  • Privacy Policy
  • Cookie Notice
  • Terms of use
  • Change your cookie settings