我們的品牌

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

歡迎造訪施耐德電機全球網站

歡迎訪問我們的網站
		
我们今天能为您提供什么帮助?
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();
}
}

施耐德電機Taiwan

探索更多
系列:
探索更多
系列:
  • 產品文檔
  • 軟體下載
  • 產品選型工具
  • 產品替代和替換
  • 幫助和聯絡中心
  • 尋找我們的辦公室
  • 取得報價
  • 施耐德電機社群
  • 人才招募
  • 公司簡介
  • 舉報不當行為
  • 無障礙
  • 新聞中心
  • 投資者
  • 專業洞察
  • 台灣施耐德電機學院
  • 綠色影響力落差調查
  • Schneider Go Green 2025
  • 隱私政策
  • Cookie通告
  • 使用條款
  • Change your cookie settings