From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.



监控船舶范例使用了多个OPC条目,运行报错-2146828283



主要软件:
主要软件版本: 6.0.2
主要软件修正版本: 8.2
次要软件: N/A

问题: 我尝试使用“ Multiple OPC Items Monitor.vi”范例。当我运行VI时出现一个位被定义的错误error -2146828283。为什么会出现这样的错误,我应该怎样避免出现该错误?

解答:

这个船舶范例“ Multiple OPC Items Monitor.vi ”包括DataSocket Open Connection VI。这个VI接受Access Mode终端枚举。这个枚举包括Reserved1和Reserved2的数据,也包括其它的数据(读,读/自动更新,写,写自动更新)。无论Reserved1和Reserved2在DataSocket Connect这个VI中被选中都会报错error -2146828283,如下图所示

 要避免这个错误的发生就要确保接收到正确的枚举值。这个范例是用来检测OPC服务器的,所以只有“读”“读自动更新”是有效的并且没有错误。Reserved1和Reserved2在LabVIEW 8.2以及后来的版本中被删掉。



相关链接: Developer Zone Tutorial: Connecting LabVIEW to an OPC Server through a DataSocket Connection

附件:





报告日期: 11/02/2007
最近更新: 11/04/2015
文档编号: 4F1GMIQU