godsharp / opcsample

Opc Sample
https://godsharp.github.io/opcsample/
35 stars 14 forks source link

Unable to cast object,group订阅错误 #2

Closed symenzhang closed 2 years ago

symenzhang commented 3 years ago

运行环境 windows xp professional 2002 sp 3 .net framework 4.0

程序集 GodSharp.Opc.Da.OpcAutomation, Version=2021.204.23.0,

System.InvalidCastException: Unable to cast object of type 'OPCAutomation.OPCServerClass' to type 'OPCAutomation.IOPCGroups'. at System.StubHelpers.InterfaceMarshaler.ConvertToManaged(IntPtr pUnk, IntPtr itfMT, IntPtr classMT, Int32 flags) at OPCAutomation.OPCServerClass.get_OPCGroups() at GodSharp.Opc.Da.OpcAutomationClient.CreateSubscription(Group group) at GodSharp.Opc.Da.OpcDaClient.Add(Group group) at GodSharp.Opc.Da.OpcDaClient.Connect()

symenzhang commented 3 years ago

补充说明:可以正常打开连接,也可以读到nodes.

seayxu commented 3 years ago

用的是哪个OPC Server和版本

symenzhang commented 3 years ago

用的是哪个OPC Server和版本

2.0

seayxu commented 3 years ago

你方便把代码发一下吗,用的OPC Server是哪个厂家的哪个版本

symenzhang commented 3 years ago

你方便把代码发一下吗,用的OPC Server是哪个厂家的哪个版本

opc data access v2.0 Thermo electron resultopcserver

seayxu commented 3 years ago

你加下我QQ:2267930027

ghost commented 2 years ago

问题解决了吗? 我也遇到了一样的问题

seayxu commented 2 years ago

@thinkershare 加下QQ群

ghost commented 2 years ago

@seayxu 我换了个库, 现场调试比较着急用

hrj303662813 commented 2 years ago

@seayxu 我换了个库, 现场调试比较着急用

你换了哪个库?

ghost commented 2 years ago

@hrj303662813 我换的库需要付费, 非开源的东西

hrj303662813 commented 2 years ago

@hrj303662813 我换的库需要付费, 非开源的东西

能推荐下么,是哪个付费的库?

ghost commented 2 years ago

@hrj303662813 我换的库需要付费, 非开源的东西

能推荐下么,是哪个付费的库?

https://technosoftware.com/product/opc-daaehda-client-net/

seayxu commented 2 years ago

OPCDAAuto.dll 版本不一致,参考 资源