lsh
2024-03-05 b93cb985259527c69a29e4bcd665ad3fa00156bb
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -209,6 +209,29 @@
                }
            }
        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> resultError = siemensS7Net.Read("DB101.800", (short) (8));
        if (resultError.IsSuccess && staNoSize==staNos2.size()) {
            ArrayList<Integer> staNoError = new ArrayList<Integer>() {{ add(217);add(221); }};
            for (int i = 0; i < staNoError.size(); i++) {
                Integer siteId = staNoError.get(i); // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
                    staProtocol = new StaProtocol();
                    staProtocol.setSiteId(siteId);
                    station.put(siteId, staProtocol);
                }
                boolean[] status = siemensS7Net.getByteTransform().TransBool(resultError.Content, i*4 + 2, 1);
                staProtocol.setFrontErr(status[0]);// 前超限
                staProtocol.setBackErr(status[1]);// 后超限
                staProtocol.setHighErr(status[2]);// 高超限
                staProtocol.setLeftErr(status[3]);// 左超限
                staProtocol.setRightErr(status[4]);// 右超限
                staProtocol.setWeightErr(status[5]); // 超重
                staProtocol.setBarcodeErr(status[6]);// 扫码失败
            }
        }
//        Thread.sleep(200);
//        OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) 186);
//        if (result0.IsSuccess) {
@@ -262,7 +285,7 @@
        Thread.sleep(200);
        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2);
        if (result3.IsSuccess && staNoSize==staNos2.size()) {
            Integer siteId = 16;
            Integer siteId = 2000;
            StaProtocol staProtocol = station.get(siteId);
            if (null == staProtocol) {
                staProtocol = new StaProtocol();
@@ -374,6 +397,9 @@
            case 135:
                index=5;
                break;
            case 147:
                index=6;
                break;
            default:
                return;
        }
@@ -429,6 +455,9 @@
            case 135:
                index=5;
                break;
            case 147:
                index=6;
                break;
            default:
                return;
        }