#
zjj
2024-04-03 1a1be21d814f2ca0cbfa72ae562643d773fa92dd
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -338,21 +338,16 @@
                staProtocol.setBarcodeErr(status[6]);
            }
        } else if (slave.getId() == 3) {
            //条码
            //Thread.sleep(200);
            OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.18",(short)10);
            if (result2.IsSuccess) {
                    String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,0,8, "UTF-8");
                    BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 7);
                    if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                        barcodeThread.setBarcode(barcode);
                    }
            }
            // 外形检测 - 111
            //Thread.sleep(50);
            OperateResultExOne<byte[]> result10 = siemensS7Net.Read("DB101.26", (short)1);
            if (result10.IsSuccess) {
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result10.Content, 0, 1);
@@ -364,20 +359,17 @@
                staProtocol.setRightErr(status[4]);
                staProtocol.setWeightErr(status[5]);
                staProtocol.setBarcodeErr(status[6]);
            }
        } else if (slave.getId() == 4) {
            //条码
            //Thread.sleep(200);
            OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.18",(short)10);
            if (result2.IsSuccess) {
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,0,8, "UTF-8");
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 7);
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, 8);
                if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                    barcodeThread.setBarcode(barcode);
                }
            }
            // 外形检测 - 111
            //Thread.sleep(50);
@@ -466,6 +458,7 @@
            DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
            deviceErrorService.deleteDeviceError("devp", slave.getId());
        } else {
            initSite();
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】读取输送线plc状态信息失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
//            log.error("读取输送线plc状态信息失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
            DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);