Code Monkey home page Code Monkey logo

Comments (11)

oroulet avatar oroulet commented on July 19, 2024

We only export custom namespaces, not 0 and freeopcua s. But I remember writing code so freeopcua namespace is not created, and exporting everything over 1 not. 2…..... Did you read old code?

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

I have latest code. It is still exporting NS 2; must be a bug.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

Should be fixed with d8ea8ea

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

This requires a fix in python-opcua. If my custom address space is in NS=1 it moves everything to NS=2 when importing for some reason?

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

From xmlparser.py:

elif name == 'NamespaceUris':
                for ns_index, ns_element in enumerate(child):
                    ns_uri = ns_element.text
                    ns_server_index = self.server.register_namespace(ns_uri)
                    self.namespaces[ns_index + 1] = (ns_server_index, ns_uri) # WHY ADD 1???

See comment, why do we always add 1?

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

That is because you have different URIs, if index point to another Uri then
we increase index. I do not know how robust code is, so there might be bugs

On Sun, Oct 9, 2016, 19:12 Andrew [email protected] wrote:

This requires a fix in python-opcua. If my custom address space is in NS=1
it moves everything to NS=2 when importing for some reason?


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#17 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfziIc-i4U5-p71-ONIAwZlz5Zhqe_ks5qySBggaJpZM4KRetv
.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

I see now. The problem is that in python-opcua NS=1 is still consumed by "urn:freeopcua:python:server". I think the server should be NS=0?
image

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

modeler should not export that, i thought i fixed that

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

It isn't created in modeler, it's created in default server code.

server.py init():

self.application_uri = "urn:freeopcua:python:server"

# setup some expected values
        self.register_namespace(self.application_uri)
        sa_node = self.get_node(ua.NodeId(ua.ObjectIds.Server_ServerArray))
        sa_node.set_value([self.application_uri])

So I guess it's actually my fault for not understanding how the namespaces work. User needs to setup server properly, and if user is importing address space from XML they need to make sure the namespaces match/are setup properly.

Thanks for the responses, sorry if I wasted your time.

from opcua-modeler.

oroulet avatar oroulet commented on July 19, 2024

Yes but we remove it at startup in modeller..

On Sun, Oct 9, 2016, 20:01 Andrew [email protected] wrote:

It isn't created in modeler, it's created in default server code.

server.py init():

self.application_uri = "urn:freeopcua:python:server"

setup some expected values

    self.register_namespace(self.application_uri)
    sa_node = self.get_node(ua.NodeId(ua.ObjectIds.Server_ServerArray))
    sa_node.set_value([self.application_uri])

So I guess it's actually my fault for not understanding how the namespaces
work.

Thanks for the responses, sorry if I wasted your time.


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#17 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACcfzrgeOW2lny1QIzc52_4-dY-biZiAks5qySwRgaJpZM4KRetv
.

from opcua-modeler.

zerox1212 avatar zerox1212 commented on July 19, 2024

Modeler works, but then I was importing the XML from modeler into another server application that still had default code.

from opcua-modeler.

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.