自动化立体仓库 - WCS系统
luxiaotao1123
2020-08-28 e73d51083fc0407ba97078ffd5e6fb325ae7d1ef
src/main/java/com/zy/core/thread/DevpThread.java
@@ -183,7 +183,8 @@
            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)));
            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));
        }
    }
@@ -245,7 +246,13 @@
        slave.setPort(6000);
        DevpThread devpThread = new DevpThread(slave);
        devpThread.connect();
        devpThread.read();
        OperateResult d1021 = devpThread.melsecMcNet.Write("D102", (short) 234);
        if (d1021.IsSuccess) {
            System.out.println("success");
        }
        OperateResultExOne<Short> d102 = devpThread.melsecMcNet.ReadInt16("D102");
        System.out.println(d102.Content);
//        devpThread.read();
        System.out.println("第一次读");
        // 写
//        StaProtocol staProtocol = devpThread.getStation().get(1);
@@ -258,7 +265,7 @@
//        System.out.println("----------------------------------------");
        Thread.sleep(400);
        // 读
        devpThread.read();
//        devpThread.read();
        System.out.println("第二次读");
        System.out.println(JSON.toJSONString(devpThread.station));