change-修改灌注plc条码地址

dev
liuwf 11 months ago
parent e2483160a9
commit c7123108cc

@ -179,6 +179,7 @@
"PlcType": "Siemens",
"Enabled": true,
"IP": "10.10.92.147",
// "IP": "127.0.0.1",
"Port": 102
}
],

@ -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", "");
///灌注完成状态字

Loading…
Cancel
Save