| | |
| | | PlcParameter mesConfirmID =plcAgreement.getPlcParameter("mesConfirmID");//确认ID |
| | | PlcParameter mesConfirm2 =plcAgreement.getPlcParameter("mesConfirm2");//手动确认字 |
| | | PlcParameter mesConfirmID2 =plcAgreement.getPlcParameter("mesConfirmID2");//手动确认ID |
| | | |
| | | PlcParameter alarmStatus =plcAgreement.getPlcParameter("alarmStatus");//报警字 |
| | | PlcParameter machineStatusWord =plcAgreement.getPlcParameter("machineStatusWord");//设备状态字 |
| | | |
| | | // if (alarmStatus.getValueInt()>0&&!"报警".equals(machine.getStatePowerOn())){ |
| | | // machine.setStatePowerOn("报警"); |
| | | // }else if(alarmStatus.getValueInt()==0&&!"报警解除".equals(machine.getStatePowerOn())){ |
| | | // machine.setStatePowerOn("报警解除"); |
| | | // } |
| | | // if (machineStatusWord.getValueInt()!=2&&!"非联机".equals(machine.getStatePowerOn())){ |
| | | // machine.setStatePowerOn("非联机"); |
| | | // }else if(machineStatusWord.getValueInt()==2&&!"联机".equals(machine.getStatePowerOn())){ |
| | | // machine.setStatePowerOn("联机"); |
| | | // } |
| | | |
| | | if (machine.getIsLog()>0){ |
| | | modbusTcp1.consoleLogInfo(plcAgreement); |
| | | } |
| | |
| | | log.info("4、发送任务 任务数据:{}, 设备状态:{}, ",machine,tasking); |
| | | String send= |
| | | HexUtil.intTo2ByteHex(1)+ |
| | | HexUtil.intTo2ByteHex(tasking.getGlassId().intValue())+ |
| | | HexUtil.intTo2ByteHex(tasking.getTaskSequence().intValue())+ |
| | | HexUtil.intTo2ByteHex(((Double)(tasking.getLength()*10)).intValue())+ |
| | | HexUtil.intTo2ByteHex(((Double)(tasking.getWidth()*10)).intValue())+ |
| | | HexUtil.intTo2ByteHex(((Double)(tasking.getThickness()*10)).intValue()); |
| | |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String sendRecord=df.format(new Date())+" "+ |
| | | tasking.getGlassId()+"-"+ |
| | | tasking.getTaskSequence()+"-"+ |
| | | tasking.getWidth()+"-"+ |
| | | tasking.getLength()+"-"+ |
| | | tasking.getThickness(); |