| | |
| | | using System.Net.NetworkInformation; |
| | | using WIDESEA_Comm.DataHandle; |
| | | using WIDESEA_Comm.LogInfo; |
| | | using static FreeSql.Internal.GlobalFilter; |
| | | |
| | | namespace WIDESEA_WCS.WCSClient |
| | | { |
| | |
| | | } |
| | | 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 |