如何从 Proficy Historian 查询原始数据?
如何从 Proficy Historian/iHistorian 检索原始时间序列数据?
理想情况下,我会要求提供两个日期之间特定标签的数据。
How can I retrieve raw time-series data from a Proficy Historian/iHistorian?
Ideally, I would ask for data for a particular tag between two dates.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以尝试多种不同的采样模式。
这些模式可使用以下所有 API 获得。
其中趋势采样模式可能就是您想要的,因为它是专门为图表/而设计的趋势。 不过,实验室和插值也可能有用。
请阅读电子书以获取有关每种采样模式的更多信息。 在我的机器上,它存储为
C:\Program Files\GE Fanuc\Proficy Historian\Docs\iHistorian.chm
并且我安装了 3.5 版本。 请特别注意以下部分。以下是如何构建 OLEDB 来进行趋势采样。
使用 User API 和 SDK 显示等效方法很复杂(使用 User API 更是如此),因为它们需要代码中的大量管道才能进行设置。 客户端访问 API 较新,并在幕后使用 WCF。
顺便说一下,OLEDB 方法有一些限制。
There are several different sampling modes you can experiment with.
These modes are available using all of the following APIs.
Of these the trend sampling mode is probably what you want since it is specifically designed for charting/trending. Though, lab and interpolated may be useful as well.
Read the electronic book for more information on each sampling mode. On my machine it is stored as
C:\Program Files\GE Fanuc\Proficy Historian\Docs\iHistorian.chm
and I have version 3.5 installed. Pay particular attention to the following sections.Here is how you can construct an OLEDB to do trend sampling.
Showing the equivalent methods using the User API and the SDK are complex (more so with the User API) since they require a lot of plumbing in the code to get setup. The Client Access API is newer and uses WCF behind the scenes.
By the way, there are a few limitations with the OLEDB method though.
我的一位同事将其放在一起:
在 web.config 中:
在数据层中:
更新:
这很有效,但我们遇到了标签不经常更新的问题。 如果标签在请求的 startDate 和 endDate 的开始或结束附近没有更新,则趋势看起来会很糟糕。 更糟糕的是,仍然存在在请求的窗口期间没有明确点的情况——我们不会得到任何数据。
我通过进行三个查询解决了这个问题:
这是一种可能效率低下的方法但它确实有效:
是的,我知道,这些查询应该参数化。
A coworker of mine put this together:
In web.config:
In the data layer:
Update:
This worked well but we ran into an issue with tags that don't update very often. If the tag didn't update near the start or end of the requested startDate and endDate, the trends would look bad. Worse, still were cases where there were no explicit points during the window requested--we'd get no data back.
I resolved this by making three queries:
This is a potentially inefficient way to do it but It Works:
And yes, I know, those queries should be parameterized.
我们编写了一个包装 DLL,如下所示:
一些注意事项是 iFIX 将在启动时检查 DLL 是否已加载,因此您需要执行诸如动态加载/卸载 DLL 之类的操作,以便其他应用程序不会崩溃。 我们通过动态删除/添加注册表项来做到这一点。
另一种情况是,如果您轮询 10,000 个样本,其中 1 个样本已损坏,则会删除所有 10,000 个样本。 您需要实现一个错误数据处理程序,该处理程序将从错误数据的两侧开始,并逐步递增以获取错误样本两侧的所有数据。
有几个 C 头文件包含 DLL 的所有错误代码和函数头。
We wrote a wrapper DLL that looked like this like this:
Some notes are that iFIX will check if the DLL is loaded on startup so you need to do things like dynamically load/unload the DLL so that other applications don't crash. We did this by deleting/adding registry keys on the fly.
Another one is if you poll 10,000 samples and 1 of the samples are corrupted it will drop all 10,000 samples. You need to implement a bad data handler that will start at either side of the bad data and increment in steps to get all data either side of the bad sample.
There are several C header files that contain all of the error codes and the function header for the DLL.
Michael——IP21 中有一个“插值”表,以及“实际”数据点表。 Proficy也有这个功能吗?
Michael--in IP21 there is an "Interpolated" table, as well as the "actual" data point table. Does Proficy have that as well?