| | |
| | | BasCrnpService basCrnpService = SpringUtils.getBean(BasCrnpService.class); |
| | | BasCrnp basCrnp = new BasCrnp(); |
| | | basCrnp.setCrnNo(slave.getId()); |
| | | basCrnp.setCrnSts((int)crnProtocol.getMode()); |
| | | if (!basCrnpService.updateById(crnProtocol.toSqlModel(basCrnp))){ |
| | | log.error("堆垛机plc数据库更新失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()); |
| | | } |
| | |
| | | array[7] = command.getSourceStaNo(); |
| | | array[8] = command.getDestinationStaNo(); |
| | | // 作业信息 |
| | | OperateResult result = siemensNet.Write("DB1000.0", array); |
| | | OperateResult result = siemensNet.Write("DB10.0", array); |
| | | // 任务号 + 完成位 |
| | | short[] array2 = new short[2]; |
| | | array2[0] = command.getTaskNo(); |
| | | array2[1] = command.getAckFinish(); |
| | | OperateResult result1 = siemensNet.Write("DB1000.24", array2); |
| | | OperateResult result1 = siemensNet.Write("DB10.24", array2); |
| | | |
| | | // 结束位 |
| | | if (command.getAckFinish() == 0) { |
| | | OperateResult result2 = siemensNet.Write("DB1000.28.1", true); |
| | | OperateResult result2 = siemensNet.Write("DB10.28.1", true); |
| | | } |
| | | |
| | | // 日志记录 |