- Posts: 18
- Thank you received: 0
Online Forums
Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.
Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.
Do not use the Contact page for technical issues.
- Forum
- Discussions
- QuickOPC-Classic in COM
- Connections, Reconnections, COM/DCOM
- Random Disconnect from OPC server
Random Disconnect from OPC server
- algorithmica
- Topic Author
- Offline
- Elite Member
Please Log in or Create an account to join the conversation.
thanks for the code. Since you are using ReadMultipleItems and the errors are therefore already converted to objects, it's even easier to figure out the details. Can you please extend the code that prints out the properties from IComExceptionPtr, so that it also prints out the HResult and Source properties?
Thank you
Please Log in or Create an account to join the conversation.
- algorithmica
- Topic Author
- Offline
- Elite Member
- Posts: 18
- Thank you received: 0
Please Log in or Create an account to join the conversation.
"Unknown error" most likely corresponds to an HRESULT of E_FAIL, numerically 0x80004005, or (decimal) -2147467259. Can you please verify this first.
This error does not tell anything its cause or source - it is a general error used for many things. For precisely this reason, we are trying to avoid generating it anywhere inside QuickOPC - that is, we (almost) always use our own specific error codes. The error can still be returned by QuickOPC method calls, if it is returned by the target OPC server (more likely), or some of the supporting system calls made by QuickOPC (possible, but unlikely).
The first we should therefore do is to determine where are the origins of the error. One way to do it is to examine the Source property of the error. This information is provided in the standard way by the IErrorInfo interface. Different tools/languages expose this in different ways (for example, in VB or VBScript, it corresponds to the Err object and its Source property). If the Source contains the ProgID of the OPC Server, the origins of the error are in the server, and we should switch our attention to the server. If the Source contains "OPCLabs.EasyDAClient.5.1", the origins of the error are in QuickOPC component.
If you do not know how to access the error Source, please let me know which language/tool you are using. and I will try to supply a corresponding example.
Note that even for E_FAIL-s generated by the server, QuickOPC should try to reconnect. This, however, only applies to certain server-level method calls (i.e. it does not apply, for example, if the server starts returning this error on each subscribed item individually), and, if the server is in some "bad"state, reconnecting may not help. I actually suspect that this could be the situation, but need to go step by step (by determining the Source first) in order to verify it.
Best regards
Please Log in or Create an account to join the conversation.
I apologize for the delay - will answer by tomorrow.
Best regards,
Please Log in or Create an account to join the conversation.
- algorithmica
- Topic Author
- Offline
- Elite Member
- Posts: 18
- Thank you received: 0
I have a very simple program that reads some items from an OPC server every few seconds based on the simple read item sample provided with QuickOPC COM. This goes well for some time. Sometimes I get exceptions and then I output the message like in the example. Whenever the message actually contains a real message all is well. At random intervals however (roughly once in two weeks) the exception message says "unknown error" and then the read process never recovers. The connection to the server seems to be broken. However both the server and the client application are still running and the network is fine. Thus the error must somehow be internal to QuickOPC. I have tried to re-connect but after I do this for a few times, the connection is irreparably severed and I need to reboot my client machine. After that it runs fine again. What can I do?
Thank you! Best, Patrick
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in COM
- Connections, Reconnections, COM/DCOM
- Random Disconnect from OPC server