RegisterNodes / UnregisterNodes
RegisterNodes The service registers the client's frequently used NodeId with the server, and the server returns a temporary, high-performance NodeId (lifetime = Session). Subsequent Read / Write / operations use this temporary ID directly MonitoredItem. The amount of savings NodeId achieved by using the temporary ID compared to the original depends on the server implementation; please test this with your server.
- One-time script → Not necessary
- Long-term operation with high-frequency access to the same node → Recommendations
- Large-scale, continuous monitoring of thousands SCADA of tags → Recommendations
Signature
public IReadOnlyList<string> RegisterNodes(IReadOnlyList<string> nodeIds);
public StatusCode UnregisterNodes(IReadOnlyList<string> registeredNodeIds);
Usage
// 1. Register when the app starts
var orig = new[]
{
"ns=2;s=Plant.Line1.Sensor.Temperature",
"ns=2;s=Plant.Line1.Sensor.Pressure",
"ns=2;s=Plant.Line1.Sensor.FlowRate",
};
var fast = ua.RegisterNodes(orig);
// `fast` is the same length as `orig` and has the same order; each element is a temporary string ID provided by the server (the format is determined by the server).
// 2. Use a temporary one for subsequent frequent visits ID
for (int i = 0; i < 10000; i++)
{
using var dv = ua.Read(fast[0]);
// Use a temporary read ID ; do not pass the original string NodeId
}
// 3. Release before the app exits
ua.UnregisterNodes(fast);
When to Use
| Scenario | Necessity |
|---|---|
| One-time script | Low (cost savings are negligible) |
| Long-term operation, frequent access to the same node | High |
| Large-scale SCADA, continuous monitoring of thousands of tags | High |
How much is the profit?
The SDK guarantees only one thing: the server answers with a "fast NodeId". Whether that saves time, and how much, depends entirely on the server implementation. The SDK adds no acceleration of its own and promises no benefit (some servers run registered IDs and original IDs through the same lookup).
So don't design performance metrics based on claims like "X% faster"; if you want to quantify performance, use actual tests on your own server.
Note
- Registered Temporary ID Valid only for the current session
- After a session is disconnected or reconnected, do not continue using the old temporary ID—obtain
RegisterNodesa new one instead. - Before the app closes, please use
UnregisterNodesexplicit release (SDK required); temporary IDs that are not released will be reclaimed by the server when the session ends.