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.

Reg OPC UA client connection to Anaymous OPC UA server

More
21 Oct 2021 05:34 #10273 by support
Hello.

I do not see any obvious problem in your code. Note that in most cases, specifying no identity is the same as specifying the anonymous identity, and thus the .WithAnonymousIdentity() call is not even needed.

But, I do not quite understand what is the reason behind your post. Does the code work for you as expected? If so, then it is probably correct. If it does not, what are the symptoms of the problem?

Best regards

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

More
20 Oct 2021 17:37 - 21 Oct 2021 05:31 #10272 by aksenthil
Dear Team,

I developed OPC UA Client using OPC Labs QUICK OPC Tools.


the OPC UA server configuration as below

endpoint : opc.tcp://OPCUASVRPC:26080/UA/FlsOPCServer

security: None

identity: Anonymous


here is my OPC UA Client code
FileObj.LogWriter($"Creating end point descriptor with anonymous identity");
 
UAEndpointDescriptor endpointDescriptor =
   ((UAEndpointDescriptor)"opc.tcp://OPCUASVRPC:26080/UA/FlsOPCServer")
  .WithAnonymousIdentity();
 
var client = new EasyUAClient();
 
UANodeDescriptor[] UANodeDescriptorList = new UANodeDescriptor[GloabalVariables.TagCollection.Count];
 
FileObj.LogWriter($"Creating EndNode descriptor");
 
for (int i = 0; i < UANodeDescriptorList.Length; i++)
    UANodeDescriptorList[i] = "ns=2;s=" + DomainName + GloabalVariables.TagCollection[i];
 
ValueResult[] ValueResultArray1 = client.ReadMultipleValues(endpointDescriptor, UANodeDescriptorList);
 
foreach (ValueResult valueResult in ValueResultArray1)
{
    if (valueResult.Succeeded)
    {
        Console.WriteLine("Value: {0} - {1}", GloabalVariables.TagCollection[k], valueResult.Value);
        GloabalVariables.ItemBuffer.Add(GloabalVariables.AliasCollection[k]);
        GloabalVariables.ValueBuffer.Add(valueResult.Value);
    }
    else
    {
        Console.WriteLine("*** Failure: {0}", valueResult.ErrorMessageBrief);
    }
}
 

Would you please confirm for me, is this code is enough for communicating with the Anonymous OPC UA Server?

If I Missed out on anything, please share the details to communicate with the OPC server with anonymous.

with regards,
senthil
Last edit: 21 Oct 2021 05:31 by support. Reason: code formatting

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

Moderators: support
Time to create page: 0.043 seconds