Skip to main content

RegisterNodes / UnregisterNodes

registerNodes 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.

Determination of Applicability
  • 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​

public List<String> registerNodes(List<String> nodeIds);
public Enums.StatusCode unregisterNodes(List<String> registeredNodeIds);

Usage​

import java.util.Arrays;
import java.util.List;

// 1. Register when the app starts
List<String> orig = Arrays.asList(
"ns=2;s=Plant.Line1.Sensor.Temperature",
"ns=2;s=Plant.Line1.Sensor.Pressure",
"ns=2;s=Plant.Line1.Sensor.FlowRate");
List<String> temp = ua.registerNodes(orig);
// "temp" is currently a temporary value provided by the server ID, such as "i=99001", "i=99002", "i=99003"

// 2. Use a temporary one for subsequent frequent visits ID
for (int i = 0; i < 10000; i++) {
try (OpcUaDataValue dv = ua.read(temp.get(0))) {
// Use a temporary read ID ; do not pass the original string NodeId
}
}

// 3. Release before the app exits
ua.unregisterNodes(temp);

When to Use​

ScenarioNecessity
Single-run script, 100 nodesLow (cost savings are negligible)
Long-term operation, frequent access to the same nodeHigh (significant time savings)
Large-scale SCADA, 1000+ tags, continuous monitoringMust

Performance Data​

The time required for server-side NodeId parsing depends on the implementation; I am SDK not familiar with the server-side parsing algorithm or its complexity:

  • Number NodeId (i=2258) — The analysis of how much overhead this involves andregisterNodes whether it's worth it depends on the server-side implementation.
  • String NodeId Long Path (ns=2;s=Plant.Line1.Sensor.Temperature) — Same as above; whether the long path is slower andregisterNodes how much it can save depends on your server's actual performance tests.

Note​

  • Registered Temporary ID Valid only for the current session, becomes invalid after disconnecting
  • Whether the temporary ID remains valid after a session reconnection (transferSubscriptions) is determined by the server; to be on the safe side, re-register it.
  • Temporary IDs that are not released will be released when the session ends, but it is unregisterNodes good practice to release them explicitly.
The temporary ID is opaque.

Do not parse or modify the temporary ID string. Simply treat it as an opaque token.

Next Step​