#
lsh
2024-03-20 2831a88603cf5e7548f586d01c64adcdf8d82b70
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -262,6 +262,34 @@
            }
        }
        OperateResultExOne<byte[]> resultAgvAndPlcOk = siemensS7Net.Read("DB102.0", (short) 30);
        if (resultAgvAndPlcOk.IsSuccess) {
            for (int i = 0; i < staNoSize; i++) {
                int sign =(i+2)/2-1;
                if ((i+2)%2!=0){
                    Integer siteId = staNos.get(i); // 站点编号
                    StaProtocol staProtocol = station.get(siteId);
                    if (null == staProtocol) {
                        staProtocol = new StaProtocol();
                        staProtocol.setSiteId(siteId);
                        station.put(siteId, staProtocol);
                    }
                    staProtocol.setAgvTargetPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6+4));     // 允许取货
                    staProtocol.setAgvTargetPlace((short)0);   // 允许放货
                    continue;
                }
                Integer siteId = staNos.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
                    staProtocol = new StaProtocol();
                    staProtocol.setSiteId(siteId);
                    station.put(siteId, staProtocol);
                }
                staProtocol.setAgvTargetPick(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6));     // 允许取货
                staProtocol.setAgvTargetPlace(siemensS7Net.getByteTransform().TransInt16(resultAgvAndPlc.Content, sign*6 + 2));   // 允许放货
            }
        }
        if (slave.getId() == 1) {
            //条码
@@ -465,7 +493,8 @@
                taskWrk.setCommandStep(taskWrk.getCommandStep() + 1);//更新指令步序
                taskWrkService.updateById(taskWrk);
            }else{
                log.error("输送线写入失败"+staProtocol+"++++++++++++++++++++++++++++++++++++++");
                log.error(staProtocol+"++++++++++++++++++++++++++++++++++++++");
//                log.error("输送线写入失败"+staProtocol+"++++++++++++++++++++++++++++++++++++++");
            }
        }