#
whycq
2023-02-17 6498c47abdd9ea3362bfc97d0f707506f1e478bc
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -204,18 +204,18 @@
        }
        //条码扫描器
        Thread.sleep(200);
        OperateResultExOne<byte[]> result2 = null;
        result2 = siemensS7Net.Read("DB100.200",(short)(barcodeSize*16));
        if (result2.IsSuccess) {
            for (int i = 0; i < barcodeSize; i++) {
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*16,8, "UTF-8");
                BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, slave.getId() == 1 ? i + 1 : i + 3);
                if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
                    barcodeThread.setBarcode(barcode);
                }
            }
        }
        //Thread.sleep(200);
        //OperateResultExOne<byte[]> result2 = null;
        //result2 = siemensS7Net.Read("DB100.200",(short)(barcodeSize*16));
        //if (result2.IsSuccess) {
        //    for (int i = 0; i < barcodeSize; i++) {
        //        String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*16,8, "UTF-8");
        //        BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, slave.getId() == 1 ? i + 1 : i + 3);
        //        if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) {
        //            barcodeThread.setBarcode(barcode);
        //        }
        //    }
        //}
//        //RGV小车
//        Thread.sleep(200);
@@ -308,37 +308,37 @@
        }
        if (slave.getId() == 2 && this.ioModeOf1F3 != IoModeType.NONE) {
            if (!siemensS7Net.Write("DB100.300", this.ioModeOf1F3.id).IsSuccess) {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线1F3入出库模式失败。输送线plc编号={1}", slave.getId()));
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线1F3入出库模式失败。输送线plc编号={2}", slave.getId()));
                log.error("写入输送线1F3入出库模式失败。输送线plc编号={}", slave.getId());
            }
        }
        if (slave.getId() == 2 && this.ioModeOf1F4 != IoModeType.NONE) {
            if (!siemensS7Net.Write("DB100.302", this.ioModeOf1F4.id).IsSuccess) {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线1F4入出库模式失败。输送线plc编号={1}", slave.getId()));
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线1F4入出库模式失败。输送线plc编号={2}", slave.getId()));
                log.error("写入输送线1F4入出库模式失败。输送线plc编号={}", slave.getId());
            }
        }
        if (slave.getId() == 2 && this.ioModeOf2F1 != IoModeType.NONE) {
            if (!siemensS7Net.Write("DB100.304", this.ioModeOf2F1.id).IsSuccess) {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2F1入出库模式失败。输送线plc编号={1}", slave.getId()));
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2F1入出库模式失败。输送线plc编号={2}", slave.getId()));
                log.error("写入输送线2F1入出库模式失败。输送线plc编号={}", slave.getId());
            }
        }
        if (slave.getId() == 2 && this.ioModeOf2F2 != IoModeType.NONE) {
            if (!siemensS7Net.Write("DB100.306", this.ioModeOf2F2.id).IsSuccess) {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2F2入出库模式失败。输送线plc编号={1}", slave.getId()));
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2F2入出库模式失败。输送线plc编号={2}", slave.getId()));
                log.error("写入输送线2F2入出库模式失败。输送线plc编号={}", slave.getId());
            }
        }
        if (slave.getId() == 2 && this.ioModeOf3F1 != IoModeType.NONE) {
            if (!siemensS7Net.Write("DB100.308", this.ioModeOf3F1.id).IsSuccess) {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F1入出库模式失败。输送线plc编号={1}", slave.getId()));
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F1入出库模式失败。输送线plc编号={2}", slave.getId()));
                log.error("写入输送线3F1入出库模式失败。输送线plc编号={}", slave.getId());
            }
        }
        if (slave.getId() == 2 && this.ioModeOf3F2 != IoModeType.NONE) {
            if (!siemensS7Net.Write("DB100.310", this.ioModeOf3F2.id).IsSuccess) {
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F2入出库模式失败。输送线plc编号={1}", slave.getId()));
                OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F2入出库模式失败。输送线plc编号={2}", slave.getId()));
                log.error("写入输送线3F2入出库模式失败。输送线plc编号={}", slave.getId());
            }
        }