| | |
| | | write1((RgvCommand) task.getData()); |
| | | break; |
| | | // //工位2写入数据 |
| | | // case 5: |
| | | // write2((RgvCommand) task.getData()); |
| | | // break; |
| | | case 5: |
| | | write2((RgvCommand) task.getData()); |
| | | break; |
| | | // 复位 |
| | | case 3: |
| | | RgvCommand command = (RgvCommand) task.getData(); |
| | |
| | | command.setDestinationStaNo1((short)0); // 目标站 |
| | | command.setCommand((short)0); |
| | | write1(command); |
| | | break; |
| | | case 6: |
| | | RgvCommand command2 = (RgvCommand) task.getData(); |
| | | if (null == command2) { |
| | | command2 = new RgvCommand(); |
| | | } |
| | | command2.setRgvNo(slave.getId()); // RGV编号 |
| | | command2.setTaskNo2((short) 0); // 工作号 |
| | | command2.setAckFinish2((short) 1); // 任务完成确认位 |
| | | command2.setTaskMode2(RgvTaskModeType.NONE); // 任务模式 |
| | | command2.setSourceStaNo2((short)0); // 源站 |
| | | command2.setDestinationStaNo2((short)0); // 目标站 |
| | | command2.setCommand((short)0); |
| | | write2(command2); |
| | | break; |
| | | // 回原点 避让 |
| | | case 9: |
| | |
| | | rgvProtocol.setLoaded1((short)0); |
| | | rgvProtocol.setWalkPos((short)0); |
| | | rgvProtocol.setRgvPos((short)0); |
| | | // rgvProtocol.setTaskNo2((short)0); |
| | | // rgvProtocol.setStatus2((short)-1); |
| | | // rgvProtocol.setLoaded2((short)0); |
| | | //工位2状态 |
| | | rgvProtocol.setTaskNo2((short)0); |
| | | rgvProtocol.setStatus2((short)-1); |
| | | rgvProtocol.setLoaded2((short)0); |
| | | rgvProtocol.setAlarm((short)0); |
| | | rgvProtocol.setxSpeed((short) 0); |
| | | rgvProtocol.setxDistance((short) 0); |
| | |
| | | rgvProtocol.setRgvPos(siemensNet.getByteTransform().TransInt16(result.Content, 10)); |
| | | rgvProtocol.setWalkPos(siemensNet.getByteTransform().TransInt16(result.Content, 12)); |
| | | rgvProtocol.setAlarm(siemensNet.getByteTransform().TransInt16(result.Content, 14)); |
| | | // rgvProtocol.setTaskNo2(siemensNet.getByteTransform().TransInt16(result.Content, 4)); |
| | | // rgvProtocol.setLoaded2(siemensNet.getByteTransform().TransInt16(result.Content, 8)); |
| | | // rgvProtocol.setStatus2(siemensNet.getByteTransform().TransInt16(result.Content, 16)); |
| | | rgvProtocol.setxSpeed(siemensNet.getByteTransform().TransInt16(result.Content, 18)); |
| | | // rgvProtocol.setAlarm(siemensNet.getByteTransform().TransInt16(result.Content, 20)); |
| | |
| | | } |
| | | } |
| | | |
| | | // 工位2复位信号 |
| | | // if (rgvProtocol.getStatusType2().equals(RgvStatusType.WAITING) |
| | | // || rgvProtocol.getStatusType2().equals(RgvStatusType.FETCHWAITING)) { |
| | | // if (resetFlag2) { |
| | | // RgvCommand rgvCommand = new RgvCommand(); |
| | | // rgvCommand.setAckFinish2((short)1); |
| | | // if (write(rgvCommand)) { |
| | | // resetFlag2 = false; |
| | | // } |
| | | // } |
| | | // } |
| | | // 工位2复位信号 |
| | | if (rgvProtocol.getStatusType2().equals(RgvStatusType.WAITING) |
| | | || rgvProtocol.getStatusType2().equals(RgvStatusType.FETCHWAITING)) { |
| | | if (resetFlag2) { |
| | | RgvCommand rgvCommand = new RgvCommand(); |
| | | rgvCommand.setAckFinish2((short)1); |
| | | if (write(rgvCommand)) { |
| | | resetFlag2 = false; |
| | | } |
| | | } |
| | | } |
| | | |
| | | try { |
| | | // 根据实时信息更新数据库 |