| | |
| | | if (!basCrnpService.updateById(crnProtocol.toSqlModel(basCrnp))){ |
| | | News.error("SiemensCrn"+" - 3"+" - 堆垛机plc数据库更新失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | } |
| | | } catch (Exception ignore){} |
| | | } catch (Exception ignore) { |
| | | } |
| | | |
| | | } else { |
| | | initCrn(); |
| | |
| | | News.error("SiemensCrn"+" - 6"+" - 堆垛机写入命令为空"); |
| | | return false; |
| | | } |
| | | command.setCommand((short) 1); |
| | | System.out.println("------------------"); |
| | | System.out.println(command); |
| | | // convertRow(command); |
| | |
| | | array[11] = command.getDestinationPosXTwo(); |
| | | array[12] = command.getDestinationPosYTwo(); |
| | | array[13] = command.getDestinationPosZTwo(); |
| | | //array[14] = command.getCommand(); |
| | | array[14] = 1; |
| | | array[14] = command.getCommand(); |
| | | array[15] = command.getAckFinish(); |
| | | |
| | | // array[9] = command.getSourceStaNo(); |
| | |
| | | one.setDestinationPosX(siemensNet.getByteTransform().TransInt16(resultRead.Content, 12)); |
| | | one.setDestinationPosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 14)); |
| | | one.setDestinationPosZ(siemensNet.getByteTransform().TransInt16(resultRead.Content, 16)); |
| | | one.setSourcePosXTwo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 18)); |
| | | one.setSourcePosYTwo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 20)); |
| | | one.setSourcePosZTwo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 22)); |
| | | one.setDestinationPosXTwo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 24)); |
| | | one.setDestinationPosYTwo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 26)); |
| | | one.setDestinationPosZTwo(siemensNet.getByteTransform().TransInt16(resultRead.Content, 28)); |
| | | one.setDestinationPosY(siemensNet.getByteTransform().TransInt16(resultRead.Content, 30)); |
| | | 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()) |
| | | || !command.getSourcePosXTwo().equals(one.getSourcePosXTwo()) || !command.getSourcePosYTwo().equals(one.getSourcePosYTwo()) |
| | | || !command.getSourcePosZTwo().equals(one.getSourcePosZTwo()) || !command.getDestinationPosXTwo().equals(one.getDestinationPosXTwo()) |
| | | || !command.getDestinationPosYTwo().equals(one.getDestinationPosYTwo()) || !command.getDestinationPosZTwo().equals(one.getDestinationPosZTwo()) |
| | | ){ |
| | | try{ |
| | | log.error("堆垛机命令地址写入后回读失败==>不一致[id:{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), JSON.toJSONString(command),JSON.toJSONString(one)); |
| | |
| | | null // 修改人员 |
| | | ); |
| | | bean.save(basCrnOpt); |
| | | } catch (Exception ignore) {} |
| | | } catch (Exception ignore) { |
| | | } |
| | | |
| | | if (result != null && result.IsSuccess) { |
| | | Thread.sleep(200); |