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.
- If you don't want to type it out manually
Variant[], use MethodBuilder Chain-based parameter passing. - Alarm Acknowledge is also invoked Call via a call; see Event Subscription.
One-Minute Example
using var a = new Variant(); a.Int32 = 3;
using var b = new Variant(); b.Int32 = 4;
var outputs = ua.Call(
objectNodeId: "ns=2;s=Calculator",
methodNodeId: "ns=2;s=Calculator.Add",
a, b);
foreach (var v in outputs) using (v)
Console.WriteLine($"sum = {v.AsInt32 ?? 0}"); // AsInt32 Is it an int? The return value is null Int32 when it is not an int.
Exit Variant Dispose One by One (That's using (v) what the code above is for); the input parameters are still Variant up to you—just make sure to call Dispose on them when you're done.