自动化立体仓库 - WCS系统
#
18516761980
2022-08-16 ca02d097a870ebee2935215f6c187d34fe08c8a9
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -141,20 +141,7 @@
                staProtocol.setStaNo(siemensS7Net.getByteTransform().TransInt16(result.Content, i*4 + 2));   // 目标站
            }
        }
//        Thread.sleep(200);
//        OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB101.0", (short) 186);
//        if (result0.IsSuccess) {
//            for (int i = 0; i < 93; 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.setStaNo(siemensS7Net.getByteTransform().TransInt16(result0.Content, i*2));   // 目标站
//            }
//        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB100.100", (short) (staNoSize));
        if (result1.IsSuccess) {
@@ -177,8 +164,9 @@
            }
        }
        //条码
        Thread.sleep(200);
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.150",(short)(barcodeSize*8));
        OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.160",(short)4);
        if (result2.IsSuccess) {
            for (int i = 0; i < barcodeSize; i++) {
                String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,8, "UTF-8");
@@ -190,6 +178,22 @@
        }
        //RGV台车位置
        Thread.sleep(200);
        OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.150",(short)(barcodeSize*8));
        if (result3.IsSuccess) {
            for (int i = 0; i < 2; i++) {
                Integer siteId = i==0 ? 112 : 212; // 站点编号
                StaProtocol staProtocol = station.get(siteId);
                if (null == staProtocol) {
                    staProtocol = new StaProtocol();
                    staProtocol.setSiteId(siteId);
                    station.put(siteId, staProtocol);
                }
                staProtocol.setNearbySta(String.valueOf(siemensS7Net.getByteTransform().TransInt16(result.Content, i*2)));
            }
        }
//        OperateResultExOne<Short> result2 = siemensS7Net.ReadInt16("DB200.0");
//        if (result2.IsSuccess) {
//            this.ioMode = IoModeType.get(result2.Content);