自动化立体仓库 - WCS系统
#
luxiaotao1123
2022-09-19 ccbcfdb4241951a36c1d2fe1e0bca6e8b8deb719
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -142,10 +142,11 @@
     */
    private void readStatus(){
        try {
            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 70);
            OperateResultExOne<byte[]> result = siemensNet.Read("DB101.0", (short) 56);
            if (result.IsSuccess) {
                if (null == crnProtocol) {
                    crnProtocol = new CrnProtocol();
                    crnProtocol.setCrnNo(this.getSlave().getId());
                }
                crnProtocol.setMode(siemensNet.getByteTransform().TransInt16(result.Content, 0));
                crnProtocol.setTaskNo(siemensNet.getByteTransform().TransInt16(result.Content, 2));
@@ -224,7 +225,7 @@
        }
//        convertRow(command);
        command.setCrnNo(slave.getId());
        short[] array = new short[12];
        short[] array = new short[10];
        array[0] = command.getAckFinish();
        array[1] = command.getTaskNo();
        array[2] = command.getTaskMode();
@@ -234,15 +235,13 @@
        array[6] = command.getDestinationPosX();
        array[7] = command.getDestinationPosY();
        array[8] = command.getDestinationPosZ();
        array[9] = command.getSourceStaNo();
        array[10] = command.getDestinationStaNo();
        array[11] = command.getCommand();
        array[9] = command.getCommand();
        OperateResult result = siemensNet.Write("DB100.0", array);
        if (command.getAckFinish() == 0) {
            short commandFinish = 1;
            Thread.sleep(100);
            result = siemensNet.Write("DB100.22", commandFinish);
            result = siemensNet.Write("DB100.18", commandFinish);
        }
        try {
@@ -270,7 +269,7 @@
        if (result != null && result.IsSuccess) {
            Thread.sleep(200);
            this.readStatus();
//            this.readStatus();
            log.info("堆垛机命令下发[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;