#
lty
3 天以前 a454c4e3e56ed63a7676348f260a240fa18be481
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -296,10 +296,10 @@
        do {
            try{
                if(!result.IsSuccess ){
                    if (!resetFlag){
//                    if (!resetFlag){
                        News.error("写入堆垛机plc数据失败,重新下发任务  写入直接失败 ===>> [id:{}],{},[写入次数:{}]", slave.getId(), JSON.toJSON(command),writeCount1);
                        result = siemensNet.Write("DB100.0", array);
                    }
//                    }
                    Thread.sleep(100);
                    writeCount1++;
                    continue;
@@ -307,6 +307,7 @@
                OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 18);
                if (resultRead.IsSuccess) {
                    CrnCommand one = new CrnCommand();
                    one.setAckFinish(siemensNet.getByteTransform().TransInt16(resultRead.Content, 0));
                    one.setTaskNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 2));
                    one.setTaskMode(siemensNet.getByteTransform().TransInt16(resultRead.Content, 4));
                    one.setSourcePosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 6));
@@ -319,6 +320,7 @@
                            || !command.getSourcePosX().equals(one.getSourcePosX()) || !command.getSourcePosY().equals(one.getSourcePosY())
                            || !command.getSourcePosZ().equals(one.getSourcePosZ()) || !command.getDestinationPosX().equals(one.getDestinationPosX())
                            || !command.getDestinationPosY().equals(one.getDestinationPosY()) || !command.getDestinationPosZ().equals(one.getDestinationPosZ())
                            || !command.getAckFinish().equals(one.getAckFinish())
                    ){
                        try{
                            News.error("堆垛机命令地址写入后回读失败==>不一致[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSON(command),JSON.toJSON(one));
@@ -335,10 +337,10 @@
                        }catch (Exception e){
                        }
                        if (!resetFlag){
//                        if (!resetFlag){
                            News.error("写入堆垛机plc数据失败,重新下发任务  回读不一致 ===>> [id:{}],{},[写入次数:{}]", slave.getId(), JSON.toJSON(command),writeCount1);
                            result = siemensNet.Write("DB100.0", array);
                        }
//                        }
                        writeCount1++;
                        continue;
                    } else {
@@ -600,7 +602,7 @@
//        if (result != null && result.IsSuccess) {
//            Thread.sleep(200);
//            this.readStatus();
////            News.info("堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
////            News.info("堆垛机命令下发[{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
//            OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command)));
//            return true;
//        } else {