| | |
| | | * 读取状态 ====> 整块plc |
| | | */ |
| | | private void read() throws InterruptedException { |
| | | // 更新入出库模式 |
| | | updateIoMode(); |
| | | |
| | | ArrayList<Integer> staNos = getStaNo(); |
| | | int staNoSize = staNos.size(); |
| | |
| | | } |
| | | int i = barcodeSite2.indexOf(staProtocol.getSiteId()); |
| | | if (i != -1) { |
| | | heightAddress = "DB104." + (i * 4); |
| | | heightAddress = "DB104." + (i * 2); |
| | | } |
| | | |
| | | OperateResult writeResult; |
| | |
| | | // 更新入出库模式 |
| | | private void updateIoMode() throws InterruptedException { |
| | | if (slave.getId() == 1 && this.ioModeOf1F1 != null) { |
| | | if (!siemensS7Net.Write("DB4.2", this.ioModeOf1F1.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线21F1入出库模式失败。输送线plc编号={2}", slave.getId())); |
| | | if (!siemensS7Net.Write("DB105.0", this.ioModeOf1F1.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线21F1入出库模式失败。输送线plc编号={1}", slave.getId())); |
| | | log.error("写入输送线1F1入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | if (slave.getId() == 1 && this.ioModeOf1F2 != null) { |
| | | if (!siemensS7Net.Write("DB105.2", this.ioModeOf1F2.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2F2入出库模式失败。输送线plc编号={1}", slave.getId())); |
| | | log.error("写入输送线1F2入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | if (slave.getId() == 1 && this.ioModeOf1F3 != null) { |
| | | if (!siemensS7Net.Write("DB105.4", this.ioModeOf1F3.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F1入出库模式失败。输送线plc编号={1}", slave.getId())); |
| | | log.error("写入输送线1F3入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | if (slave.getId() == 1 && this.ioModeOf1F4 != null) { |
| | | if (!siemensS7Net.Write("DB105.6", this.ioModeOf1F4.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F2入出库模式失败。输送线plc编号={1}", slave.getId())); |
| | | log.error("写入输送线1F4入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | if (slave.getId() == 1 && this.ioModeOf1F5 != null) { |
| | | if (!siemensS7Net.Write("DB105.8", this.ioModeOf1F5.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F2入出库模式失败。输送线plc编号={1}", slave.getId())); |
| | | log.error("写入输送线1F5入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (slave.getId() == 1 && this.ioModeOf2F1 != null) { |
| | | if (!siemensS7Net.Write("DB105.10", this.ioModeOf2F1.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2F2入出库模式失败。输送线plc编号={1}", slave.getId())); |
| | | log.error("写入输送线2F1入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | if (slave.getId() == 1 && this.ioModeOf1F2 != null) { |
| | | if (!siemensS7Net.Write("DB4.4", this.ioModeOf1F2.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线2F2入出库模式失败。输送线plc编号={3}", slave.getId())); |
| | | if (slave.getId() == 1 && this.ioModeOf2F2 != null) { |
| | | if (!siemensS7Net.Write("DB105.12", this.ioModeOf2F2.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F1入出库模式失败。输送线plc编号={1}", slave.getId())); |
| | | log.error("写入输送线2F2入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | if (slave.getId() == 1 && this.ioModeOf1F2 != null) { |
| | | if (!siemensS7Net.Write("DB4.2", this.ioModeOf1F2.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F1入出库模式失败。输送线plc编号={2}", slave.getId())); |
| | | log.error("写入输送线3F1入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | if (slave.getId() == 1 && this.ioModeOf1F2 != null) { |
| | | if (!siemensS7Net.Write("DB4.4", this.ioModeOf1F2.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F2入出库模式失败。输送线plc编号={3}", slave.getId())); |
| | | log.error("写入输送线3F2入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | if (slave.getId() == 1 && this.ioModeOf2F3 != null) { |
| | | if (!siemensS7Net.Write("DB105.14", this.ioModeOf2F3.id).IsSuccess) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】写入输送线3F2入出库模式失败。输送线plc编号={1}", slave.getId())); |
| | | log.error("写入输送线2F3入出库模式失败。输送线plc编号={}", slave.getId()); |
| | | } |
| | | } |
| | | } |