Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot properly set browseName for a folder in the server node #731

Open
jhooney opened this issue Sep 11, 2024 · 4 comments
Open

Cannot properly set browseName for a folder in the server node #731

jhooney opened this issue Sep 11, 2024 · 4 comments

Comments

@jhooney
Copy link

jhooney commented Sep 11, 2024

I am trying to create a folder with a browseName that is different from its nodeId to match the structure of a server that I have running on a plc (running on codesys on the RIO from Opto22).
There seems to be two intended ways to set a browseName of a node, either send a message in the form a:

{
    payload: { "opcuaCommand": "addFolder" },
    topic: "ns=4;s=Sub_Folder1;browseName=Sub1"
}

or b:

var msg2 = {
    payload: { "opcuaCommand": "addFolder" },
    topic: "ns=4;s=Sub_Folder2;b=Sub2"
}

The behavior I am looking for is that the NodeID becomes ns=4;s=<folder-name> and the browseName becomes the browseName component. If I use method a the nodeId becomes ns=4;s=Sub_Folder1, but the node's browseName does not change, and if I use method b the nodeId becomes ns=4;s=Sub_Folder2;b=Sub2, but the browseName does change successfully. Here is what each folder looks like when viewed in UaExpert:
image
image

Both methods get close to the functionality I'm looking for but seem to not fully implement a browseName. I'm not sure if this is a bug, or if there is another way to set browseName that I am missing. Seems like it is probably a simple fix, if I get some free time I'll try to submit a PR but pretty booked up for awhile.

Here is a flow I made to demonstrate:
setFolderBrowseNameFlow.json

@mikakaraila
Copy link
Owner

In my code there is format example, but I will study why it does not set browseName correctly... your test case looks OK.

// format is msg.topic="ns=1;s=Main.Test;browseName=Test"

@mikakaraila
Copy link
Owner

Small change and seems to work:
image

@jhooney
Copy link
Author

jhooney commented Sep 12, 2024

Interesting, it seems that browseName can be set when namespace = 1 but not when namespace = 4. I did a little more testing, looks like it also fails when namespace is 2 or 3.

@mikakaraila
Copy link
Owner

Thanks, I will look and make a fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants