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 .NET
- Reading, Writing, Subscriptions, Property Access
- MonitoredItemChanged event after reconnection
MonitoredItemChanged event after reconnection
What happens is that the before the actual client session to the server can be established, a proper server endpoint needs to be selected. Even if you specify a full URL as the endpoint, there still may be multiple OPC-UA endpoints there, differing by the security profile and other characteristics. The client calls the GetEndpoints service, and - among other information - receives again a URL with each endpoint. The host name in the URL should match the host name that is in the server certificate. This was not the case - the endpoint was returned with 127.0.0.1, but the server certificate was for adid-win7.contel.co.il. This is why the warning is issued, it may be a spoofing scenario. You should be able to fix it on the server side - by reconfiguring the server perhaps.
On our side, you can turn off this check in UAClientSessionParameters.CheckEndpointDomain, e.g.:
EasyUAClient.AdaptableParameters.Session.CheckEndpointDomain = false;
There are other "checks" that, for interoperability reasons, we do not really like, but are required by the OPC compliance program. For this reason, we have created a pre-made groups of settings that you can use. I suggest that you pick the more "interoperable" settings, all at once, like this:
EasyUAClient.AdaptableParameters = EasyUAAdaptableParameters.Interoperability;
Before we release the new version, the settings tailored for interoperability may actually become the default, but right now we have to prove that we are able to be fully OPC compliant, so the current "out-of-the-box" behavior corresponds to this:
EasyUAClient.AdaptableParameters = EasyUAAdaptableParameters.OpcCompliance;
Best regards
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
but i still got message : OPC-UA Endpoint Domain mismatch :
Endpoint URL as returned by the server : opc.tcp://127.0.0.1:49320/
The Server certificate is for following domain names or ip addresses : adid-win7.contel.co.il
where 127.0.0.1 = adid-win7.contel.co.il
why i get this message ?
Please Log in or Create an account to join the conversation.
Below is my reply again, now with code examples.
You can either:
- Influence it statically for all not-isolated client objects by working with the static EasyUAClient.AdaptableParameters.
EasyUAClient.AdaptableParameters.Session.CertificateAcceptancePolicy.AcceptAnyCertificate = true;
- Or, if you set the instance-specific EasyUAClient.Isolated to 'true', you can then influence these parameters on per-instance basis, in EasyUAClient.IsolatedAdaptableParameters.
var client = new EasyUAClient(); client.Isolated = true; client.IsolatedAdaptableParameters.Session.CertificateAcceptancePolicy.AcceptAnyCertificate = true;
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
i think you mean :
EasyUAAdaptableParameters.Default.Session.CertificateAcceptancePolicy.AcceptAnyCertificate = true;
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
It is now in EasyUAAdaptableParameters.Session.CertificateAcceptancePolicy.AcceptAnyCertificate .
You can either:
- Influence it statically for all not-isolated client objects by working with the static EasyUAClient.AdaptableParameters.
- Or, if you set the instance-specific EasyUAClient.Isolated to 'true', you can then influence these parameters on per-instance basis, in EasyUAClient.IsolatedAdaptableParameters.
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
how i can accept any certificate in the new beta version 5.23 ?
in the old version i was written :
EasyUAClient.EngineParameters.CertificateAcceptancePolicy.AcceptAnyCertificate = true;
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
i also forgot to mention that i use the assemplies in my program that i can run as WinForm ( for debug mode only ) and as Windows Service.
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
- adid@contel.co.il
- Offline
- Platinum Member
- Posts: 106
- Thank you received: 0
first of all thank you for your answer.
i used the new beta version 5.23 and now the event is raising after reconnection attemp.
also your comments help.
thank you,
Adi Damty
Please Log in or Create an account to join the conversation.
I do not have enough information to determine what is the reason, in this particular case, why the MonitoredItemChanged has not been raised. I suggest that you download and install a Beta of the new version (5.23), which we haven't published yet - because there have been significant changes in the resiliency area. The 5.23 Beta is here: www.opclabs.com/files/downloads/QuickOpc/5.23/QuickOPC%205.23.exe .
Possibly related - or unrelated - comments:
- The way you use your i_TransactionInfo object between the SubscribeMonitoredItem call, and the event handler, will only work well if you have just one monitored item. For more than one, you will need to find a way to identify the monitored item and find "your" related information inside the handler. This is usually done by passing the "state" argument to SubscribeMonitoredItem, and then using it from inside the event handler.
- I find it a bit weird that inside the event handler, you are not using any of the actual information available in the notification - such as the item value. But maybe it was meant just as an example.
Please Log in or Create an account to join the conversation.
Sent: Sunday, November 10, 2013 4:14 PM
To: Zbynek Zahradnik
Subject: FW: OPC UA
Hello,
I listen to data change event ( the tag is in another computer at the network ) and all is working fine.
Then I disconnect the network and reconnect again, and then I expected the data change event to raise again after some time and this doesn't occurred.
As I remember you said you support raise the event again when the connection is back, so what I am doing wrong ?
Here is my code :
m_EasyUAClient.MonitoredItemChanged += delegate
{
m_TransactionNamesQueue.Enqueue(i_TransactionInfo.TransactionName);
};
m_EasyUAClient.SubscribeMonitoredItem(
i_TransactionInfo.OpcServerUrl,
nodeId,
i_TransactionInfo.ScanRateSeconds.Value * 1000);
i_TransactionInfo.OpcServerUrl = opc.tcp://XXXX:49320
nodeId = nsu=KEPServerEX;s=Channel1.Device1.Tag1
i_TransactionInfo.ScanRateSeconds.Value = 1
A.
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Reading, Writing, Subscriptions, Property Access
- MonitoredItemChanged event after reconnection