public OpcXmlDaDriver() { RequestOptions ReadOptions = new RequestOptions(); ReadOptions.ClientRequestHandle = ""; ReadOptions.LocaleID = "DE-AT"; ReadOptions.RequestDeadlineSpecified = true; ReadOptions.ReturnDiagnosticInfo = true; ReadOptions.ReturnErrorText = true; ReadOptions.ReturnItemName = true; ReadOptions.ReturnItemPath = true; ReadOptions.ReturnItemTime = true; ReadRequestItemList ReadItemList = new ReadRequestItemList(); ReadRequestItem[] ReadItemArray = new ReadRequestItem[1]; ReadRequestItem ReadItem = new ReadRequestItem(); ReadItem.ItemPath = "SIMOTION"; ReadItem.ItemName = "var/userData.user5"; ReadItemArray[0] = ReadItem; ReadItemList.Items = ReadItemArray; ReplyItemList ReadReplyList; OPCError[] ReadErrorList; Service C230_2_Server = new Service(); C230_2_Server.Url = "http://169.254.11.22/soap/opcxml"; System.Net.ICredentials myCredentials = new System.Net.NetworkCredential("simotion", "simotion"); C230_2_Server.Credentials = myCredentials; C230_2_Server.PreAuthenticate = true; System.Net.ServicePointManager.Expect100Continue = false; C230_2_Server.Read(ReadOptions, ReadItemList, out ReadReplyList, out ReadErrorList); //if ((ReadReplyList.Items[0] != null) && (ReadReplyList.Items[0].Value != null) && (ReadReplyList.Items[0].Value.GetType().Name != "XmlNode[]")) // Output.Text = ReadReplyList.Items[0].Value.ToString(); //else // Output.Text = "<Error>"; MessageBox.Show(ReadReplyList.Items[0].ItemName.ToString() + "\nValue: " + ReadReplyList.Items[0].Value); }
/// <remarks/> public void SubscriptionPolledRefreshAsync(RequestOptions Options, string[] ServerSubHandles, System.DateTime HoldTime, bool HoldTimeSpecified, int WaitTime, bool ReturnAllItems, object userState) { if ((this.SubscriptionPolledRefreshOperationCompleted == null)) { this.SubscriptionPolledRefreshOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubscriptionPolledRefreshOperationCompleted); } this.InvokeAsync("SubscriptionPolledRefresh", new object[] { Options, ServerSubHandles, HoldTime, HoldTimeSpecified, WaitTime, ReturnAllItems}, this.SubscriptionPolledRefreshOperationCompleted, userState); }
public ReplyBase SubscriptionPolledRefresh(RequestOptions Options, [System.Xml.Serialization.XmlElementAttribute("ServerSubHandles")] string[] ServerSubHandles, [System.Xml.Serialization.XmlAttributeAttribute()] System.DateTime HoldTime, [System.Xml.Serialization.XmlAttributeAttribute()] [System.Xml.Serialization.XmlIgnoreAttribute()] bool HoldTimeSpecified, [System.Xml.Serialization.XmlAttributeAttribute()] [System.ComponentModel.DefaultValueAttribute(0)] int WaitTime, [System.Xml.Serialization.XmlAttributeAttribute()] [System.ComponentModel.DefaultValueAttribute(false)] bool ReturnAllItems, [System.Xml.Serialization.XmlElementAttribute("InvalidServerSubHandles")] out string[] InvalidServerSubHandles, [System.Xml.Serialization.XmlElementAttribute("RItemList")] out SubscribePolledRefreshReplyItemList[] RItemList, [System.Xml.Serialization.XmlElementAttribute("Errors")] out OPCError[] Errors, [System.Xml.Serialization.XmlAttributeAttribute()] [System.ComponentModel.DefaultValueAttribute(false)] out bool DataBufferOverflow) { object[] results = this.Invoke("SubscriptionPolledRefresh", new object[] { Options, ServerSubHandles, HoldTime, HoldTimeSpecified, WaitTime, ReturnAllItems}); InvalidServerSubHandles = ((string[])(results[1])); RItemList = ((SubscribePolledRefreshReplyItemList[])(results[2])); Errors = ((OPCError[])(results[3])); DataBufferOverflow = ((bool)(results[4])); return ((ReplyBase)(results[0])); }
/// <remarks/> public void SubscriptionPolledRefreshAsync(RequestOptions Options, string[] ServerSubHandles, System.DateTime HoldTime, bool HoldTimeSpecified, int WaitTime, bool ReturnAllItems) { this.SubscriptionPolledRefreshAsync(Options, ServerSubHandles, HoldTime, HoldTimeSpecified, WaitTime, ReturnAllItems, null); }
/// <remarks/> public void SubscribeAsync(RequestOptions Options, SubscribeRequestItemList ItemList, bool ReturnValuesOnReply, int SubscriptionPingRate) { this.SubscribeAsync(Options, ItemList, ReturnValuesOnReply, SubscriptionPingRate, null); }
/// <remarks/> public void SubscribeAsync(RequestOptions Options, SubscribeRequestItemList ItemList, bool ReturnValuesOnReply, int SubscriptionPingRate, object userState) { if ((this.SubscribeOperationCompleted == null)) { this.SubscribeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSubscribeOperationCompleted); } this.InvokeAsync("Subscribe", new object[] { Options, ItemList, ReturnValuesOnReply, SubscriptionPingRate}, this.SubscribeOperationCompleted, userState); }
/// <remarks/> public void WriteAsync(RequestOptions Options, WriteRequestItemList ItemList, bool ReturnValuesOnReply, object userState) { if ((this.WriteOperationCompleted == null)) { this.WriteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWriteOperationCompleted); } this.InvokeAsync("Write", new object[] { Options, ItemList, ReturnValuesOnReply}, this.WriteOperationCompleted, userState); }
public ReplyBase Subscribe(RequestOptions Options, SubscribeRequestItemList ItemList, [System.Xml.Serialization.XmlAttributeAttribute()] bool ReturnValuesOnReply, [System.Xml.Serialization.XmlAttributeAttribute()] [System.ComponentModel.DefaultValueAttribute(0)] int SubscriptionPingRate, out SubscribeReplyItemList RItemList, [System.Xml.Serialization.XmlElementAttribute("Errors")] out OPCError[] Errors, [System.Xml.Serialization.XmlAttributeAttribute()] out string ServerSubHandle) { object[] results = this.Invoke("Subscribe", new object[] { Options, ItemList, ReturnValuesOnReply, SubscriptionPingRate}); RItemList = ((SubscribeReplyItemList)(results[1])); Errors = ((OPCError[])(results[2])); ServerSubHandle = ((string)(results[3])); return ((ReplyBase)(results[0])); }
/// <remarks/> public void WriteAsync(RequestOptions Options, WriteRequestItemList ItemList, bool ReturnValuesOnReply) { this.WriteAsync(Options, ItemList, ReturnValuesOnReply, null); }
public ReplyBase Write(RequestOptions Options, WriteRequestItemList ItemList, [System.Xml.Serialization.XmlAttributeAttribute()] bool ReturnValuesOnReply, out ReplyItemList RItemList, [System.Xml.Serialization.XmlElementAttribute("Errors")] out OPCError[] Errors) { object[] results = this.Invoke("Write", new object[] { Options, ItemList, ReturnValuesOnReply}); RItemList = ((ReplyItemList)(results[1])); Errors = ((OPCError[])(results[2])); return ((ReplyBase)(results[0])); }
/// <remarks/> public void ReadAsync(RequestOptions Options, ReadRequestItemList ItemList, object userState) { if ((this.ReadOperationCompleted == null)) { this.ReadOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReadOperationCompleted); } this.InvokeAsync("Read", new object[] { Options, ItemList}, this.ReadOperationCompleted, userState); }
/// <remarks/> public void ReadAsync(RequestOptions Options, ReadRequestItemList ItemList) { this.ReadAsync(Options, ItemList, null); }
public ReplyBase Read(RequestOptions Options, ReadRequestItemList ItemList, out ReplyItemList RItemList, [System.Xml.Serialization.XmlElementAttribute("Errors")] out OPCError[] Errors) { object[] results = this.Invoke("Read", new object[] { Options, ItemList}); RItemList = ((ReplyItemList)(results[1])); Errors = ((OPCError[])(results[2])); return ((ReplyBase)(results[0])); }