西门子 OPC 客户端的 VB6 代码示例?
我正在尝试更新一个古老的 VB6 项目以启用与远程 OPC 服务器的通信。我已经安装了西门子工具包,但我找不到任何有关如何将其与 VB6 一起使用的有用文档。 (适用于 C#)
该应用程序非常简单。我只需要连接到远程服务器并写入/读取单个地址。
我发现 DatCon OCX 控件我认为它可以处理通信,但我尝试手动输入的所有 ServerName 值都不起作用。
有人可以帮忙吗?
I am trying to update an ancient VB6 project to enable communication with a remote OPC Server. I have installed the Siemens toolkit but I am unable to find any useful documentation on how to use it with VB6. (Works with C#)
The application is very simple. I just need to connect to the remote server and write/read single addresses.
I found the DatCon OCX control which I assume handles the communication but all the ServerName values I tried to enter by hand did not work.
Can anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将 DLL 或 OCX(seimens 工具包)的引用添加到 VB6 项目中,然后使用对象浏览器浏览公开的对象。你常常可以通过这样做来弄清楚你需要什么。
C# 文档还应该提供丰富的信息。如果该库是 COM 库,则您将按照与 VB6 基本相同的方式使用它。
Add a reference to the DLL or OCX (the seimens toolkit) to your VB6 project and then use the object browser to browse around the exposed objects. You can often times figure out what you need just be doing that.
The C# docs should also provide a wealth of info. If the library is a COM library, you'll use it essentially the same way from VB6.
自从发帖以来,我确实取得了一些进步。下面的例子帮助我开始。
http://support.automation.siemens.com/WW/llisapi.dll?func=cslib.csinfo&objId=25229521&load=treecontent&lang=en&siteid=cseus&aktprim=0& objaction=csview&extranet=standard&viewreg=WW
这是我当前的代码。这并不多 - 只是与服务器联系并尝试写入一个值。我没有再进一步。我开始收到 COM 错误并认为安装有问题(我在安装时遇到了问题),所以我决定重新安装。它不起作用。安装是不可能的。等待西门子升级。
Since posting, I did make some progress. The following example helped me to get going.
http://support.automation.siemens.com/WW/llisapi.dll?func=cslib.csinfo&objId=25229521&load=treecontent&lang=en&siteid=cseus&aktprim=0&objaction=csview&extranet=standard&viewreg=WW
Here is my current code. It's not much - just makes contact with the server and tries to write a value. I didn't get any further. I started getting COM errors and assumed the installation was bad (I had had problems installing) so I decided to reinstall. It didn't work. Installation was impossible. Waiting for an upgrade from Siemens.