luxiaotao1123
2020-08-27 c422d0d7da0d26f39cd40f9070311ffbb2f9c009
src/main/java/com/zy/core/thread/DevpThread.java
@@ -128,6 +128,10 @@
                staProtocol.setInEnable(result1.Content[(i-1)*8+2]); // 可入
                staProtocol.setOutEnable(result1.Content[(i-1)*8+3]);// 可出
                staProtocol.setEmptyMk(result1.Content[(i-1)*8+4]);  // 空板信号
                if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
                    staProtocol.setPakMk(true);
                }
            }
        }
        if (result.IsSuccess && result1.IsSuccess) {
@@ -158,11 +162,12 @@
    /**
     * 写入 ID+目标站 =====> 单站点写入
     */
    private void write(StaProtocol staProtocol){
    private void write(StaProtocol staProtocol) throws InterruptedException {
        if (null == staProtocol) {
            return;
        }
        OperateResult write = melsecMcNet.Write("D10" + staProtocol.getSiteId(), staProtocol.getWorkNo());    // 工作号
        Thread.sleep(100);
        OperateResult write1 = melsecMcNet.Write("D12" + staProtocol.getSiteId(), staProtocol.getStaNo());    // 目标站
//        boolean[] status = new boolean[8];
//        status[0] = staProtocol.isAutoing();
@@ -172,6 +177,9 @@
//        status[4] = staProtocol.isEmptyMk();
//        OperateResult write2 = siemensS7Net.Write("DB100." + ((staProtocol.getSiteId() - 1) + 40), status);     //  状态
        if (!write.IsSuccess || !write1.IsSuccess) {
            if (staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0) {
                staProtocol.setPakMk(true);
            }
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线站点数据失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol)));
            log.error("写入输送线站点数据失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol));
        } else {