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.
- Forum
- Discussions
- QuickOPC-Classic in COM
- OPC Alarms&Events
- E_NOINTERFACE returned when AcknowledgeCondition called from a different thread.
E_NOINTERFACE returned when AcknowledgeCondition called from a different thread.
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.
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.
Thank you
Please Log in or Create an account to join the conversation.
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.
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.
Are you observing this with in-process or out-of-process EasyOPC component?
Please Log in or Create an account to join the conversation.
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.
- Forum
- Discussions
- QuickOPC-Classic in COM
- OPC Alarms&Events
- E_NOINTERFACE returned when AcknowledgeCondition called from a different thread.