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.

MonitoredItemChanged event after reconnection

More
14 Nov 2013 07:53 #1548 by support
This warning is a requirement of OPC Compliance certification we are going through (Err-006 under GetEndpoints).

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
The following user(s) said Thank You: adid@contel.co.il

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

More
13 Nov 2013 14:52 #1547 by adid@contel.co.il
ok, thank you.

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.

More
13 Nov 2013 14:31 #1546 by support
No. Your code has no effect, because it creates a new instance of the parameters, with default values, sets the value, and then throws the instance away. It does not "go" into the EasyUAClient, where it belongs and has some effect - it is just manipulating an in-memory value that is not interpreted further.

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;
The following user(s) said Thank You: adid@contel.co.il

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

More
13 Nov 2013 09:18 #1544 by adid@contel.co.il
hello,

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.

More
13 Nov 2013 08:06 #1541 by support
The parameter has moved - I think it is described in the What's New document.

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.
Best regards
The following user(s) said Thank You: adid@contel.co.il

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

More
11 Nov 2013 13:04 #1536 by adid@contel.co.il
hello,

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.

More
11 Nov 2013 12:54 #1535 by adid@contel.co.il
hello,

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.

More
11 Nov 2013 12:52 #1534 by adid@contel.co.il
hello,

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.

More
11 Nov 2013 08:01 #1531 by support
After the reconnection attempt, the component should be raising the MonitoredItemChanged event IF the reconnection fails, or if it succeeds and the server sends us the notification - we cannot "make it up".

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.
The following user(s) said Thank You: adid@contel.co.il

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

More
11 Nov 2013 07:49 #1530 by support
From: A.
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
thank you,
A.

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

Moderators: support
Time to create page: 0.149 seconds