register_nodes / unregister_nodes
register_nodes The service registers the client's frequently used NodeId on the server, and the server returns a temporary, high-performance NodeId (lifetime = Session). Subsequent read/write operations MonitoredItem directly use this temporary ID. The amount of savings NodeId achieved by using the temporary ID compared to the original depends on the server implementation; please test this based on your server's actual performance.
- One-time script → Not necessary
- Long-term operation with high-frequency access to the same node → Highly Recommended
- Large-scale, continuous SCADA 1000+ Tag monitoring → Must
Signature
def register_nodes(self, node_ids: List[str]) -> List[Optional[str]]: ...
def unregister_nodes(self, registered_node_ids: List[str]) -> StatusCode: ...
The returned temporary NodeId list corresponds to the order of the input parameters; the failed slot is None.
Usage
# 1. Register when the app starts
orig = [
"ns=2;s=Plant.Line1.Sensor.Temperature",
"ns=2;s=Plant.Line1.Sensor.Pressure",
"ns=2;s=Plant.Line1.Sensor.FlowRate",
]
temp = ua.register_nodes(orig)
# "temp" is currently a temporary value provided by the server ID, similar to ["i=99001", "i=99002", "i=99003"].
# 2. Use a temporary one for subsequent frequent visits ID
for _ in range(10000):
with ua.read(temp[0]) as dv:
# Use a temporary variable for reading ID ; do not pass the original string NodeId
pass
# 3. Release before the app exits
ua.unregister_nodes([t for t in temp if t])
When to Use
| Scenario | Necessity |
|---|---|
| Single-run script, 100 nodes | Low (cost savings are negligible) |
| Long-term operation, frequent access to the same node | High |
| Large-scale SCADA, 1000+ tags, continuous monitoring | High |
Where do the revenues come from?
The server assigns NodeId a temporary NodeId, high-performance identifier to registered users; subsequent read/write operations use this identifier directly MonitoredItem, eliminating the need for a full NodeId resolution step. The extent of the benefit depends on the server implementation, SDK No promises regarding the gear ratio — You can only expect to see benefits in scenarios involving "frequent access to the same set of nodes." Please base your assessment on actual tests conducted on your server.
Note
- Temporary IDLifecycle = Session —— Once you've disconnected, you shouldn't use it anymore.
- After the session reconnects
register_nodes, please start over; do not continue using the old temporary ID. - Explicitly release
unregister_nodesit after use; please also manually release it once before closing the application.