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.

EasyUAClient.Read o ReadValue returns null instead Subscription returns a value

More
21 Jan 2021 21:04 #9352 by support
I have not checked it explicitly, but it should be versions around 2016 as well. Either identical, or just with slightly different names/placements of properties.

Beware that "AcceptAnyCertificate" should be set to true only for development/testing. It creates a security hole.
The proper way would be to make the client trust the server certificate by storing it into the proper certificate store.

See opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...%20Instance%20Certificate.html .

The most common way of doing it is finding the server certificate in RejectedCertificates , and copying it to trusted peers ("UA Applications") store.

Also: opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...html#Certificate%20Stores.html

Best regards

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

More
21 Jan 2021 16:01 #9351 by sistemi@resdata.it
I've found how to resolve using latest versione of quickopc
 EasyUAClient.SharedParameters.EngineParameters.CertificateAcceptancePolicy.AcceptAnyCertificate = true;
 
            UAEndpointDescriptor endpointDescriptor =
                "opc.tcp://ews1:50314/ToshibaOpcUa/DataAccessServer";
 
            endpointDescriptor.EndpointSelectionPolicy = new OpcLabs.EasyOpc.UA.Engine.UAEndpointSelectionPolicy()
            {
                AllowZeroSecurityLevel = true,
                AllowedMessageSecurityModes = OpcLabs.EasyOpc.UA.Engine.UAMessageSecurityModes.All
            };

The question is: is this functionality available on QuickOpc 2016 libraries version?

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

More
21 Jan 2021 14:40 #9350 by sistemi@resdata.it
It works!
But now a new problem occurs: we use Opc libraries version 2016, so the call to Read method is slightly different
This is my code
 UAAttributeArguments arg = new UAAttributeArguments();
                            arg.EndpointDescriptor = endpointDescriptor;
                            arg.NodeDescriptor = nodeDescriptor;
 
                            UAReadArguments uARead = new UAReadArguments(arg, UAReadParameters.FromDevice);
                            UAAttributeData attributeData = clientUA.Read(uARead);
but I don't think this can be a problem.
The problem is that we receive an error related to Untrusted Certificate and I don't know how to resolve.
In the demo code example the application recognize the untrusted certificate and ask me to continue but I don't understand how to accomplish this in my code.

regards
JZ

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

More
21 Jan 2021 11:54 #9349 by support
Thank you for the additional information.

The reason might be that the default parameters for Read specify reading from cache. First thing to do is to change it to read from the device. In our original example, the modified line would look like this:

attributeData = client.Read(new UAReadArguments(endpointDescriptor, "nsu=http://test.org/UA/Data/;i=10853", UAReadParameters.FromDevice));
Best regards

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

More
21 Jan 2021 11:09 #9348 by sistemi@resdata.it

support wrote: Hello,

I have some additional questions:

1. Please confirm that you are seeing this both with our demo client, *and* with your own code.

2. Can you describe the sequence of OPC operations that you program does before it gets to the problematic Read? For example, is this actually the very first operation made on the target server, or are there other operation before it? If there are more operations, how long (very roughly) is the time delay between the first operation, and the problematic Read? (is it almost immediate, or maybe several seconds, or much longer?). The reason I am asking is that I want to know whether the Read follows quickly after establishing the connection, or significantly later.

Best regards


1. Yes
2. first attachment is your demo code with the exact endpoint and nodeid used to query the data
second attachment is the output of your demo code: attributedata is a valid object but value property is always empty/null

regards
JZ
Attachments:

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

More
21 Jan 2021 11:01 #9347 by support
Hello,

I have some additional questions:

1. Please confirm that you are seeing this both with our demo client, *and* with your own code.

2. Can you describe the sequence of OPC operations that you program does before it gets to the problematic Read? For example, is this actually the very first operation made on the target server, or are there other operation before it? If there are more operations, how long (very roughly) is the time delay between the first operation, and the problematic Read? (is it almost immediate, or maybe several seconds, or much longer?). The reason I am asking is that I want to know whether the Read follows quickly after establishing the connection, or significantly later.

Best regards

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

More
21 Jan 2021 10:21 #9346 by sistemi@resdata.it
Hi,
we have a very simple UA client (like example demo code) that must read tag values from an opcserver.
Even when using demo application provided with QuickOpc installation, we're able to read values only when using "subscription" to a specified tag.
Instead when we try the read functions we receive a valid response with Status good and timestamps but a null value.
(see image in attachment)

Can anyone explain this behavoir?

If we use an other opc client like UA-Expert we're able to read single values and subscriptions.

Thanks
JZ
Attachments:

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

Moderators: support
Time to create page: 0.226 seconds