简体   繁体   English

如何将数据从C#应用程序写入GE Proficy Historian

[英]How can I write data from a C# app into GE Proficy Historian

I would like to use GE Proficy Historian to archive data from instruments that are not connected to a PLC. 我想使用GE Proficy Historian来存档未连接到PLC的仪器的数据。 Can this be done using c#? 可以用c#完成吗?

You can use the Historian c# User API wrapper to access and update Historian from c#. 您可以使用Historian c#User API包装器从c#访问和更新Historian。 There is information available on it in the Historian documentation that installs with the client tools. Historian文档中提供了可与客户端工具一起安装的信息。 Updating Historian with data from non-PLC connected devices is counterintuitive though, as you have the data elsewhere (I assume) and Historian is designed to log activity from PLCs and similar devices. 使用来自非PLC连接设备的数据更新Historian是违反直觉的,因为您有其他地方的数据(我假设),而Historian旨在记录来自PLC和类似设备的活动。

It will probably be more difficult to read data from non-PLC connected devices into c# than to write data to Historian. 将数据从非PLC连接设备读入c#可能比将数据写入Historian更困难。

Using Historian File collector (historian File Collector is the service available on the machine where Histoiran Server has been installed), we can write data into Proficy Historian. 使用Historian文件收集器(历史记录文件收集器是已安装Histoiran Server的计算机上可用的服务),我们可以将数据写入Proficy Historian。 Step 1. Verify Histoarian File Collector Service is started. 步骤1.验证Histoarian File Collector Service已启动。 Step 2. Locate the folder :\\Proficy Historian Data\\ImportFiles\\Incoming.(On server) Step 3. Write a program to crate csv file. 步骤2.找到文件夹:\\ Proficy Historian Data \\ ImportFiles \\ Incoming。(在服务器上)步骤3.编写程序到crate csv文件。 Write date in following syntax in that file. 在该文件中使用以下语法编写日期。 Syntax : Tagname,TimeStamp,Value,DataQuality Example TIGER.IMPORT_TAG1.F_CV,7/20/01 11:07,1,Good Step 4. create this csv file on lication mentioned above. 语法:Tagname,TimeStamp,Value,DataQuality示例TIGER.IMPORT_TAG1.F_CV,7/20/01 11:07,1,Good Step 4.在上面提到的lication上创建这个csv文件。

Historian file collector will automatically process this csv file and file will be moved to Processed folder available on same lication. Historian文件收集器将自动处理此csv文件,并且文件将被移动到同一个lication上可用的Processed文件夹。 If csv file has some error it will be available move to error folder. 如果csv文件有一些错误,它将可用移动到错误文件夹。 csv file moved to Processed folder indicates the data is written to historian tag. 移动到Processed文件夹的csv文件表示数据被写入历史数据库标记。

You have 4 options: 你有4个选择:

  1. Use the User API interface via ihuapi.dll. 通过ihuapi.dll使用User API界面。 This is a bit easier now that GE provides DLL import and struct definitions, but it can still be a bit daunting. 现在GE提供了DLL导入和结构定义,这有点容易,但它仍然有点令人生畏。 It will work though. 它会工作。 Actually, it works quite well. 实际上,它运作得很好。

  2. Use the SDK interface via ihsdk.dll. 通过ihsdk.dll使用SDK界面。 This is actually a bit easier to work with as compared to the User API. 与User API相比,这实际上更容易使用。 The SDK is a COM library so it has to be registered on the machine. SDK是一个COM库,因此必须在机器上注册。

  3. If the instrument is OPC compliant you can use the OPC collector to forward the data directly to the server; 如果仪器符合OPC标准,您可以使用OPC收集器将数据直接转发到服务器; no coding necessary. 无需编码。

  4. Starting with 5.0 the Collector Toolkit is provided free of charge with the install. 从5.0开始,安装时免费提供收集器工具包。 I cannot comment to much on this yet since I have not worked with custom collectors very much. 由于我没有与定制收藏家合作,所以我不能对此发表评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM