Reading OPC tags folder through system.opc.browse

Hello, I have a Tani OPC server connected to a Siemes PLC, here is a screenshot of what I see from the Ignition’s OPC browser:


I need to list the tags inside the AcMotors folder using the system.opc.browse function. I tried with this statement:

system.opc.browse(opcServer=‘Tani_OPC’, opcItemPath=‘ns=1;s=MAIN_PLC.DataBlocks.AcMotors.*’)

but the call raises a timeout exception after a while. The string “ns=1;s=MAIN_PLC.DataBlocks.AcMotors” is what I get from the OPC browser opction “copy item path”.
The syntax should be correct, because a similar statement works on the Ignition OPC UA Server:

system.opc.browse(opcServer=“Ignition OPC UA Server”, opcItemPath=“ns=1;s=VendorServerInfo.*”)

so why it doesn’t work on the Tani OPC? I would try to use browseServer, but how to format the nodeId parameter in my specific case?
Many thanks in advance,

The NodeId parameter for the browseServer call would be ns=1;s=MAIN_PLC.DataBlocks.AcMotors. It will return only on the nodes directly underneath this node.

For OPC tags from OPC UA servers the OPC Item Path is always a NodeId in the parseable string format you see there.

I’m not sure why the system.opc.browse call times out, though. It’s possible the hierarchy is too deep or there is a loop, but I’m not sure with the just the information provided.

Many thanks, this one worked for me :slight_smile: