diff --git a/HighWayIot.Plc/PlcConnect.cs b/HighWayIot.Plc/PlcConnect.cs index c5d452f..11bd839 100644 --- a/HighWayIot.Plc/PlcConnect.cs +++ b/HighWayIot.Plc/PlcConnect.cs @@ -27,7 +27,7 @@ namespace HighWayIot.Plc /// /// 静态懒加载MelsecMcNet2 /// - private static readonly MelsecMcNet MelsecInstance2 = new PlcConnect().CreateAb("192.168.0.8"); + private static readonly MelsecMcNet MelsecInstance2 = new PlcConnect().CreateAb("10.20.48.225"); private PlcConnect() { diff --git a/HighWayIot.Winform/Business/WorkStationBusiness.cs b/HighWayIot.Winform/Business/WorkStationBusiness.cs index 6afff10..fde7ec2 100644 --- a/HighWayIot.Winform/Business/WorkStationBusiness.cs +++ b/HighWayIot.Winform/Business/WorkStationBusiness.cs @@ -148,12 +148,14 @@ namespace HighWayIot.Winform.Business public void ReciveRFIDSingal(byte[] bytes, string ip) { Receive02HEntity entity = _rfidDataAnalyse.Receive02H(bytes); - if(entity.TagCount != 1) - { - _logHelper.Error("返回多标签!"); - return; - } - byte[] data = entity.Data[0].EPC; + //if(entity.TagCount != 1) + //{ + // _logHelper.Error("返回多标签!"); + // return; + //} + + //找到读取次数最大的标签EPC + byte[] data = entity.Data.Where(x => x.Count == entity.Data.Max(y => y.Count)).First().EPC; //标签号byte数组转换成字符串 string result = string.Join(" ", data.Select(x => x.ToString("X2")));