| | |
| | | staProtocol.setBarcodeErr(status[6]);// 扫码失败 |
| | | } |
| | | } |
| | | // 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)); // 目标站 |
| | | // } |
| | | // } |
| | | if (slave.getId()==2){ |
| | | Thread.sleep(200); |
| | | int[] staNosRgv = {623,624,625,626}; |
| | | for (int i = 0; i < staNosRgv.length; i++) { |
| | | OperateResultExOne<byte[]> resultRgv = siemensS7Net.Read("DB100."+(1800+i*6), (short) 5); |
| | | if (resultRgv.IsSuccess) { |
| | | Integer siteId = staNosRgv[i]; // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | | staProtocol = new StaProtocol(); |
| | | staProtocol.setSiteId(siteId); |
| | | station.put(siteId, staProtocol); |
| | | } |
| | | staProtocol.setEndRow(siemensS7Net.getByteTransform().TransInt16(result.Content, 0)); // 小车目标位 |
| | | |
| | | staProtocol.setNowRow(siemensS7Net.getByteTransform().TransInt16(result.Content, 2)); // 目标站 |
| | | |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result.Content, 4, 1); |
| | | staProtocol.setRGV1(status[0]); // 自动 |
| | | staProtocol.setRGV2(status[1]); // 有物 |
| | | staProtocol.setRGV3(status[2]); // 可入 |
| | | staProtocol.setRGV4(status[3]);// 可出 |
| | | staProtocol.setRGV5(status[4]); // 空板信号 |
| | | staProtocol.setRGV6(status[5]); // 满托盘 |
| | | } |
| | | } |
| | | } |
| | | // Thread.sleep(200); |
| | | // OperateResultExOne<byte[]> result1 = siemensS7Net.Read("DB100.100", (short) (staNoSize * 2)); |
| | | // if (result1.IsSuccess) { |