godsharp / opcsample Goto Github PK
View Code? Open in Web Editor NEWOpc Sample
Home Page: https://godsharp.github.io/opcsample/
Opc Sample
Home Page: https://godsharp.github.io/opcsample/
I have registered the opcdaauto.dll and now I am seeing another exception in the logs:
System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
at OPCAutomation.IOPCAutoServer.Connect(String ProgID, Object Node)
at GodSharp.Opc.Da.OpcAutomationClient.OnConnect()
at GodSharp.Opc.Da.OpcDaClient.Connect()
at RigCLOUDOPCDA.Reader.Program.EstablishOPCConnection(Boolean disconnect)
Please advise.
hi,
when trying to connect to an opc server I receive this exception
System.TypeLoadException: 'Could not load type 'RenewUserIdentityEventHandler' from assembly 'Opc.Ua.Client, Version=1.4.371.0,
the code is very simple, it's exactly as the example provided.
OpcUaClientBuider buider = new OpcUaClientBuider();
buider
.WithEndpoint(@"opc.tcp://10.10.10.12:4840")
.WithAnonymous()
.WithClientId("myClientID");
var client = await buider.BuildAsync();
my application targets .net framework 4.8
any suggestions?
thank you
When I try to connect with user and password I get a Opc.Ua.ServiceResultException with this message:
"SHA1 signed certificates are not trusted."
This is my code
`
OpcUaClientBuilder builder = new OpcUaClientBuilder()
.WithEndpoint(url)
.WithAutoAcceptUntrustedCertificate(true)
.WithAccount(user, password)
.WithEventCertificateValidationHandler(new CertificateValidationEventHandler(OnCertificateValidation))
.WithClientId(clientName);
private void OnCertificateValidation(CertificateValidator validator, CertificateValidationEventArgs e)
{
if (e.Error.StatusCode == StatusCodes.BadCertificateUntrusted)
{
e.Accept = true;
}
}
`
How can I connect to my opc with just user and passowrd?
How I can set RejectSHA1SignedCertificates to false?
Regards.
Hello GodSharpOpcDaSample!
connect to server ...
未经处理的异常: System.AggregateException: 发生一个或多个错误。 ---> System.Exception: The tag with item name 'Channel1.Device1.Bool' add failed. ---> System.Runtime.InteropServices.COMException: 异常来自 HRESULT:0xC0040007
在 OPCAutomation.OPCItems.AddItem(String ItemID, Int32 ClientHandle)
在 GodSharp.Opc.Da.OpcAutomationGroupSubscription.Add(Tag[] tags)
--- 内部异常堆栈跟踪的结尾 ---
--- 内部异常堆栈跟踪的结尾 ---
在 GodSharp.Opc.Da.OpcAutomationGroupSubscription.Add(Tag[] tags)
在 GodSharp.Opc.Da.OpcDaClient.Connect()
在 GodSharpOpcDaSample.Program.Main(String[] args)
运行环境
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()
I am following the code provided in the opcsample/Program.cs and I am getting the below exception. Should I register any of the com dll's using regsvr?
Please advise.
System.Runtime.InteropServices.COMException: 'Retrieving the COM class factory for component with CLSID {28E68F9A-8D75-11D1-8DC3-3C302A000000} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).'
These are the dll's inside the bin folder:
when i use opcsample to connect my keepserverEx6.1 and I get the following error:
System.InvalidCastException:“无法将类型为“System.__ComObject”的 COM 对象强制转换为接口类型“OpcRcw.Comn.IOPCServerList2”。此操作失败的原因是对 IID 为“{9DD0B56C-AD9E-43EE-8305-487F3188BF7A}”的接口的 COM 组件调用 QueryInterface 因以下错误而失败: 拒绝访问。 (异常来自 HRESULT:0x80070005 (E_ACCESSDENIED))。”
here is my code:
my tag name:
运行环境
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()
We are using GodSharp OPC DA to read Kepware tags and have subscribed to the data change event but we suspect data change event is not getting triggered in sequential order.
Is DataChangedOutput output.Data.Timestamp denotes the time the data actually changed in Kepware or it it the time it is received by the handler event for processing?
We also tried to disconnect and connect back but it is waiting for the disconnect and it seems like that is never happening.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.