#
yxFwq
2 天以前 123a6f57a1e52980b323de65e5642148e4348ff3
#
2个文件已修改
39 ■■■■ 已修改文件
src/main/java/com/zy/core/thread/RgvThread.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SteThread.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/RgvThread.java
@@ -101,6 +101,15 @@
    private void readStatusRgv() {
        while (true) {
            try {
                if(!connectRgv){
                    try {
                        Thread.sleep(1000L);
                    } catch (Exception e){
                    }
                    initRgv();
                    continue;
                }
                Thread.sleep(50);
                readStatus();
@@ -123,6 +132,14 @@
    private void taskIssued() {
        while (true) {
            try {
                if(!connectRgv){
                    try {
                        Thread.sleep(1000L);
                    } catch (Exception e){
                    }
                    continue;
                }
                int step = 1;
                Task task = MessageQueue.poll(SlaveType.Rgv, slave.getId());
                if (task != null) {
@@ -355,7 +372,7 @@
        if (command.getAckFinish1() == 0 && command.getAckFinish2() == 0) {
            short commandFinish = 3;  //工位1、2任务同时写入
            Thread.sleep(100L);
            Thread.sleep(50L);
            result = siemensNet.Write("DB100.20", commandFinish);
        }
@@ -380,8 +397,8 @@
        } catch (Exception ignore) {}
        if (result != null && result.IsSuccess) {
            Thread.sleep(200);
            this.readStatus();
//            Thread.sleep(200);
//            this.readStatus();
            log.info("RGV 命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
            OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command)));
            return true;
@@ -416,7 +433,7 @@
        if (command.getAckFinish1() == 0) {
            short commandFinish = 1;  //工位1任务写入
            Thread.sleep(100L);
            Thread.sleep(20L);
            result = siemensNet.Write("DB100.20", commandFinish);
        }
@@ -441,8 +458,8 @@
        } catch (Exception ignore) {}
        if (result != null && result.IsSuccess) {
            Thread.sleep(200);
            this.readStatus();
//            Thread.sleep(200);
//            this.readStatus();
            log.info("RGV 工位1命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSONString(command));
            OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 工位1命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSONString(command)));
            return true;
@@ -475,7 +492,7 @@
        if (command.getAckFinish2() == 0) {
            short commandFinish = 2;  //工位2任务写入
            Thread.sleep(100L);
            Thread.sleep(20L);
            result = siemensNet.Write("DB100.20", commandFinish);
        }
@@ -500,8 +517,8 @@
        } catch (Exception ignore) {}
        if (result != null && result.IsSuccess) {
            Thread.sleep(200);
            this.readStatus();
//            Thread.sleep(200);
//            this.readStatus();
            log.info("RGV 工位2命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSONString(command));
            OutputQueue.RGV.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 工位2命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSONString(command)));
            return true;
src/main/java/com/zy/core/thread/SteThread.java
@@ -299,7 +299,7 @@
            // 1.任务号
            OperateResult result0 = siemensS7Net.Write("DB100.2", command.getTaskNo().shortValue());
            try {
                Thread.sleep(200);
                Thread.sleep(50);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
@@ -315,7 +315,7 @@
                    result = siemensS7Net.Write("DB100.16.0", true);
                    try {
                        Thread.sleep(300);
                        Thread.sleep(50);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }