自动化立体仓库 - WCS系统
#
lsh
2024-07-11 1e5df4a2e55d8fb959311c5da8a1be183adbcd8b
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -310,9 +310,7 @@
                    Integer siteId = staNosRgv[i]; // 站点编号
                    StaProtocol staProtocol = station.get(siteId);
                    if (null == staProtocol) {
                        staProtocol = new StaProtocol();
                        staProtocol.setSiteId(siteId);
                        station.put(siteId, staProtocol);
                        continue;
                    }
                    try{
                        staProtocol.setEndRow(siemensS7Net.getByteTransform().TransInt16(resultRgv2.Content, 0));     // 小车目标位
@@ -353,12 +351,19 @@
        Thread.sleep(200);
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.2440",(short)(barcodeSize*8));
        if (result2.IsSuccess) {
            for (int i = 0; i < barcodeSize; i++) {  //1:281  2:292  3:174 4:214  5:120
            int[] staNosRgv = {281,292,173,214,120};
            for (int i = 0; i < barcodeSize; i++) {  //1:281  2:292  3:174(173) 4:214  5:120
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1);
                if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                    Integer siteId = staNosRgv[i]; // 站点编号
                    StaProtocol staProtocol = station.get(siteId);
                    if (null == staProtocol) {
                        continue;
                    }
                    staProtocol.setBarcode(barcode);
                    barcodeThread.setBarcode(barcode);
                    System.out.println(barcode+"读取到条码:"+i);
                }
            }
        }