diff --git a/Aucam.Core.PerfusionService/appsettings.json b/Aucam.Core.PerfusionService/appsettings.json index 6ac3b8b7..b4e78b26 100644 --- a/Aucam.Core.PerfusionService/appsettings.json +++ b/Aucam.Core.PerfusionService/appsettings.json @@ -179,6 +179,7 @@ "PlcType": "Siemens", "Enabled": true, "IP": "10.10.92.147", + // "IP": "127.0.0.1", "Port": 102 } ], diff --git a/Aucma.Core.Tasks/Business/PerfusionCollection.cs b/Aucma.Core.Tasks/Business/PerfusionCollection.cs index e5a47928..b7e5aa65 100644 --- a/Aucma.Core.Tasks/Business/PerfusionCollection.cs +++ b/Aucma.Core.Tasks/Business/PerfusionCollection.cs @@ -123,6 +123,7 @@ namespace Aucma.Core.Tasks.Business { record = new Perfusion_Record(); byte[] info = obj.plc.Read("DB55.0", 84); + byte[] codeInfo = obj.plc.Read("DB60.0", 46); if (info == null) return null; #region 灌注记录赋值 record.PerfusionActualVolume = byteToDouble(info.Skip(0).Take(8).ToArray()).ToString().Replace("\0", ""); @@ -130,9 +131,9 @@ namespace Aucma.Core.Tasks.Business record.PerfusionL = byteToFloat(info.Skip(54).Take(4).ToArray()).ToString().Replace("\0", ""); record.PerfusionDuration = int.Parse(StringChange.bytesToHexStr(info.Skip(12).Take(4).ToArray(), 4), System.Globalization.NumberStyles.HexNumber).ToString().Replace("\0", ""); record.Yield = int.Parse(StringChange.bytesToHexStr(info.Skip(16).Take(4).ToArray(), 4), System.Globalization.NumberStyles.HexNumber).ToString().Replace("\0", ""); - record.PerfusionBoxCode = asciiEncoding.GetString(info.Skip(22).Take(24).ToArray()).Trim('\n').Replace("\0", ""); - record.PerfusionRefrigerantTypeLeft = asciiEncoding.GetString(info.Skip(58).Take(7).ToArray()).Trim('\n').Replace("\0", ""); - record.PerfusionRefrigerantTypeRight = asciiEncoding.GetString(info.Skip(68).Take(7).ToArray()).Trim('\n').Replace("\0", ""); + record.PerfusionBoxCode = asciiEncoding.GetString(codeInfo.Skip(2).Take(22).ToArray()).Trim('\n').Replace("\0", ""); + record.PerfusionRefrigerantTypeLeft = asciiEncoding.GetString(codeInfo.Skip(28).Take(7).ToArray()).Trim('\n').Replace("\0", ""); + record.PerfusionRefrigerantTypeRight = asciiEncoding.GetString(codeInfo.Skip(38).Take(7).ToArray()).Trim('\n').Replace("\0", ""); record.PerfusionSetVolume = byteToFloat(info.Skip(78).Take(4).ToArray()).ToString().Replace("\0", ""); record.PerfusionSystem = short.Parse(StringChange.bytesToHexStr(info.Skip(82).Take(2).ToArray(), 2), System.Globalization.NumberStyles.HexNumber).ToString().Replace("\0", ""); ///灌注完成状态字