From 227cf5ae845198eb25552d3db7509c0ed517f69a Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期五, 07 六月 2024 14:20:13 +0800
Subject: [PATCH] 获取VK4和VK5的所有显示工位车轮数据

---
 代码管理/PCS/WCS_Server/WIDESEA_WCS/WCSClient/Siemens/SiemensPLCClient.cs |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/WCSClient/Siemens/SiemensPLCClient.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/WCSClient/Siemens/SiemensPLCClient.cs"
index 4b6f78a..51ab901 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/WCSClient/Siemens/SiemensPLCClient.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/WCSClient/Siemens/SiemensPLCClient.cs"
@@ -3,6 +3,7 @@
 using System.Net.NetworkInformation;
 using WIDESEA_Comm.DataHandle;
 using WIDESEA_Comm.LogInfo;
+using static FreeSql.Internal.GlobalFilter;
 
 namespace WIDESEA_WCS.WCSClient
 {
@@ -134,8 +135,11 @@
             }
             else if (typeof(DataType) == typeof(string))//瀛楃涓�
             {
-                var bytes = (byte[])GetContent(siemensPLCClient.Read(dbAddress, (ushort)len), dbAddress);
-                string str = DataParse.GetStr(bytes, 0);
+                //var bytes = (byte[])GetContent(siemensPLCClient.Read(dbAddress, (ushort)len), dbAddress);
+                //string str = DataParse.GetStr(bytes, 0);
+                //return (DataType)(str as object);
+                var str = GetContent(siemensPLCClient.ReadString(dbAddress, (ushort)len), dbAddress).ToString();
+                str = str.Replace("\0", "")?.Replace("\\", "")?.Replace("\u0014", "")?.Replace("?\u0006", "")?.Replace("\n", "")?.Replace("?", "")?.Trim();
                 return (DataType)(str as object);
             }
             else

--
Gitblit v1.9.3