/// <summary> /// Invokes the method Robot1Multiply. /// </summary> public async void Robot1Multiply() { try { // Call the method, passing the input arguments in a Variant[]. var response = await UaTcpSessionClient.FromModel(this).CallAsync(new CallRequest { MethodsToCall = new[] { new CallMethodRequest { ObjectId = NodeId.Parse("ns=2;s=Robot1"), MethodId = NodeId.Parse("ns=2;s=Robot1_Multiply"), InputArguments = new Variant[] { this.InputA, this.InputB } } } }); // When the method returns, save the output argument. this.Result = (double)response.Results[0].OutputArguments[0]; } catch (Exception ex) { Debug.WriteLine("Error calling Robot1Multiply method: {0}", ex); } }
/// <summary> /// Sets the Robot1Mode to Auto. /// </summary> public async void Robot1ModeAuto() { try { await UaTcpSessionClient.FromModel(this).WriteAsync(new WriteRequest { NodesToWrite = new[] { new WriteValue { NodeId = NodeId.Parse("ns=2;s=Robot1_Mode"), AttributeId = AttributeIds.Value, IndexRange = null, Value = new DataValue((short)HandOffAuto.Auto) } } }); } catch (Exception ex) { Debug.WriteLine("Error writing to NodeId {0} : {1}", "ns=2;s=Robot1_Mode", ex); } }