#
tqs
2024-08-30 01a6b6e2681b35b2d23ade80cf5d35b1c5946141
#
1个文件已修改
54 ■■■■■ 已修改文件
src/main/java/com/zy/core/thread/SiemensDevpThread.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -194,7 +194,7 @@
//        updateIoMode();
        ArrayList<Integer> staNos = getStaNo();
        int staNoSize = staNos.size();
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) (staNoSize * 4));
        OperateResultExOne<byte[]> result = siemensS7Net.Read("DB101.0", (short) (staNoSize * 8));
//        OperateResultExOne<byte[]> result4 = siemensS7Net.Read("DB100.2", (short) (staNoSize*2));
        if (result.IsSuccess) {
            for (int i = 0; i < staNoSize; i++) {
@@ -205,19 +205,11 @@
                    staProtocol.setSiteId(siteId);
                    station.put(siteId, staProtocol);
                }
                staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i * 4));     // 工作号
                staProtocol.setWorkNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i * 8));     // 工作号
                staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i * 4 + 2));   // 目标站
            }
        }
                staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i * 8 + 4));   // 目标站
        Thread.sleep(200);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB101.6", (short) (staNoSize * 4));
        if (result1.IsSuccess) {
            for (int i = 0; i < staNoSize; i++) {
                Integer siteId = staNos.get(i); // 站点编号
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i * 4, 1);
                StaProtocol staProtocol = station.get(siteId);
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result.Content, i * 8 + 6, 2); //状态
                staProtocol.setAutoing(status[0]);  // 自动
                staProtocol.setLoading(status[1]);  // 有物
                staProtocol.setInEnable(status[2]); // 可入
@@ -230,15 +222,37 @@
                if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
                    staProtocol.setPakMk(true);
                }
            }
        }
                if (staProtocol.getStamp() >= 2 && !staProtocol.isLoading()) {
                    staProtocol.setStamp(0);
                } else if (staProtocol.getStamp() < 2 && staProtocol.isLoading()) {
                    //lfd入库印记  当stamp>=2时才入库
                    staProtocol.setStamp(staProtocol.getStamp() + 1);
                }
            }
        }
//        Thread.sleep(200);
//        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB101.6", (short) (staNoSize * 4));
//        if (result1.IsSuccess) {
//            for (int i = 0; i < staNoSize; i++) {
//                Integer siteId = staNos.get(i); // 站点编号
//                boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i * 4, 1);
//                StaProtocol staProtocol = station.get(siteId);
//                staProtocol.setAutoing(status[0]);  // 自动
//                staProtocol.setLoading(status[1]);  // 有物
//                staProtocol.setInEnable(status[2]); // 可入
//                staProtocol.setOutEnable(status[3]);// 可出
//                staProtocol.setEmptyMk(status[4]);  // 空板信号
//                staProtocol.setFullPlt(status[5]);  // 满托盘
//                staProtocol.setHigh(status[6]);     // 高库位
//                staProtocol.setLow(status[7]);      // 低库位
//
//                if (!staProtocol.isPakMk() && !staProtocol.isLoading()) {
//                    staProtocol.setPakMk(true);
//                }
//
//                if (staProtocol.getStamp() >= 2 && !staProtocol.isLoading()) {
//                    staProtocol.setStamp(0);
//                } else if (staProtocol.getStamp() < 2 && staProtocol.isLoading()) {
//                    //lfd入库印记  当stamp>=2时才入库
//                    staProtocol.setStamp(staProtocol.getStamp() + 1);
//                }
//            }
//        }
//        Thread.sleep(200);
//        OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) 186);