Read all OPC tags from server (8.1)

If I want to, for all OPC tags in all tag providers currently in use in a gateway, get the tag path and value, and save that to a file, is there a trivial way to do that or does it involve parsing through every tag?

(Put another way, is there an obvious way to say ‘for each ignition OPC server connection, note the values and structure of that server to a file’)

I can do the obvious thing and just find all the OPC server connections, and then recursively read-query every connected server, but I’m wondering if there’s some known primitive for this

These are very different things. You should not have created an OPC tag for every Node in every Server you are connected to...

2 Likes

For Kevin's (A), you can call system.tag.query() against each tag provider with a filter that selects OPC tags, and request the return of the .value property.

For Kevin's (B), you can use system.opc.browse*() to enumerate OPC nodes (item paths) and then call system.opc.readValues(). But note that many devices within OPC servers do not expose all possible nodes to OPC browse. There simply is no solution for that.

1 Like