Skip to main content

Method

An OPC UA Method node is an RPC interface exposed by the server. It is invoked by calling ua.call(...).

Subpage Redirect
  • Complete method signature / Memory ownership / Finding methods—please NodeId refer to Call.
  • Alarm Acknowledge is also invoked call via a call; see Event Subscription.

One-Minute Example​

try (OpcUaVariant a = new OpcUaVariant().setInt32(3);
OpcUaVariant b = new OpcUaVariant().setInt32(4)) {
List<OpcUaVariant> outputs = ua.call(
"ns=2;s=Calculator",
"ns=2;s=Calculator.Add",
a, b);
try {
for (OpcUaVariant v : outputs) {
System.out.println("sum = " + v.asInt32());
}
} finally {
for (OpcUaVariant v : outputs) v.close();
}
}

Next Step​