| | |
| | | * 读取状态 ====> 整块plc |
| | | */ |
| | | private void readsanqi() throws InterruptedException { |
| | | ArrayList<Integer> staNos = getStaNo(); |
| | | int staNoSize = staNos.size(); |
| | | ArrayList<Integer> staNos = staNos3; |
| | | int staNoSize = staNos3.size(); |
| | | |
| | | // |
| | | OperateResultExOne<byte[]> resultsanqi = siemensS7Net.Read("DB101.120", (short) (staNoSize * 8)); |
| | |
| | | |
| | | |
| | | //外形检测 三期 |
| | | OperateResultExOne<byte[]> resultErrsanqi = siemensS7Net.Read("DB101.160", (short) 8); |
| | | OperateResultExOne<byte[]> resultErrsanqi = siemensS7Net.Read("DB101.160", (short) (staNoSize * 8)); |
| | | if (resultErrsanqi.IsSuccess) { |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErrsanqi.Content, 0, 1); |
| | | StaProtocol staProtocol = station.get(304); |
| | | staProtocol.setFrontErr(status[0]); |
| | | staProtocol.setBackErr(status[1]); |
| | | staProtocol.setHighErr(status[2]); |
| | | staProtocol.setLeftErr(status[3]); |
| | | staProtocol.setRightErr(status[4]); |
| | | staProtocol.setWeightErr(status[5]); |
| | | staProtocol.setBarcodeErr(status[6]); |
| | | for (int i = 0; i < staNoSize; i++) { |
| | | Integer siteId = staNos.get(i); // 站点编号 |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(resultErrsanqi.Content, i * 4, 1); |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | staProtocol.setFrontErr(status[0]); |
| | | staProtocol.setBackErr(status[1]); |
| | | staProtocol.setHighErr(status[2]); |
| | | staProtocol.setLeftErr(status[3]); |
| | | staProtocol.setRightErr(status[4]); |
| | | staProtocol.setWeightErr(status[5]); |
| | | staProtocol.setBarcodeErr(status[6]); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | int index2 = 0; |
| | | if (staProtocol.getSiteId() >= 310) { |
| | | index = staNos3.indexOf(staProtocol.getSiteId()); |
| | | index2 = 54; |
| | | index2 = 66; |
| | | } else { |
| | | index = staNos.indexOf(staProtocol.getSiteId()); |
| | | } |