Explorar o código

地址读取低四位

章政 %!s(int64=5) %!d(string=hai) anos
pai
achega
19fe226b33
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      PLCDataReader/PublicMethod/BaseUtil.cs

+ 4 - 2
PLCDataReader/PublicMethod/BaseUtil.cs

@@ -423,13 +423,15 @@ namespace UAS_PLCDataReader.PublicMethod
                         {
                             if (Convert.ToInt32("0x" + (RealData.Substring(i, DataSize).Substring(0, 4)), 16) / 1 != 0)
                                 ReturnData.Add(Convert.ToInt32("0x" + (RealData.Substring(i, DataSize).Substring(0, 4)), 16));
+                            if (Convert.ToInt32("0x" + (RealData.Substring(i, DataSize).Substring(4, 4)), 16) / 1 != 0)
+                                ReturnData.Add(Convert.ToInt32("0x" + (RealData.Substring(i, DataSize).Substring(4, 4)), 16));
                         }
                     }
                 }
             }
-            catch (Exception)
+            catch (Exception ex)
             {
-
+                Console.WriteLine(ex.Message);
             }
             return ReturnData.ToArray();
         }