Do let me know if i have missed anything in the code.
Code: Select all
public void Connect(string endpointUrl)
{
AppSession.UserIdentity = new UserIdentity();
AppSession.Connect(endpointUrl, SecuritySelection.None);
/// [Step 1]
// parse the object id.
NodeId objectId = NodeId.Parse("ns=2;i=15108");
// get the selected method id.
NodeId methodId = NodeId.Parse("ns=2;i=15057");
// get input arguments.
UInt32 a = 2;
List<Variant> inputArguments = new List<Variant>
{
new Variant(), new Variant(a,TypeInfo.Scalars.UInt32), new Variant(),
new Variant(), new Variant()
};
/// [Step 2]
List<StatusCode> inputArgumentErrors = null;
List<Variant> outputArguments = null;
// call the method on the server.
StatusCode error = AppSession.Call(
objectId,
methodId,
inputArguments,
new RequestSettings() { DiagnosticsMasks = DiagnosticsMasks.None, OperationTimeout = 10000 },
out inputArgumentErrors,
out outputArguments);
}