| | |
| | | } |
| | | } |
| | | } |
| | | // 台车位置 |
| | | OperateResultExOne<Short> result2 = siemensS7Net.ReadInt16("DB100.48"); |
| | | if (result2.IsSuccess) { |
| | | StaProtocol staProtocol = station.get(8); |
| | | staProtocol.setPosition(result2.Content); |
| | | } else { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】8号台车获取实时位置失败!!!", DateUtils.convert(new Date()))); |
| | | log.error("8号台车获取实时位置失败!!!"); |
| | | } |
| | | |
| | | if (result.IsSuccess && result1.IsSuccess) { |
| | | |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId())); |
| | |
| | | return; |
| | | } |
| | | OperateResult write = siemensS7Net.Write("DB100." + (staProtocol.getSiteId() - 1) * 2, staProtocol.getWorkNo()); // 工作号 |
| | | Thread.sleep(100); |
| | | Thread.sleep(300); |
| | | OperateResult write1 = siemensS7Net.Write("DB100." + ((staProtocol.getSiteId() - 1) * 2 + 20), staProtocol.getStaNo()); // 目标站 |
| | | // boolean[] status = new boolean[8]; |
| | | // status[0] = staProtocol.isAutoing(); |
| | |
| | | // status[4] = staProtocol.isEmptyMk(); |
| | | // OperateResult write2 = siemensS7Net.Write("DB100." + ((staProtocol.getSiteId() - 1) + 40), status); // 状态 |
| | | if (!write.IsSuccess || !write1.IsSuccess) { |
| | | staProtocol = station.get(staProtocol.getSiteId()); |
| | | if (staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0) { |
| | | staProtocol.setPakMk(true); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置入库标记 |
| | | */ |
| | | public void setPakMk(Integer siteId, boolean pakMk) { |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null != staProtocol) { |
| | | staProtocol.setPakMk(pakMk); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void close() { |
| | | siemensS7Net.ConnectClose(); |