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.

E_NOINTERFACE returned when AcknowledgeCondition called from a different thread.

More
22 Nov 2011 19:46 #652 by support
I do not see a problem with how you described your code.
I have created a C++ program her that does comparable thing, and it works well - i. e. I could not reproduce the problem. This is with our "kit" OPC Server. I am actually calling the AcknowledgeCondition from the event handler, which is on other thread as well.
Questions:

Have you tried to call some other method, besides acknowledgement (something harmless - e.g. querying for categories)? Does it work, or does it also give the same error?
Can you try your code against our server? If so, how does it behave?
Are you calling CoInitializeEx with proper arguments (most likely, for "free threading") on beginning of each thread that you use?

Note:
The AcknowledgeCondition method is quite sensitive, besides other things, to the proper value of the ActiveTime parameter - it must match the time earlier obtained from the corresponding event notification. If improper ActiveTime was the problem, however, an expected error code would be E_INVALIDARG.
Would it also be possible that you send me (parts of) your code - for quick check whether I do not quickly "spot" some obvious problem?

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

More
22 Nov 2011 13:41 #646 by support
Hi,

It is E_NOINTERFACE that is returned.

To clarify the functionality in my code, in each thread I make a new “instance” of the easyOPC interface since I get a marshall error if I try to use the same EasyOPC pointer in both threads.

Best regards
J.

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

More
21 Nov 2011 20:22 #642 by support
Hello, just to confirm, is the error you are getting precisely the E_NOINTERFACE (0x80004002), or isn't it one of our own, similar error codes (such as 0xC004902F), and what is the error message associated?
Thank you

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

More
17 Nov 2011 15:09 #625 by support
Hello.

Yes, out-of-process ("Local Server") is the default, and if you are seeing a separate process for EasyOPC in the Task Manager, it confirms this setting. I have asked about this because there are differences in threading-related issues between the two settings, so I need to know which one to look at first.

Best regards,

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

More
17 Nov 2011 15:08 #624 by support

From: J.
Sent: Thu 11/17/2011 2:30 PM
To: Zbynek Zahradnik
Subject: RE: Ang.: How to check OPC Server Status?





Hi,

I have not made any changes to any settings for in or out of process so what is the default? I think it runs as out of process since I see the easyopc process in Task manager.

Thanks for the quick reply
Best regards
J.

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

More
17 Nov 2011 15:06 #623 by support
The issue with acknowledging from a different thread looks like something that we should support but does not work. I will have a look at it and if it is a bug, we will provide a fix. Please allow some time for the investigation.

Are you observing this with in-process or out-of-process EasyOPC component?

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

More
17 Nov 2011 15:05 #622 by support
From: J.
Sent: Thu 11/17/2011 2:11 PM
To: Zbynek Zahradnik
Subject: RE: Ang.: How to check OPC Server Status?




Hi Zybnek,

[.....]

I have [.....] found a little problem that I hope that you can help me with. I have two threads, in one I will create an event subscription that collects alarms and events (it works great). In the other thread I will monitor another system that will acknowledge alarms, ie calls the AcknowledgeCondition interface. When the application calls the AcknowledgeCondition interface it will return a E_NOINTERFACE result. If I run the interface in the thread where the subscription is setup it works fine.

Do you have any suggestions on how to solve the problem?

Best regards
J.

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

Moderators: support
Time to create page: 0.063 seconds