Professional OPC
Development Tools

logos

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.

Error in OPC DA ERROR CODE 0x80040202

More
08 Apr 2018 15:40 #6213 by support
Thank you for the answers.

For errors that are generated inside QuickOPC, there is always a descriptive error message that comes with them. But there is no document error list.

Beside, there are errors that are just passed through QuickOPC, and this is one of them. Nobody can make a full list of these, because they come from sources that originate elsewhere - mainly, in Microsoft Windows COM/DCOM infrastructure, but also in OPC Core Components, the target OPC server, etc.

This particular error (symbolic code is CONNECT_E_CANNOTCONNECT) is one of them. I do not know the reason, but a common suspicion with this error is a problem with OPC proxy/stub. There are separate versions of proxies/stubs for 32-bit and 64-bit code. And practically all OPC Classic clients are 32-bit. Your application probably runs as 64-bit, and it is therefore using a different proxy/stub, which may explain the difference in behavior between other OPC clients and yours.

To test out this hypothesis, please try the following (and test after each try):

A. Uninstall any existing OPC Core Components, and install the latest (for 64 bits) from opcfoundation.org/developer-tools/developer-kits-classic/core-components/ .

B. Build your application for 32-bit only, to see if it helps: Assuming that currently all your assemblies are targeting “Any CPU”, you just need to change one setting on one assembly – the top-most assembly that is for your .EXE.

1. In Visual Studio – Solution Explorer, right-click on the project, and select Properties.
2. Select the Build tab.
3. In the upper left corner, next to “Configuration:”, select “All Configurations” (we are doing this just in case you later choose to build a different configuration, such as Release instead of Debug).
4. A bit further down in the General group, next to “Platform target”, select “x86”.
5. File -> Save All.
6. Build the project
Alternatively, this can be done using the CORFLAGS utility on an existing EXE (see docs.microsoft.com/en-us/dotnet/framework/tools/corflags-exe-corflags-conversion-tool ).

C. Make the change in application configuration file as described here: kb.opclabs.com/How_to_force_usage_of_built-in_OPC_proxies_and_stubs .

Best regards

Please Log in or Create an account to join the conversation.

More
07 Apr 2018 11:23 #6210 by SENTHILKUMAR
please find below our comments

1. you are exactly right. we are using subscription. subscription is working fine. the application working good in two machines.we are facing in other PC.
2. we are running the application on 64 bit windows
3. OPC server is same as that works with other client.
4. Connection to the server is remote. the OPC Client is in 64 bit windows PC. OPC Server is running another 64 bit computer.

we tested the communication with other open source application like OPC Expert, Quick Client, Matrikon OPC Analyzer. all the three able to read the remote opc server name, the tag list and its values. the OPC client developed using quick OPC able to read the remote OPC Server, OPC Tags but we are not able to read the values alone. we are getting the error code 0x80040202 only during reading the values.

please let us how to rectify it. why the application able to read the OPC Server name, OPC Tag names but not able to read the values. while subscribing the values we are getting the exception and the error code is 0x80040202

please share us the solution to overcome the issue.
if you had any error list and its description, please share us.

Please Log in or Create an account to join the conversation.

More
04 Apr 2018 14:47 #6205 by support
Hello,
can you please answer the following first:

1. I understand you got this error when reading, is that correct? If so, what happens with subscriptions? Do they work?
2. Is it on 32-bit or 64-bit Windows?
3. Is it with the same target OPC server that works OK on other computers, or is it with an OPC server that is just on this one computer?
4. Is the connection to the server local or remote? (i.e. is your app and the server on this same machine, or on different ones?)

Regards

Please Log in or Create an account to join the conversation.

More
04 Apr 2018 01:02 #6203 by SENTHILKUMAR
Dear Zbynek,

we executed our OPC DA subscription application in one of the machine. our application able to browse the tag names from the OPC server. but it was not able to read the values from the OPC Server. while reading the OPC server, we are getting the exception.

the error code we received is 0x80040202. for more detail please refer attached error code image



please suggest us how to overcome this error. any code modification required to overcome the error 0x80040202

is there any error code table and its solution available for quick OPC. if available please share us for future reference.



we tried other open source OPC Clients like OPC Expert, quick Client to ensure the communication. all the other OPC Clients able to read the Values from the OPC Server.

we are using licensed version . the version is 5.51. please provide the solution for the error.
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.049 seconds