| | |
| | | crnProtocol.setyDistance((short) 0); |
| | | crnProtocol.setxDuration((short) 0); |
| | | crnProtocol.setyDuration((short) 0); |
| | | CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "离线"); |
| | | try{ |
| | | CrnErrCache.updateCrnErr(crnProtocol.getCrnNo(), "离线"); |
| | | } catch (Exception e1){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | deviceErrorService.addDeviceError("crnWrite", slave.getId(), "巷道号"+command.getLaneNo()+";堆垛机指令下发:"+JSON.toJSONString(command.getNowTask())); |
| | | } catch (Exception e2){ |
| | | } |
| | | try{ |
| | | BasErrLogService basErrLogService = SpringUtils.getBean(BasErrLogService.class); |
| | | BasErrLog basErrLog = new BasErrLog(command,"","任务下发记录"); |
| | | if (!basErrLogService.insert(basErrLog)) { |
| | | log.error("堆垛机plc异常记录失败 ===>> [id:{}] [error:{}]", slave.getId(), "任务下发记录失败"); |
| | | } |
| | | } catch (Exception e3){ |
| | | } |
| | | // try{ |
| | | // BasErrLogService basErrLogService = SpringUtils.getBean(BasErrLogService.class); |
| | | // BasErrLog basErrLog = new BasErrLog(command,"","任务下发记录"); |
| | | // if (!basErrLogService.insert(basErrLog)) { |
| | | // log.error("堆垛机plc异常记录失败 ===>> [id:{}] [error:{}]", slave.getId(), "任务下发记录失败"); |
| | | // } |
| | | // } catch (Exception e3){ |
| | | // } |
| | | // convertRow(command); |
| | | command.setCrnNo(slave.getId()); |
| | | short[] array = new short[10]; |
| | |
| | | array[6] = command.getDestinationPosX(); |
| | | array[7] = command.getDestinationPosY(); |
| | | array[8] = command.getDestinationPosZ(); |
| | | array[9] = command.getCommand(); |
| | | // array[9] = command.getCommand(); |
| | | array[9] = (short)0; |
| | | OperateResult result18 = siemensNet.Write("DB100.18", (short)0); |
| | | try{ |
| | | Thread.sleep(50L); |
| | |
| | | try{ |
| | | Thread.sleep(100L); |
| | | } catch (Exception e){} |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB101.0", (short) 4); |
| | | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 20); |
| | | if (resultRead.IsSuccess) { |
| | | CrnCommand one = new CrnCommand(); |
| | | one.setTaskNo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 2)); |
| | | one.setTaskMode(siemensNet.getByteTransform().TransInt16(resultRead.Content, 4)); |
| | | one.setSourcePosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 6)); |
| | | one.setSourcePosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 8)); |
| | | one.setSourcePosZ(siemensNet.getByteTransform().TransInt16(resultRead.Content, 10)); |
| | | one.setDestinationPosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 12)); |
| | | one.setDestinationPosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 14)); |
| | | one.setDestinationPosZ(siemensNet.getByteTransform().TransInt16(resultRead.Content, 16)); |
| | | if (!command.getTaskNo().equals(one.getTaskNo()) |
| | | || !command.getTaskMode().equals(one.getTaskMode()) |
| | | || !command.getSourcePosX().equals(one.getSourcePosX()) |
| | | || !command.getSourcePosY().equals(one.getSourcePosY()) |
| | | || !command.getSourcePosZ().equals(one.getSourcePosZ()) |
| | | || !command.getDestinationPosX().equals(one.getDestinationPosX()) |
| | | || !command.getDestinationPosY().equals(one.getDestinationPosY()) |
| | | || !command.getDestinationPosZ().equals(one.getDestinationPosZ()) |
| | | ){ |
| | | i++; |
| | | CrnErrCache.updateCrnErr(slave.getId(), "堆垛机命令地址写入后回读失败"); |
| | |
| | | |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("crnErr", slave.getId(), "巷道号"+command.getLaneNo()+";写入次数"+i+";堆垛机命令地址写入后回读失败:"+JSON.toJSONString(command.getNowTask())); |
| | | deviceErrorService.addDeviceError("CrnErr", slave.getId(), "巷道号"+command.getLaneNo()+";写入次数"+i+";堆垛机命令地址写入后回读失败:"+JSON.toJSONString(command.getNowTask())); |
| | | } catch (Exception e2){ |
| | | } |
| | | try{ |
| | |
| | | CrnErrCache.updateCrnErr(slave.getId(), "下发DB100.18 回读失败"); |
| | | try{ |
| | | DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class); |
| | | deviceErrorService.addDeviceError("crnErr", slave.getId(), "巷道号"+command.getLaneNo()+";写入次数"+signFinish+";下发DB100.18 回读失败:"+JSON.toJSONString(command.getNowTask())); |
| | | deviceErrorService.addDeviceError("CrnErr", slave.getId(), "巷道号"+command.getLaneNo()+";写入次数"+signFinish+";下发DB100.18 回读失败:"+JSON.toJSONString(command.getNowTask())); |
| | | } catch (Exception e2){ |
| | | } |
| | | try{ |