From 918b0157e6769337954c4b0c256d4270412a0dd8 Mon Sep 17 00:00:00 2001 From: liuwf Date: Mon, 1 Jan 2024 16:21:46 +0800 Subject: [PATCH] change --- .../Business/DoorCollection.cs | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Aucma.Core.DoorFoam/Business/DoorCollection.cs b/Aucma.Core.DoorFoam/Business/DoorCollection.cs index ae3bd209..237a65a2 100644 --- a/Aucma.Core.DoorFoam/Business/DoorCollection.cs +++ b/Aucma.Core.DoorFoam/Business/DoorCollection.cs @@ -59,14 +59,14 @@ namespace Aucma.Core.DoorFoam.Business // ReadModeStatus(obj, BoxTypeList); // 1-5 6-10 11-15 16-20 21-25 25-30 - // ReadModeType(obj, "DB4.142", BoxTypeList); + // ReadModeType(obj, "DB4.142", BoxTypeList); // ReadModeType(obj, "DB4.342", BoxTypeList); // ReadModeType(obj, "DB4.542", BoxTypeList); // ReadModeType(obj, "DB4.742", BoxTypeList); // ReadModeType(obj, "DB4.942", BoxTypeList); // ReadModeType(obj, "DB4.1142", BoxTypeList); // 31-34 - // ReadModeTypeLast(obj, "DB4.1342", BoxTypeList); + ReadModeTypeLast(obj, "DB4.1342", BoxTypeList); // ReadModeProduct(obj, "DB4.1542", BoxTypeList); // ReadModeProduct(obj, "DB4.1702", BoxTypeList); @@ -193,30 +193,30 @@ namespace Aucma.Core.DoorFoam.Business { if (obj.plc.IsConnected) { - byte[] info = obj.plc.Read(startStr, 200); + byte[] info = obj.plc.Read(startStr, 202); if (info == null) return; //1#台车1#枪A门,1#台车1#枪B门,1#台车2#枪A门,1#台车2#枪B门 - string temp1 = asciiEncoding.GetString(info.Skip(0).Take(10).ToArray()).Trim('\n'); - string temp2 = asciiEncoding.GetString(info.Skip(10).Take(10).ToArray()).Trim('\n'); - string temp3 = asciiEncoding.GetString(info.Skip(20).Take(10).ToArray()).Trim('\n'); - string temp4 = asciiEncoding.GetString(info.Skip(30).Take(10).ToArray()).Trim('\n'); - string temp5 = asciiEncoding.GetString(info.Skip(40).Take(10).ToArray()).Trim('\n'); - string temp6 = asciiEncoding.GetString(info.Skip(50).Take(10).ToArray()).Trim('\n'); - string temp7 = asciiEncoding.GetString(info.Skip(60).Take(10).ToArray()).Trim('\n'); - string temp8 = asciiEncoding.GetString(info.Skip(70).Take(10).ToArray()).Trim('\n'); - string temp9 = asciiEncoding.GetString(info.Skip(80).Take(10).ToArray()).Trim('\n'); - string temp10 = asciiEncoding.GetString(info.Skip(90).Take(10).ToArray()).Trim('\n'); - string temp11 = asciiEncoding.GetString(info.Skip(100).Take(10).ToArray()).Trim('\n'); - string temp12 = asciiEncoding.GetString(info.Skip(110).Take(10).ToArray()).Trim('\n'); - string temp13 = asciiEncoding.GetString(info.Skip(120).Take(10).ToArray()).Trim('\n'); - string temp14 = asciiEncoding.GetString(info.Skip(130).Take(10).ToArray()).Trim('\n'); - string temp15 = asciiEncoding.GetString(info.Skip(140).Take(10).ToArray()).Trim('\n'); - string temp16 = asciiEncoding.GetString(info.Skip(150).Take(10).ToArray()).Trim('\n'); - string temp17 = asciiEncoding.GetString(info.Skip(160).Take(10).ToArray()).Trim('\n'); - string temp18 = asciiEncoding.GetString(info.Skip(170).Take(10).ToArray()).Trim('\n'); - string temp19 = asciiEncoding.GetString(info.Skip(180).Take(10).ToArray()).Trim('\n'); - string temp20 = asciiEncoding.GetString(info.Skip(190).Take(10).ToArray()).Trim('\n'); + string temp1 = asciiEncoding.GetString(info.Skip(2).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp2 = asciiEncoding.GetString(info.Skip(12).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp3 = asciiEncoding.GetString(info.Skip(22).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp4 = asciiEncoding.GetString(info.Skip(32).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp5 = asciiEncoding.GetString(info.Skip(42).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp6 = asciiEncoding.GetString(info.Skip(52).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp7 = asciiEncoding.GetString(info.Skip(62).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp8 = asciiEncoding.GetString(info.Skip(72).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp9 = asciiEncoding.GetString(info.Skip(82).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp10 = asciiEncoding.GetString(info.Skip(92).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp11 = asciiEncoding.GetString(info.Skip(102).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp12 = asciiEncoding.GetString(info.Skip(112).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp13 = asciiEncoding.GetString(info.Skip(122).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp14 = asciiEncoding.GetString(info.Skip(132).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp15 = asciiEncoding.GetString(info.Skip(142).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp16 = asciiEncoding.GetString(info.Skip(152).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp17 = asciiEncoding.GetString(info.Skip(162).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp18 = asciiEncoding.GetString(info.Skip(172).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp19 = asciiEncoding.GetString(info.Skip(182).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp20 = asciiEncoding.GetString(info.Skip(192).Take(10).ToArray()).Trim('\n').Trim('\0'); Console.WriteLine(temp20); } @@ -232,27 +232,27 @@ namespace Aucma.Core.DoorFoam.Business { if (obj.plc.IsConnected) { - byte[] info = obj.plc.Read(startStr, 160); + byte[] info = obj.plc.Read(startStr, 162); if (info == null) return; //1#台车1#枪A门,1#台车1#枪B门,1#台车2#枪A门,1#台车2#枪B门 - string temp1 = asciiEncoding.GetString(info.Skip(0).Take(10).ToArray()).Trim('\n'); - string temp2 = asciiEncoding.GetString(info.Skip(10).Take(10).ToArray()).Trim('\n'); - string temp3 = asciiEncoding.GetString(info.Skip(20).Take(10).ToArray()).Trim('\n'); - string temp4 = asciiEncoding.GetString(info.Skip(30).Take(10).ToArray()).Trim('\n'); - string temp5 = asciiEncoding.GetString(info.Skip(40).Take(10).ToArray()).Trim('\n'); - string temp6 = asciiEncoding.GetString(info.Skip(50).Take(10).ToArray()).Trim('\n'); - string temp7 = asciiEncoding.GetString(info.Skip(60).Take(10).ToArray()).Trim('\n'); - string temp8 = asciiEncoding.GetString(info.Skip(70).Take(10).ToArray()).Trim('\n'); - string temp9 = asciiEncoding.GetString(info.Skip(80).Take(10).ToArray()).Trim('\n'); - string temp10 = asciiEncoding.GetString(info.Skip(90).Take(10).ToArray()).Trim('\n'); - string temp11 = asciiEncoding.GetString(info.Skip(100).Take(10).ToArray()).Trim('\n'); - string temp12 = asciiEncoding.GetString(info.Skip(110).Take(10).ToArray()).Trim('\n'); - string temp13 = asciiEncoding.GetString(info.Skip(120).Take(10).ToArray()).Trim('\n'); - string temp14 = asciiEncoding.GetString(info.Skip(130).Take(10).ToArray()).Trim('\n'); - string temp15 = asciiEncoding.GetString(info.Skip(140).Take(10).ToArray()).Trim('\n'); - string temp16 = asciiEncoding.GetString(info.Skip(150).Take(10).ToArray()).Trim('\n'); - + string temp1 = asciiEncoding.GetString(info.Skip(2).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp2 = asciiEncoding.GetString(info.Skip(12).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp3 = asciiEncoding.GetString(info.Skip(22).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp4 = asciiEncoding.GetString(info.Skip(32).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp5 = asciiEncoding.GetString(info.Skip(42).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp6 = asciiEncoding.GetString(info.Skip(52).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp7 = asciiEncoding.GetString(info.Skip(62).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp8 = asciiEncoding.GetString(info.Skip(72).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp9 = asciiEncoding.GetString(info.Skip(82).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp10 = asciiEncoding.GetString(info.Skip(92).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp11 = asciiEncoding.GetString(info.Skip(102).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp12 = asciiEncoding.GetString(info.Skip(112).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp13 = asciiEncoding.GetString(info.Skip(122).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp14 = asciiEncoding.GetString(info.Skip(132).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp15 = asciiEncoding.GetString(info.Skip(142).Take(10).ToArray()).Trim('\n').Trim('\0'); + string temp16 = asciiEncoding.GetString(info.Skip(152).Take(10).ToArray()).Trim('\n').Trim('\0'); + Console.WriteLine(temp16); }