| | |
| | | log.info("errmsg: " + errMsg); |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | MessageQueue.offer(SlaveType.Led, inSta.getLed(), new Task(3, errMsg)); |
| | | |
| | | if (!staProtocol.isLoading()) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | // 获取条码扫描仪信息 |
| | | //BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, inSta.getBarcode()); |
| | | if (barcodeThread == null) { |
| | | continue; |
| | | } |
| | | // 获取入库站信息 |
| | | //SiemensDevpThread devpThread = (SiemensDevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | //StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | |
| | | |
| | | //LED |
| | | //LedThread ledThread = (LedThread) SlaveConnection.get(SlaveType.Led, inSta.getLed()); |
| | |
| | | OperateResultExOne<byte[]> readResult = siemensS7Net.Read("DB100." + index * 6, (short) 4); |
| | | OperateResultExOne<byte[]> readResult1 = siemensS7Net.Read("DB100." + (index * 6 + 4), (short) 2); |
| | | if (readResult.IsSuccess && readResult1.IsSuccess) { |
| | | short workNo = siemensS7Net.getByteTransform().TransInt16(readResult.Content, 4); |
| | | short staNo = siemensS7Net.getByteTransform().TransInt16(readResult1.Content, 2); |
| | | short workNo = (short) siemensS7Net.getByteTransform().TransInt32(readResult.Content, 0); |
| | | short staNo = siemensS7Net.getByteTransform().TransInt16(readResult1.Content, 0); |
| | | if (staProtocol.getWorkNo().equals(workNo) && staProtocol.getStaNo().equals(staNo)) { |
| | | //任务命令写入成功 |
| | | log.info("写入堆垛机命令后返回成功,并且回读成功。堆垛机plc编号={},{},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |