// event handler: called if any item in group has changed values protected void theGrp_DataChange(object sender, DataChangeEventArgs e) { Trace.WriteLine("theGrp_DataChange id=" + e.transactionID.ToString() + " me=0x" + e.masterError.ToString("X")); foreach (OPCItemState s in e.sts) { if (s.HandleClient != itmHandleClient) // only one client handle { continue; } Trace.WriteLine(" item error=0x" + s.Error.ToString("X")); if (HRESULTS.Succeeded(s.Error)) { Trace.WriteLine(" val=" + s.DataValue.ToString()); txtItemValue.Text = s.DataValue.ToString(); // update screen txtItemQual.Text = OpcGroup.QualityToString(s.Quality); txtItemTimeSt.Text = DateTime.FromFileTime(s.TimeStamp).ToString(); } else { txtItemValue.Text = "ERROR 0x" + s.Error.ToString("X"); txtItemQual.Text = "error"; txtItemTimeSt.Text = "error"; } } }
public void TestQualityToString01() { //Testing --- //Test Procedure Call string result = OpcGroup.QualityToString(253); }