public void easyUAClient_MonitoredItemChanged(object sender, EasyUAMonitoredItemChangedEventArgs e)
 {
     // Display value
     // Remark: Production code would check e.Exception before accessing e.AttributeData.
     Console.WriteLine( e.Arguments.NodeId +" " + e.AttributeData.ServerTimestamp+" " + e.AttributeData.Value );
     resultFile.WriteLine(e.Arguments.NodeId + ";" + e.AttributeData.ServerTimestamp + ";" + e.AttributeData.Value);
     resultFile.Flush();
 }
 public void easyUAClient_MonitoredItemChanged(object sender, EasyUAMonitoredItemChangedEventArgs e)
 {
     // Display value
     // Remark: Production code would check e.Exception before accessing e.AttributeData.
     Console.WriteLine(e.Arguments.NodeId + " " + e.AttributeData.ServerTimestamp + " " + e.AttributeData.Value);
     resultFile.WriteLine(e.Arguments.NodeId + ";" + e.AttributeData.ServerTimestamp + ";" + e.AttributeData.Value);
     resultFile.Flush();
 }
Exemple #3
0
 static object GetTagUpDate(EasyUAMonitoredItemChangedEventArgs e)
 {
     return(new
     {
         e.AttributeData?.Value,
         DisplayValue = e.AttributeData?.DisplayValue(),
         e.AttributeData?.ServerTimestamp,
         e.AttributeData?.SourceTimestamp,
         e.AttributeData?.HasGoodStatus,
         e.AttributeData?.HasBadStatus,
         e.AttributeData?.HasUncertainStatus,
         Exception = e.Exception?.Message,
         Succeeded = e.Succeeded,
         Node = e.Arguments.State.ToString()
     });
 }
Exemple #4
0
        public static void changes(object sender, EasyUAMonitoredItemChangedEventArgs e)
        {
            GroupInfo value;

            if (GroupInfos.Value.TryGetValue(e.Arguments.State.ToString(), out value))
            {
                lock (value)
                {
                    if (e.Handle == value.SubscribeId)
                    {
                        value.Value = e;

                        GlobalHost.ConnectionManager.GetHubContext <OpcHub>()
                        .Clients.Group(e.Arguments.State.ToString()).broadcastMessage("tags", GetTagUpDate(e));
                    }
                }
            }
            else
            {
                System.Diagnostics.Debug.WriteLine($"{e.Arguments.State.ToString()} NOT FOUND");
            }
        }