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.

COM Exception

More
06 Dec 2014 09:19 #2547 by support
Replied by support on topic COM Exception
I am glad you got it worked, too. When running an OPC client service, the settings of the Windows service may play together with the DCOM settings for the OPC server, which is probably your case. For example, when the OPC Server is set to run as "launching user", then it will run under the user identity of the Windows service (OPC client) that connects to it. This may not be what the OPC server needs or expects. In general, the best setting on the OPC Server side (i.e. what gives predictable behavior) is to configure the OPC server to run under a specific user account - regardless of who calls it.

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

More
06 Dec 2014 08:35 - 06 Dec 2014 08:50 #2543 by berisha.rinori
Replied by berisha.rinori on topic COM Exception
Hello,

Another thing related to this issue. I got it to subscribe, as I mentioned.
When I install the service, it does subscribe but when the tag value changes, it does not call the callback method. Also, when I try to write to any tag, I get a timeout exception.

Here's the inner exception message:
"Write not completed. This error indicates that it could not be verified that the requested write operation was completed during the timeout period. It is possible that the write operation will actually succeed or fail, but later. Increase the timeout period if you want to obtain positive or negative indication of the operation outcome. Other reason for this error may be that under heavy loads, topic request or response queue is overflowing. Check the event log for queue overflow errors (if event logging is supported by the product and enabled)."

In Debug it works fine, but when I build it for release and install it (as a network service), then this issue comes up.

Thank you for your time.

*******EDITED******
Just got it working again. It turns out I hadn't done the appropriate DCOM configuration. And yes, I had to release it as LocalSystem Service. All is well now.
Hope someone finds this useful.
Last edit: 06 Dec 2014 08:50 by berisha.rinori.

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

More
05 Dec 2014 08:36 #2539 by support
Replied by support on topic COM Exception
Oh, I am glad it is resolved, thanks for letting me know.

It is funny, because I have actually looked up a documentation to your server and "verified" the correctness of the ProgID - but have not noticed the typo either.

Best regards

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

More
05 Dec 2014 07:49 #2538 by berisha.rinori
Replied by berisha.rinori on topic COM Exception
Hello,

The problem was the one you pointed out, the name of the OPC server actually was "CyProOPC.DA2" not "CyBroOPC.DA2".

Thank you or you time.

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

More
04 Dec 2014 21:14 - 04 Dec 2014 21:15 #2536 by berisha.rinori
Replied by berisha.rinori on topic COM Exception
Yes, I have used the same approach many times and it has always worked fine (great product btw).

The machine I'm coding (and testing) is 64bit, and in visual studio the platform I have targeted is "Any CPU", not 32bit or 64bit specifically.
In fact, I just tested it by targeting 32bit and 64bit platforms, and still the same.

I'm trying to make a windows service to subscribe to tags, could this have anything to do with it?

Thank you for you time.
Last edit: 04 Dec 2014 21:15 by berisha.rinori.

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

More
04 Dec 2014 20:11 #2534 by support
Replied by support on topic COM Exception
Thank you for the details.

Does the same ProgID work from other OPC clients?
Is this on a 64-bit system? If so, are you running your service in a 64-bit process, or in a 32-bit process?

Best regards

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

More
04 Dec 2014 16:48 - 04 Dec 2014 16:51 #2532 by berisha.rinori
Replied by berisha.rinori on topic COM Exception
Thank you for the fast reply.

Here's the line for subscribing:

OPCClient.SubscribeItem("", "CyBroOPC.DA2", "CyBro-2.12345.cybro_qx00", 1000, tagc);


where 'tagChanged' is the callback method. Of course this is just a test code line I used to quickly check if everything is OK.

The OPC server i local, here "" for the machine name.
"CyBroOPC.DA2" is the name of the OPC server.
"CyBro-2.12345.cybro_qx00" is the tag
1000 is the refresh rate.

Any ideas?
Last edit: 04 Dec 2014 16:51 by berisha.rinori.

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

More
04 Dec 2014 16:32 #2530 by support
Replied by support on topic COM Exception
The initial subscription call always succeeds - as long as there is no programming error such as null argument. The error you are getting has to do with connection to the OPC server, and those are reported through the notification mechanism.

The error most likely means that the ProgID used to identify the OPC server (in the SubscribeXXXX call) does not correspond to any OPC server on the target computer.
  1. Which OPC Server are you trying to subscribe to?
  2. Is the server local or remote?
  3. What ProgID are you using?
  4. Can you post the piece of code that calls SubscribeXXXX (including the part that fills in its arguments)?

Best regards
The following user(s) said Thank You: berisha.rinori

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

More
04 Dec 2014 15:56 #2529 by berisha.rinori
COM Exception was created by berisha.rinori
Greetings everyone,

I'm developing a Windows Service, which will have a single EasyDAClient for subscribing/writing/reading from/to the OPC Server.
When I try to subscribe, the subscription is done without any error, but when it calls the callback method, I get the following error:
"[12585987] *** System.Runtime.InteropServices.COMException (0x8004001F3): Invalid class string"

Can anyone tell whats is this error related to? And how could I remedy the situation here?

Thank you in advance,
Rinor Berisha

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

Moderators: support
Time to create page: 0.096 seconds