Coder Social home page Coder Social logo

Comments (8)

awcullen avatar awcullen commented on June 6, 2024

The samples in this repo are using the latest 2.0.0* pre-release versions.

Do you like the new api? I am looking for feedback before "officializing".

from opc-ua-samples.

tejasklodha avatar tejasklodha commented on June 6, 2024

@awcullen ... New version is very good and also easy to understand....

I m using it without any issue....

Tejas Lodha

from opc-ua-samples.

abrasat avatar abrasat commented on June 6, 2024

Does the new version support also ExpandedNodeIds as MonitoredItemAttributes ?

from opc-ua-samples.

abrasat avatar abrasat commented on June 6, 2024

I have an application where I used the UaTcpSessionClient and the Subscribe() method to register the monitored items from a ViewModel. What is the equivalent code with the new opc-ua client version, as UaTcpSessionClient does not exist anymore?

Also for the UaTcpSessionClient I selected "manually" which endpoint to connect (I did not want to always have the "default" one with the highest security)

    // discover available endpoints of server.
     var getEndpointsRequest = new GetEndpointsRequest
      {
            EndpointUrl = this.discoveryUrl,
             ProfileUris = new[] { TransportProfileUris.UaTcpTransport }
      };
      this.logger.LogDebug($"Discovering endpoints of '{getEndpointsRequest.EndpointUrl}'.");
      var getEndpointsResponse = UaTcpDiscoveryClient.GetEndpointsAsync(getEndpointsRequest).Result;
      var selectedEndpoint = getEndpointsResponse.Endpoints.OrderByDescending(e => e.SecurityLevel).Last();

      this.session = new UaTcpSessionClient(
          new ApplicationDescription()
          {
            ApplicationName = "AlarmUI",
            ApplicationUri = $"urn:{System.Net.Dns.GetHostName()}:OpcUa.AlarmUI",
            ApplicationType = ApplicationType.Client
          },
          new DirectoryStore(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "pki"),
              loggerFactory: this.loggerFactory),
          this.ProvideUserIdentity,
          selectedEndpoint,
          this.loggerFactory);

How can all the available endpoints be discovered with the new opc-ua client ? How can be selected the endpoint to be used in the session, without having the UaTcpSessionClient ?
In my application I have for instance only the discovery url, and want to open a session to the endpoint with the lowest security.

from opc-ua-samples.

abrasat avatar abrasat commented on June 6, 2024

What exactly is the meaning of/difference between the requestedUrl and the endpointUrl parameters from the Map() method in UaApplicationBuilder ?

I also debugged the MobileHmi.Droid application, and after the creation of the UaApplication the MappedPoints contain one MappedPoint record. In the EndpointDescription for this one record only the EndpointUrl is set ("opc.tcp://10.0.2.2:26543"), the other properties (SecurityLevel, SecurityMode, SecurityPolicyUri, ...) are either 0, null or invalid.
The Map() method does definitely not seem to work correctly if the parameter SecurityPolicyUri is set (for example to "http://opcfoundation.org/UA/SecurityPolicy#None").
And if not set, the caller cannot take any influence on which endpoint is chosen at the endpoint discovery. Can you please take a look at this ?

from opc-ua-samples.

awcullen avatar awcullen commented on June 6, 2024

In the MobileHmi sample, I added:

.Map("opc.tcp://localhost:26543", "opc.tcp://10.0.2.2:26543")

That was because I wanted requests for "opc.tcp://localhost:26543" to be directed to "opc.tcp://10.0.2.2:26543".
(There is also a version that takes a config file, see sample RobotHmi).
If you don't set the SecurityPolicyUri, then the endpoint will be selected with the highest security.
If you also set SecurityPolicyUri (for example to "http://opcfoundation.org/UA/SecurityPolicy#None"), then you will find that the endpoint selected will be restricted to only endpoints with "None" security.
In your case, maybe the 'None' security was turned off at the server?

from opc-ua-samples.

abrasat avatar abrasat commented on June 6, 2024

With redirection you mean some kind of routing mechanism ?
With the 1.5.12 release and UaTcpSessionClient I can connect to the "None" security endpoint. The problems occur only with the 2.0.0 prerelease.
What parameters should be put in the Map() call if I want to access directly (without any redirection) a server with the address "opc.tcp://192.168.1.1:4444" and connect to the endpoint with the SecurityPolicyUri "http://opcfoundation.org/UA/SecurityPolicy#None" ?
Where/how can be set the values for SecurityLevel, SecurityMode, SecurityPolicyUri ? Actually they dont seem to be set correctly.

from opc-ua-samples.

awcullen avatar awcullen commented on June 6, 2024

You could use:

                .Map("opc.tcp://192.168.1.1:4444", "opc.tcp://192.168.1.1:4444", SecurityPolicyUris.None)

from opc-ua-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.