HRESULT: 0x80040202 when Subcribing to multiple Items
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.
Note: Although the API remains the same with this, parts of the internal implementation are significantly different. Compared to what you are used to, there can be different in behavior details (such as error messages), or some "new" bugs,. If the customers spots anything that does not feel right, I would be interested to know about it. Eventually, this setting may become a default.
Upgrade, at least for the purpose of the test, to 2020.3, or even better, 2021.1. This brings in a different internal implementation of the low-level OPC DA code. Our normal implementation is written in C++, this new one is in pure .NET (it has been put in for .NET Core).
In the user's code, after every instantiation of EasyDAClient (similar to "var client = new EasyDAClient();"), put this statement:
- OPC Data Client 2020.2
- Windows 10 (x64)
- Visual Studios 2017 Pro V15.9.34
- C#.Net
- .NET Framework 4.7.2
The Customer is receiving Error: 0x80040202 when he tries to subscribe to multiple items from a remote OPC Server (KEPServer LinkMaster v3). The customer also tested with OPC Expert Client and was able to browse and subscribe to Multiple items successfully.
The Customer is able to run the code locally and received good values from the OPC Server. We believe that DCOM is properly configured since he was able to successfully connect and subscribe using the OPC Expert tool.
Here are some things we have already tested:
- We asked the customer to download and installed our OPC Client tool (OPC Quick Client), connect to the OPC Server, add a group, browse and add items, perform subscription and test synchronous and asynchronous reads. Everything was successful.
- Next we had the customer use the EasyOpcNetDemo Application for the same outline of test as above. He was able to connect to the OPC Server, read and write to the tags but performing a subscription it resulted in "Exception from HRESULT: 0x80040202" in the exception box.
-Next we asked the customer to change the Platform Target to (x86) instead of the default "Any CPU" and to recompile his application. We have seen other users run into situations where 32-bit OPC Servers only allow 32-bit OPC Clients to subscribe. Quick Client and OPC Expert are likely 32-bit. Unfortunately the result was the same as the second test. (HRESULT:0x80040202)
- Finally we had the customer implement the three lines of code below to the beginning of the his code and to test every combination of TRUE/FALSE until one worked. We have recommended this solution to users experiencing OPC Date Client-OPC DA connectivity issues in the past. Unfortunately all combinations were not successful, I have attached a file with the results of each combination.
I am afraid that after all that, we are out of ideas. I would really appreciate if you could provide some input that can guide us on the right direction.