| | |
| | | case 2: |
| | | write((StaProtocol)task.getData()); |
| | | break; |
| | | case 3: |
| | | write1((StaProtocol)task.getData()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | |
| | | //外形检测 |
| | | Integer[] arr={401,402}; |
| | | OperateResultExOne<byte[]> resultErr1 = siemensS7Net.Read("DB101.700.0", (short) (arr.length*6)); |
| | | OperateResultExOne<byte[]> resultErr1 = siemensS7Net.Read("DB101.702.0", (short) (arr.length*6)); |
| | | for (int i = 0; i < arr.length; i++) { |
| | | StaProtocol staProtocol1 = station.get(arr[i]); |
| | | if(resultErr1.IsSuccess){ |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 扫码器触发 |
| | | */ |
| | | private void write1(StaProtocol staProtocol) throws InterruptedException { |
| | | if (null == staProtocol) { |
| | | return; |
| | | } |
| | | |
| | | int index = 0; |
| | | if(staProtocol.getSiteId() == 402){ |
| | | index = 1; |
| | | } |
| | | OperateResult writeResult1 = siemensS7Net.Write("DB100.500." + index, true); // 扫码器触发 |
| | | if (!writeResult1.IsSuccess) { |
| | | |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线站点数据失败。输送线plc编号={1},站点数据={2}", slave.getId(), JSON.toJSON(staProtocol))); |
| | | log.error("写入输送线站点数据失败。输送线plc编号={},站点数据={}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | } else { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】 输送线命令下发 [id:{1}] >>>>> {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(staProtocol))); |
| | | log.info("输送线命令下发 [id:{}] >>>>> 命令下发: {}", slave.getId(), JSON.toJSON(staProtocol)); |
| | | } |
| | | } |
| | | |
| | | // 更新入出库模式 |
| | | private void updateIoMode() throws InterruptedException { |
| | | if (this.ioModeOf2F != IoModeType.NONE) { |