111
cjs
2025-06-24 31a8f3df81e2dfe1d57a2ae9a1d25c33a05ff862
ams/Hanhe.iWCS.JingmenGLMNorthProtocol/PLCControl.cs
@@ -1155,10 +1155,11 @@
                                //读取复称平台的重量
                                //Convert.ToInt32(Completion(result[8]) + Completion(result[9]), 2).ToString()
                                //(decimal.Parse(tray.oneTrayWeight1) / 100).ToString("F2");
                                string weight = (decimal.Parse(Convert.ToInt32(Completion(result.result[6]) + Completion(result.result[7]), 2).ToString()) / 100).ToString("F2");
                                //string weight = (decimal.Parse(Convert.ToInt32(Completion(result.result[4]) + Completion(result.result[5]), 2).ToString()) / 100).ToString("F2");
                                string weight = ((result.result[4] * 65536 + result.result[5]) / 100).ToString();
                                CMMLog.Debug($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 7}里面数据为{result.result[6]}.");
                                CMMLog.Debug($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 8}里面数据为{result.result[7]}.");
                                CMMLog.Debug($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 4}里面数据为{result.result[4]}.");
                                CMMLog.Debug($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 5}里面数据为{result.result[5]}.");
                                //double x = (double)Convert.ToInt32(Completion(result[8]) + Completion(result[9]), 2) / 100;
                                //CMMLog.Info($"SecondWeightActionOne: 读取设备{plc.location},ip:{plc.ip}通道{plc.readAddr + 4}里面数据为{result.result[3]}.");
                                CMMLog.Info($"SecondWeightActionOne: weight:{weight}");
@@ -1174,8 +1175,6 @@
                        }
                        else CMMLog.Info($"SecondWeightActionOne: packageInfoModel未找到数据,machineNo:{model.machince},trayCode:{model.ext2}");
                        #endregion
                        string PlcBit02 = Settings.GetPlcInfo().Where(a => a.deviceType == "2").FirstOrDefault().location;
                        UpdateBuilder update = Update.Set("ng", result.result[2]);
@@ -1199,7 +1198,7 @@
            if (infoTwo != null)
            {
                //var newWeight = (Convert.ToInt32(Completion(result[6]) + Completion(result[7]), 2) / 100).ToString();
                var newWeight =  result[6] + "," + result[7];
                var newWeight =  result[5] + "," + result[6];
                //更新数据
                CMMLog.Info($"从复称平台获取的物料重量:{newWeight}");