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.

OPCDA: Class not registered Exception

More
19 Jun 2022 13:52 #10993 by support
Hello,
please create a new topic on the forums next time, for a new issue.

Yes, there appears to be an unwanted "interlocking" problem in QuickOPC 2022.1 between item subscriptions, and reading. Thank you for reporting it!
It should be fixed now - please download QuickOPC 5.63.246 or later, rebuild, and retest.

Best regards

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

More
17 Jun 2022 13:26 #10987 by spicerno
Good afternoon,

thanks to your advices, after a few tests and code reviewes we managed to fix "RPC_E_TOO_LATE", and finally tests UseCustomSecurity = false.
The error "Class not registered" did not occur using this last setting and we could browse the server.
The COM-related issue seems to be solved but we have to test it on other environments before publishing a new release.

Unfortunately a new (not COM related) error occured:
our application subscribe N signals, moreover every x time, it also performs some read operation in polling (ReadMultipleItem).
In the code there were not any changes related to these features during the update of QuickOPC library.
In the last version, ReadMultipleItem timed out with the following error: "Cannot connect topic (timeout).".
Besides it looks like as the client is not able to work on subscription notifications until all ReadMultipleItem are timed out.

May I ask you for some advice?

Best Regards.

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

More
09 Jun 2022 08:44 #10957 by support
I looked again at the piece of code you sent, and I think you need to fix it and repeat the tests.

The problem is that many of the settings involved (AllowImpersonateClient, useCustomSecurity, TurnOffCallSecurity) are set AFTER you call AssureSecurityInitialization (if you have that code branch enabled). In such case, they are really ignored - that is by design.

Best regards

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

More
09 Jun 2022 07:56 #10956 by spicerno
Yes, I set some COM-related parameters in the old version too, but I was actually using the default parameters.
I get the same RPC_E_TOO_LATE error with both AllowImpersonateClient(=true) and UseCustomSecurity(=false), so these parameters are ignored and kept the parameters in use (default).
I already followed the links you sent in the previous post but it didn't work.

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

More
08 Jun 2022 15:55 #10955 by support
If it Hello.

I am surprised because you have not mentioned before that in your old application you were setting some COM-related parameters from the code. In my previous replies, I therefore assumed that you were not doing that. But now I can see in the commented out parts of the code from the old version that you probably were setting them. And, since the objects/parameters have changed in version 2022.1, you either must have removed the setting or have done them differently with the new version. This invalidates any previous reasoning made with an assumption that the simple fact of upgrading the app to a new version has changed things.

The error you are getting is not blocking anything, but it means that whatever security parameters we are trying to use with COM initialization are ignored, and some different parameters are in use. In the links I have provided in my previous post, there is an explanation with hints as to how to prevent the error (it is not always possible, though).

It is also not clear to me what you mean "We ran into a problem while doing this.". What is "this"? Is that with the first suggestion I gave, or with the second one?

I suppose it is with the first one (AllowImpersonateClient = true), can you confirm? If so, what result do you get when trying the second one (UseCustomSecurity = false)?

Regards

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

More
08 Jun 2022 15:25 #10954 by spicerno
Hello,
We ran into a problem while doing this.
we got the following error from eventviwer:
CoInitializeSecurity failure (0x80010119): Security must be initialized before any interfaces are marshalled or unmarshalled. It cannot be changed once initialized.\r\n+ This error (RPC_E_TOO_LATE) is not uncommon in hosted .NET applications. Depending on various factors, it might be possible to prevent it, or safely ignore it (if COM works as intended). Consult the product documentation.\r\n+ Current thread name: \"\", from thread pool: no, managed thread Id: 1, apartment state: MTA.",

we added the error message log to the code for the AssureSecurityInitialization call and we actually got the same error.

We have set Default Authentication Level, to "Packet Integrity" for both "My Computer" and OPCenum but the error persists (as the link you sent).

With the old library we used the default on ComManagement.Instance.Configuration.SecurityParameters.* parameters and this probably never blocked us.

I have attached the code:



Do you have any advice?
Attachments:

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

More
08 Jun 2022 10:25 #10950 by support
Hello,
thank you for the download. I tested it and the CLSID of the Matrikon simulation server is the same as in newer version, so this possible cause is ruled out.

There were changes related to COM security in QuickOPC version 2022.1. Some information to that:

- kb.opclabs.com/What%27s_new_in_QuickOPC_2022.1
- kb.opclabs.com/COM_management
- kb.opclabs.com/COM_settings_in_OPC_Classic_client_components

This means that the default behavior is somewhat different too. I suggest that you experiment with changes below. Always place the statement at the very beginning of your program.

Try
ComManagement.Instance.Configuration.SecurityParameters.AllowImpersonateClient = true;
If that does not help, remove it, and try
ComManagement.Instance.Configuration.SecurityParameters.UseCustomSecurity = false;
Best regards

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

More
08 Jun 2022 09:05 #10947 by spicerno
Hello,

you can download our version here:
we.tl/t-QWY3qYfa4S

Thank you,

Andrea

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

More
07 Jun 2022 16:01 #10939 by support
Hello,

although it is not much likely to be the case, I first need to rule out one cause: The new version contains a database of some common OPC servers, and their ProgIDs and CLSIDs. And, when it knows the server (by its ProgID), it directly uses the CLSID from its internal database, so that it does not have to contact the OPCEnum on the target computer. This relies on fact that the mapping from version-dependent ProgIDs to CLSIDs should be stable.

We have a mapping for 'Matrikon.OPC.Simulation.1' in the database. I need to verify whether the version 1.5.0.0 did not have, in fact, a CLSID different from the one we have in the database. Unfortunately I do not have that version available (we currently have 1.7.something), and the MatrikonOPC site only offers me the latest version. Can you either somehow make the version 1.5.0.0 available to me, or figure out (by browsing servers) what its CLSID is?

Only if this is OK, it would make sense to investigate other possible causes.

Best regards

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

More
07 Jun 2022 15:37 #10938 by spicerno
Hello,
the target OPC server is located on a remote computer (I replaced the real Ip with "MyIp" only on the log previous posted).
We installed Matrikon Simulation Server (v1.5.0.0 as we were unable to install the latest one, we miss requirements and we are not owner of the machine).
We developed a stand-alone application (TEST APPLICATION) with the same code of the main service (MAIN APPLICATION) in order to test the following cases:
- TEST APPLICATION with QuickOPC (ver 5.63.215) to remote server with the credentials used in OPCEnum: Class not registered.
- TEST APPLICATION with QuickOPC (ver 5.63.215) to remote server with random credentials: Access Denied.
- TEST APPLICATION with QuickOPC (ver 5.63.215) to local simulation server with the credentials used in OPCEnum: OK.
- TEST APPLICATION with QuickOPC (ver 5.63.215) to local simulation server with random credentials: OK.
- MAIN APPLICATION with QuickOPC (ver 5.54.1151.1) to remote server with the credentials used in OPCEnum: OK.
- MAIN APPLICATION with QuickOPC (ver 5.54.1151.1) to remote server with random credentials: Access Denied.



I posted "BrowseNodes" logs but I got the same error for both subscription and read.

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

Moderators: support
Time to create page: 0.074 seconds