OPC UA Get node attributes by Node Id

Hi everyone,

I've been working on a project where I need to read the BrowseName attribute of OPC-UA nodes directly from Ignition scripting, knowing only the NodeId.

After some investigation, I found out that system.opc.readValue() is hardcoded to request attribute id=13 (the Value attribute), so there is no built-in way to read other OPC-UA attributes like BrowseName (id=3) or DisplayName (id=4) directly from Jython.

I have already opened a feature request asking for a system.opc.readAttribute(serverName, nodeId, attributeId) function, but in the meantime I was wondering:

  • Has anyone faced the same issue?
  • Is there a workaround to read attributes other than Value from Jython that I might have missed?
  • Has anyone found a way to access Milo's Java classes directly from Jython inside Ignition?

Any suggestion is welcome. Thanks in advance!

This has been discussed as desirable, but there's no timeline. Or even a promise to do this. Consider making a formal feature request at the Ideas Portal, link it here, and I'll vote for it.

I’ve always wanted to add system.opcua.readAttribute and system.opcua.writeAttribute, but even with its status as something of a wishlist item of mine, it hasn’t been able to claw its way into this world.

I think in part because the reality of the implementation is it will be ugly, like the BACnet read/write raw scripting functions, where Milo types have to be injected into the system.opcua namespace so they can be referenced by scripts using these functions, particularly writeAttribute.

1 Like

You can find the feature request Here.

Thanks!

I see — I hope this is something that might be introduced in the future.

As mentioned in the post, is there currently any way to access Eclipse Milo classes directly from within Ignition scripting, without having to implement a separate library or develop a custom module?

No, there's not. Modules are loaded in their own class loaders that make their classes unavailable to general Ignition platform scripting, which is why the feature would require the ugly injection of Milo types into system.opcua so they can be referenced.

So I just have one final question. My goal is to read the BrowseName of a node when I only know its NodeId.

Is there any way to achieve this using built-in Ignition functions, without having to recursively browse the entire server starting from the root?

In my case, the node is located under ObjectTypes, which cannot be browsed from Ignition because it does not contain any Variables, Objects, or Methods.