自动化立体仓库 - WCS系统
#
whycq
2022-11-28 3ab7b0a81b52270edaedfdfe0b2c2ca652d41e39
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -56,7 +56,7 @@
    /**
     * 条码数量
     */
    private int barcodeSize = 3;
    private int barcodeSize = 4;
    /**
     * 入出库模式
@@ -204,23 +204,47 @@
//            }
//        }
        Thread.sleep(200);
        OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB100.100", (short) (staNoSize));
        if (result1.IsSuccess) {
            for (int i = 0; i < staNoSize; i++) {
                Integer siteId = staNos.get(i); // 站点编号
                boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i, 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]);      // 低库位
        OperateResultExOne<byte[]> result1 = null;
        if(slave.getId()==1) {
            result1 = siemensS7Net.Read("DB100.100", (short) (staNoSize));
            if (result1.IsSuccess) {
                for (int i = 0; i < staNoSize; i++) {
                    Integer siteId = staNos.get(i); // 站点编号
                    boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i, 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.isPakMk() && !staProtocol.isLoading()) {
                        staProtocol.setPakMk(true);
                    }
                }
            }
        } else if(slave.getId()==2) {
            result1 = siemensS7Net.Read("DB100.100", (short) (staNoSize * 2));
            if (result1.IsSuccess) {
                for (int i = 0; i < staNoSize; i++) {
                    Integer siteId = staNos.get(i); // 站点编号
                    boolean[] status = siemensS7Net.getByteTransform().TransBool(result1.Content, i * 2, 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);
                    }
                }
            }
        }
@@ -243,7 +267,7 @@
//            this.ioMode = IoModeType.get(result2.Content);
//        }
        if (result.IsSuccess && result1.IsSuccess) {
        if (result.IsSuccess && !Cools.isEmpty(result1) && result1.IsSuccess) {
            OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId()));