#
whycq
2025-05-28 78489da7e2185f53faaec9356fa1a8997cedab70
src/main/java/com/zy/core/thread/MelsecCrnThread.java
@@ -234,6 +234,8 @@
     * 写入数据
     */
    private boolean write(CrnCommand command){
        String methodName = Thread.currentThread().getStackTrace()[1].getMethodName();
        if (null == command) {
            News.error("堆垛机写入命令为空");
            return false;
@@ -330,12 +332,12 @@
        } catch (Exception ignore) {}
        if (result != null && result.IsSuccess) {
            News.info("堆垛机命令下发[id:{}] >>>>> {}", slave.getId(), JSON.toJSON(command));
            News.info(methodName + ":堆垛机命令下发[id:{}] >>>>> {}", 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 {
            OutputQueue.CRN.offer(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort()));
            News.error("写入堆垛机plc数据失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
            News.error(methodName + ":写入堆垛机plc数据失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
            return false;
        }
    }