| | |
| | | String send= HexUtil.intTo2ByteHex(0); |
| | | modbusTcp1.writeString(send,HexUtil.intTo2ByteHex(mesSend.getAddressStart()/2)); |
| | | log.info("发送字 清空成功;内容:{},发送起始地址:{}",send,HexUtil.intTo2ByteHex(mesSend.getAddressStart())); |
| | | errorMachine(machine,""); |
| | | modbusTcp1.close(); |
| | | return; |
| | | } |
| | |
| | | modbusTcp1.close(); |
| | | return; |
| | | } |
| | | if(1==plcReport.getValueInt()&&0==mesConfirm.getValueInt()){ |
| | | if((1==plcReport.getValueInt()&&0==mesConfirm.getValueInt())){ |
| | | int finishCount=taskingService.finishMachineTask(machine); |
| | | log.info("3、任务完成"); |
| | | if(finishCount>0) {//有任务 |
| | |
| | | } |
| | | List<Tasking> taskingCount=taskingService.findMachineWorkStateTask(machine,"正在工作"); |
| | | |
| | | if((1==plcRequest.getValueInt()&&0==mesSend.getValueInt()) |
| | | if(((1==plcRequest.getValueInt()&&0==mesSend.getValueInt()) |
| | | &&"开工".equals(machine.getState()) |
| | | &&taskingCount.size()<machine.getMaxTaskCount()){ |
| | | &&taskingCount.size()<machine.getMaxTaskCount())){ |
| | | Machine loadMachine=machineMapper.selectById(2L); |
| | | Tasking tasking; |
| | | String scan_id=""; |
| | |
| | | }else{ |
| | | //定制模式 |
| | | String PlcRequestID_=clientTCPSocket(); |
| | | //String PlcRequestID_=",,46607221"; |
| | | //String PlcRequestID_=",,46408889"; |
| | | if (PlcRequestID_==null||PlcRequestID_.lastIndexOf(",")<0){ |
| | | modbusTcp1.close(); |
| | | errorMachine(machine,("扫不到码:"+PlcRequestID_)); |