| | |
| | | //错误编号 |
| | | shuttleProtocol.setErrorCode(modbusTcpNet.getByteTransform().TransInt16(content,8)); |
| | | //Plc输出状态IO |
| | | boolean[] booleans = modbusTcpNet.getByteTransform().TransBool(content, 10, 2); |
| | | shuttleProtocol.setPlcOutputLift(booleans[1]); |
| | | shuttleProtocol.setPlcOutputTransfer(booleans[2]); |
| | | shuttleProtocol.setPlcOutputBrake(booleans[3]); |
| | | shuttleProtocol.setPlcOutputCharge(booleans[4]); |
| | | int plcOutIo = modbusTcpNet.getByteTransform().TransUInt16(content, 10); |
| | | int[] plcOutIos = CommonUtils.byteToBits((byte) plcOutIo); |
| | | shuttleProtocol.setPlcOutputLift(plcOutIos[1] == 1); |
| | | shuttleProtocol.setPlcOutputTransfer(plcOutIos[2] == 1); |
| | | shuttleProtocol.setPlcOutputBrake(plcOutIos[3] == 1); |
| | | shuttleProtocol.setPlcOutputCharge(plcOutIos[4] == 1); |
| | | shuttleProtocol.setPlcOutputStatusIO(modbusTcpNet.getByteTransform().TransInt16(content, 10)); |
| | | //错误信息码 |
| | | shuttleProtocol.setStatusErrorCode(modbusTcpNet.getByteTransform().TransInt16(content,12)); |
| | | int plcInIo = modbusTcpNet.getByteTransform().TransUInt16(content, 14); |
| | | int[] plcInIos = CommonUtils.byteToBits((byte) plcInIo); |
| | | //PLC输入状态 |
| | | shuttleProtocol.setPlcInputStatus(modbusTcpNet.getByteTransform().TransInt16(content,14)); |
| | | shuttleProtocol.setPlcInputStatus((short) plcInIos[6]); |
| | | //当前或者之前读到的二维码值 |
| | | shuttleProtocol.setCurrentOrBeforeCode(modbusTcpNet.getByteTransform().TransInt16(content,16)); |
| | | //读到的二维码X方向偏移量 |
| | |
| | | int size = commands.size(); |
| | | ShuttleAssignCommand assignCommand = redisCommand.getAssignCommand(); |
| | | |
| | | if (commandStep != 0) { |
| | | //判断上一条指令是否完成 |
| | | ShuttleCommand command = commands.get(commandStep - 1); |
| | | if (command.getDistCodeNum().intValue() == shuttleProtocol.getCurrentCode().intValue()) { |
| | | //上一条指令的目标位置 |
| | | } |
| | | } |
| | | |
| | | //取出命令 |
| | | ShuttleCommand command = commands.get(commandStep); |
| | | |