From 818fdd469e2ed47c9e02e06fcb4c7dc791977a0b Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期一, 13 四月 2026 10:07:32 +0800
Subject: [PATCH] 1

---
 zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java
index c63c92e..944b416 100644
--- a/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java
+++ b/zy-asc-conveyor/src/main/java/com/zy/acs/conveyor/core/constant/DeviceField.java
@@ -6,20 +6,26 @@
  */
 public enum DeviceField {
     // 鎵爜鍣細姣忕珯鐐�16瀛楄妭锛孲tring[14]
-    BARCODE("DB101", 0, 16),
+    BARCODE("DB103", 254, 18, new int[]{0, 2}, 21),
+    // 鍑哄叆搴撴ā寮�
+    IO_MODE("DB103", 170, 4, new int[]{0, 2}, 21),
     // 绉伴噸锛氭瘡绔欑偣4瀛楄妭锛孎loat
-    WEIGHT("DB102", 0, 4),
+    WEIGHT("DB103", 634, 6, new int[]{0, 2}, 21),
     // 灏哄寮傚父锛氭瘡绔欑偣2瀛楄妭锛孊it鏁扮粍
-    DIMENSION_WORD("DB103", 0, 2);
+    DIMENSION_WORD("DB103", 2, 8, new int[]{0, 2, 4, 6}, 21);
 
     private final String addressPattern;
     private final int offset;
     private final int byteLength;
+    private final int[] seg;
+    private final int arrLength;
 
-    DeviceField(String addressPattern, int offset, int byteLength) {
+    DeviceField(String addressPattern, int offset, int byteLength, int[] seg, int arrLength) {
         this.addressPattern = addressPattern;
         this.offset = offset;
         this.byteLength = byteLength;
+        this.seg = seg;
+        this.arrLength = arrLength;
     }
 
     public String getAddressPattern() {
@@ -34,15 +40,20 @@
         return byteLength;
     }
 
+    public int getArrLength() {
+        return arrLength;
+    }
+
+    public int[] getSeg() {
+        return seg;
+    }
+
     /**
      * 鏍规嵁 DB 鍧楃紪鍙峰拰绔欑偣鍋忕Щ鐢熸垚鍏蜂綋鍦板潃
      *
-     * @param dbBlock           DB鍧楃紪鍙�
-     * @param stationBaseOffset 绔欑偣鍩哄潃鍋忕Щ锛堢珯鐐瑰彿*绔欑偣闀垮害锛�
      * @return PLC4X 鍦板潃瀛楃涓诧紝濡� "DB100.DBD0"
      */
-    public String buildAddress(int dbBlock, int stationBaseOffset) {
-        int finalOffset = stationBaseOffset + offset;
-        return String.format(addressPattern, dbBlock, finalOffset);
+    public String buildAddress() {
+        return addressPattern + PlcConstant.ADDRESS_CONCATENATION + offset;
     }
 }

--
Gitblit v1.9.1