cpT
2025-07-01 094183c425fd1fd58b7b006247558fe97dd449b8
#改造
2个文件已修改
41 ■■■■ 已修改文件
src/main/java/com/zy/core/thread/SiemensCrnThread.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -138,7 +138,11 @@
        crnProtocol.setyDistance((short) 0);
        crnProtocol.setxDuration((short) 0);
        crnProtocol.setyDuration((short) 0);
        CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "离线");
        try{
            CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "离线");
        } catch (Exception e1){
        }
    }
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -352,7 +352,6 @@
//        Thread.sleep(50);
        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB400.148.0",(short) (staW.length*4));
        OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.922.0",(short) (staW.length*4));
        if (result3.IsSuccess) {
            for (int i = 0; i < staW.length; i++) {
                Integer siteId = staW[i]; // 站点编号
@@ -370,18 +369,34 @@
                staProtocol.setRightErr(status[4]); // 右超限
                staProtocol.setWeightErr(status[5]); // 超重
                staProtocol.setBarcodeErr(status[6]); // 扫码失败
                if (resultErr.IsSuccess){
                    boolean[] statusErr = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i*4 + 2, 2);
            }
        }
        try{
            OperateResultExOne<byte[]> resultErr = siemensS7Net.Read("DB101.922.0",(short) (staNoSize*4));
            if (resultErr.IsSuccess){
                for (int i = 0; i < staNoSize; i++) {
                    Integer siteId = staNos.get(i); // 站点编号
                    StaProtocol staProtocol = station.get(siteId);
                    if (null == staProtocol) {
                        staProtocol = new StaProtocol();
                        staProtocol.setSiteId(siteId);
                        station.put(siteId, staProtocol);
                    }
                    staProtocol.setSiteId(siteId);
                    boolean[] statusErr = siemensS7Net.getByteTransform().TransBool(resultErr.Content, i*4, 1);
                    staProtocol.setErrOther1(statusErr[0]);  // 电路保护器断开
                    staProtocol.setErrOther1(statusErr[1]);  // 光电异常
                    staProtocol.setErrOther1(statusErr[2]);  // 运行超时
                    staProtocol.setErrOther1(statusErr[3]);  // 占位超时
                    staProtocol.setErrOther1(statusErr[4]);  // 有任务无货故障
                    staProtocol.setErrOther1(statusErr[5]);  // 变频器故障
                    staProtocol.setErrOther1(statusErr[6]);  // 接触器故障
                    staProtocol.setErrOther1(statusErr[7]);  // 顶升电机接触器故障
                    staProtocol.setErrOther2(statusErr[1]);  // 光电异常
                    staProtocol.setErrOther3(statusErr[2]);  // 运行超时
                    staProtocol.setErrOther4(statusErr[3]);  // 占位超时
                    staProtocol.setErrOther5(statusErr[4]);  // 有任务无货故障
                    staProtocol.setErrOther6(statusErr[5]);  // 变频器故障
                    staProtocol.setErrOther7(statusErr[6]);  // 接触器故障
                    staProtocol.setErrOther8(statusErr[7]);  // 顶升电机接触器故障
                }
            }
        } catch (Exception e){
        }
        if (result.IsSuccess) {