| | |
| | | |
| | | jarProtocol.setAutoing(siemensS7Net.getByteTransform().TransInt16(result.Content, 12) == 2);//自动 |
| | | |
| | | // if (jarProtocol.statusType .equals(JarStatusType.SOS)){ |
| | | // jarProtocol.setHoldingSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus())); |
| | | // } else |
| | | if (jarProtocol.statusType .equals(JarStatusType.SOS2)){ |
| | | jarProtocol.setHoldingSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus())); |
| | | if (!jarProtocol.rightDoorClose.equals(jarProtocol.leftDoorClose)) { |
| | | if (jarProtocol.rightDoorClose == 0 || jarProtocol.leftDoorClose == 0){ |
| | | if (jarProtocol.rightDoorClose == 2 || jarProtocol.leftDoorClose == 2){ |
| | | jarProtocol.setLeftDoorClose(0);//close the left door //进料门 |
| | | jarProtocol.setRightDoorClose(0);//close the right door //出料门 |
| | | } |
| | | } |
| | | if (jarProtocol.rightDoorOpen == 0 || jarProtocol.leftDoorOpen == 0){ |
| | | if (jarProtocol.rightDoorOpen == 2 || jarProtocol.leftDoorOpen == 2){ |
| | | jarProtocol.setLeftDoorOpen(0);//open the left door //进料门 |
| | | jarProtocol.setRightDoorOpen(0);//open the right door //出料门 |
| | | } |
| | | } |
| | | } |
| | | } else if (jarProtocol.statusType .equals(JarStatusType.WAITING3) || jarProtocol.statusType .equals(JarStatusType.WAITING4)){ |
| | | jarProtocol.setOpenDoorSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus())); |
| | | } else if (jarProtocol.statusType .equals(JarStatusType.WAITING5) || jarProtocol.statusType .equals(JarStatusType.OFF_LINE)){ |
| | | jarProtocol.setCloseDoorSign(!jarProtocol.getStatus().equals(jarProtocol.getUpStatus())); |
| | | } else if (jarProtocol.statusType .equals(JarStatusType.WAITING1) || jarProtocol.statusType .equals(JarStatusType.MOVING)){ |
| | | if (!jarProtocol.rightDoorOpen.equals(jarProtocol.leftDoorOpen)) { |
| | | if (jarProtocol.rightDoorOpen == 0 || jarProtocol.leftDoorOpen == 0){ |
| | | if (jarProtocol.rightDoorOpen == 2 || jarProtocol.leftDoorOpen == 2){ |
| | | jarProtocol.setLeftDoorOpen(0);//open the left door //进料门 |
| | | jarProtocol.setRightDoorOpen(0);//open the right door //出料门 |
| | | } |
| | | } |
| | | } |
| | | if (jarProtocol.rightDoorClose == 0 || jarProtocol.leftDoorClose == 0){ |
| | | if (jarProtocol.rightDoorClose == 2 || jarProtocol.leftDoorClose == 2){ |
| | | jarProtocol.setLeftDoorClose(0);//close the left door //进料门 |
| | | jarProtocol.setRightDoorClose(0);//close the right door //出料门 |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | jarProtocol.setUpStatus(jarProtocol.getStatus()); |
| | | // |
| | | // jarProtocol.setMode(2);//模式 |
| | | // jarProtocol.setStatus((short)6);//状态 |
| | |
| | | OperateResultExOne<byte[]> resultRead2 = siemensS7Net.Read(resultV2, (short) 2); |
| | | if (resultRead2.IsSuccess) { |
| | | short transInt16 = siemensS7Net.getByteTransform().TransInt16(resultRead2.Content, 0); |
| | | if (transInt16 == resultS1 || transInt16 == (short) 3){ |
| | | if (transInt16 == resultS2 || transInt16 == (short) 3){ |
| | | break; |
| | | } else { |
| | | log.error("写入硫化罐plc数据失败,重新下发任务 写入直接失败 ===>> [id:{}],{},[写入次数:{}]", slave.getId(), JSON.toJSONString(command),writeCount); |