技术文章 - CS238813
使用 ThingWorx OPC DA 服务连接到 OPC DA 服务器时出现 System.InvalidCastException 错误
已修改: 23-Jun-2022
适用于
- ThingWorx Platform 6.5 F000 to 7.1 F000
说明
- ThingWorx OPC DA 服务无法连接到 ThingWorx Server
- ThingWorx 服务器未指示 ThingWorx OPC-DA 服务已在 Connected Devices 混搭中连接。
- 启动 ThingWorx OPC DA 服务后,DotNetSdk-<date>.log 文件中返回以下错误:
[O: com.thingworx.opcda.OpcDaThing] 连接到 OPC DA 服务器时出错:System.InvalidCastException:无法将类型为“System.__ComObject”的 COM 对象转换为接口类型“.”。此操作失败,因为对 IID 为“{39C13A4D-011E-11D0-9675-0020AFD8ADB3}”的接口的 COM 组件调用 QueryInterface由于以下错误而失败:未注册类(来自 HRESULT 的异常:0x80040154 (REGDB_E_CLASSNOTREG))。在 OPCDA.NET.OpcServer.™(Object srvObj) 在 OPCDA.NET.OpcServer.-(String SrvName) 在 OPCDA.NET.OpcServer.Connect(String SrvName) 在 com.thingworx.opcda.OpcDaThing.Connect()
- Notepad++ 中显示的错误消息显示不可打印字符(在 [方括号] 中):
连接到 OPC DA 服务器时出错:System.InvalidCastException:无法将类型为“System.__ComObject”的 COM 对象转换为接口类型“[STS][EOT]“.[PU2][EOT]”。此操作失败,因为对 IID 为“{39C13A4D-011E-11D0-9675-0020AFD8ADB3}”的接口的 COM 组件调用 QueryInterface由于以下错误而失败:未注册类(来自 HRESULT 的异常:0x80040154 (REGDB_E_CLASSNOTREG))。在 OPCDA.NET.OpcServer.[SGCI][BS]™(Object srvObj) 在 OPCDA.NET.OpcServer.—[EPA][BS](String SrvName) 在 OPCDA.NET.OpcServer.Connect(String SrvName) 在 com .thingworx.opcda.OpcDaThing.Connect()
这是文章 238813 的 PDF 版本,可能已过期。最新版本 CS238813