zwl
3 天以前 7f1ee24bca80d28851a95ee2019ea6faeb70d81c
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -131,6 +131,9 @@
                    case 2:
                        write((StaProtocol)task.getData());
                        break;
                    case 3:
                        write1((StaProtocol)task.getData());
                        break;
                    default:
                        break;
                }
@@ -340,6 +343,29 @@
        }
    }
    /**
     * 扫码器触发
     */
    private void write1(StaProtocol staProtocol) throws InterruptedException {
        if (null == staProtocol) {
            return;
        }
        ArrayList<Integer> staNos = getStaNo();
        int index = staNos.indexOf(staProtocol.getSiteId());
        if(staProtocol.getSiteId() == 307){
            index = 0;
        }
        OperateResult writeResult1 = siemensS7Net.Write("DB100.500" + index,  1);    // 扫码器触发
        if (!writeResult1.IsSuccess) {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线站点数据失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol)));
            log.error("写入输送线站点数据失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol));
        } else {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol)));
            log.info("输送线命令下发 [id:{}] >>>>> 命令下发: {}",  slave.getId(), JSON.toJSON(staProtocol));
        }
    }
    // 更新入出库模式
    private void updateIoMode() throws InterruptedException {
        if (this.ioModeOf2F != IoModeType.NONE) {