|  |  | 
 |  |  |         crnThread.connect(); | 
 |  |  |         crnThread.readStatus(); | 
 |  |  |         System.out.println(JSON.toJSONString(crnThread.crnProtocol)); | 
 |  |  |         Thread.sleep(3000L); | 
 |  |  |  | 
 |  |  |         // 1.入库 源和目标都发 | 
 |  |  | //        CrnCommand command = new CrnCommand(); | 
 |  |  | //        command.setCrnNo(1); // 堆垛机编号 | 
 |  |  | //        command.setTaskNo((short) 0); // 工作号 | 
 |  |  | //        command.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  | //        command.setTaskMode(CrnTaskModeType.PAKIN); // 任务模式 | 
 |  |  | //        command.setSourcePosX((short) 1);     // 源库位排 | 
 |  |  | //        command.setSourcePosY((short) 0);     // 源库位列 | 
 |  |  | //        command.setSourcePosZ((short) 1);     // 源库位层 | 
 |  |  | //        command.setDestinationPosX((short) 2);     // 目标库位排 | 
 |  |  | //        command.setDestinationPosY((short) 3);     // 目标库位列 | 
 |  |  | //        command.setDestinationPosZ((short) 1);     // 目标库位层 | 
 |  |  | //        crnThread.write(command); | 
 |  |  |  | 
 |  |  |         // 2.出库 源和目标都发 | 
 |  |  | //        CrnCommand command = new CrnCommand(); | 
 |  |  | //        command.setCrnNo(1); // 堆垛机编号 | 
 |  |  | //        command.setTaskNo((short) 0); // 工作号 | 
 |  |  | //        command.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  | //        command.setTaskMode(CrnTaskModeType.PAKOUT); // 任务模式 | 
 |  |  | //        command.setSourcePosX((short) 2);     // 源库位排 | 
 |  |  | //        command.setSourcePosY((short) 4);     // 源库位列 | 
 |  |  | //        command.setSourcePosZ((short) 3);     // 源库位层 | 
 |  |  | //        command.setDestinationPosX((short) 1);     // 目标库位排 | 
 |  |  | //        command.setDestinationPosY((short) 0);     // 目标库位列 | 
 |  |  | //        command.setDestinationPosZ((short) 1);     // 目标库位层 | 
 |  |  | //        crnThread.write(command); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |         Thread.sleep(5000L); | 
 |  |  |         CrnCommand command = new CrnCommand(); | 
 |  |  |         command.setCrnNo(1); // 堆垛机编号 | 
 |  |  |         command.setTaskNo((short) 0); // 工作号 | 
 |  |  |         command.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  |         command.setTaskMode(CrnTaskModeType.OFFSET_MOVE); // 任务模式 | 
 |  |  |         command.setSourcePosX((short) 0);     // 源库位排 | 
 |  |  |         command.setSourcePosY((short) 0);     // 源库位列 | 
 |  |  |         command.setSourcePosZ((short) 0);     // 源库位层 | 
 |  |  |         command.setDestinationPosX((short) 1);     // 目标库位排 | 
 |  |  |         command.setDestinationPosY((short) 7);     // 目标库位列 | 
 |  |  |         command.setDestinationPosZ((short) 2);     // 目标库位层 | 
 |  |  |         crnThread.write(command); | 
 |  |  | //        // 3.库位移转   源和目标都发 | 
 |  |  | //        CrnCommand command = new CrnCommand(); | 
 |  |  | //        command.setCrnNo(slave.getId()); // 堆垛机编号 | 
 |  |  | //        command.setTaskNo((short) 0); // 工作号 | 
 |  |  | //        command.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  | //        command.setTaskMode(CrnTaskModeType.LOC_MOVE); // 任务模式:  库位移转 | 
 |  |  | //        command.setSourcePosX((short)1);     // 源库位排 | 
 |  |  | //        command.setSourcePosY((short)2);     // 源库位列 | 
 |  |  | //        command.setSourcePosZ((short)2);     // 源库位层 | 
 |  |  | //        command.setDestinationPosX((short)2);     // 目标库位排 | 
 |  |  | //        command.setDestinationPosY((short)3);     // 目标库位列 | 
 |  |  | //        command.setDestinationPosZ((short)3);     // 目标库位层 | 
 |  |  | //        crnThread.write(command); | 
 |  |  |  | 
 |  |  |         // 4.站位移转   源和目标都发 | 
 |  |  | //        CrnCommand command = new CrnCommand(); | 
 |  |  | //        command.setCrnNo(slave.getId()); // 堆垛机编号 | 
 |  |  | //        command.setTaskNo((short) 0); // 工作号 | 
 |  |  | //        command.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  | //        command.setTaskMode(CrnTaskModeType.SITE_MOVE); // 任务模式:  库位移转 | 
 |  |  | //        command.setSourcePosX((short)1);     // 源库位排 | 
 |  |  | //        command.setSourcePosY((short)0);     // 源库位列 | 
 |  |  | //        command.setSourcePosZ((short)1);     // 源库位层 | 
 |  |  | //        command.setDestinationPosX((short)2);     // 目标库位排 | 
 |  |  | //        command.setDestinationPosY((short)0);     // 目标库位列 | 
 |  |  | //        command.setDestinationPosZ((short)1);     // 目标库位层 | 
 |  |  | //        crnThread.write(command); | 
 |  |  |  | 
 |  |  | //        // 5.回原点  不用发   pass | 
 |  |  | //        CrnCommand command = new CrnCommand(); | 
 |  |  | //        command.setCrnNo(1); // 堆垛机编号 | 
 |  |  | //        command.setTaskNo((short) 0); // 工作号 | 
 |  |  | //        command.setAckFinish((short) 0);  // 任务完成确认位 | 
 |  |  | //        command.setTaskMode(CrnTaskModeType.GO_ORIGIN); // 任务模式 | 
 |  |  | //        command.setSourcePosX((short) 0);     // 源库位排 | 
 |  |  | //        command.setSourcePosY((short) 0);     // 源库位列 | 
 |  |  | //        command.setSourcePosZ((short) 0);     // 源库位层 | 
 |  |  | //        command.setDestinationPosX((short) 2);     // 目标库位排 | 
 |  |  | //        command.setDestinationPosY((short) 1);     // 目标库位列 | 
 |  |  | //        command.setDestinationPosZ((short) 1);     // 目标库位层 | 
 |  |  | //        crnThread.write(command); | 
 |  |  |  | 
 |  |  | //        // 7.坐标移行   目标发   pass | 
 |  |  | //        CrnCommand command = new CrnCommand(); | 
 |  |  | //        command.setCrnNo(1); // 堆垛机编号 | 
 |  |  | //        command.setTaskNo((short) 0); // 工作号 | 
 |  |  | 
 |  |  | //        command.setSourcePosX((short) 0);     // 源库位排 | 
 |  |  | //        command.setSourcePosY((short) 0);     // 源库位列 | 
 |  |  | //        command.setSourcePosZ((short) 0);     // 源库位层 | 
 |  |  | //        command.setDestinationPosX((short) 0);     // 目标库位排 | 
 |  |  | //        command.setDestinationPosY((short) 5);     // 目标库位列 | 
 |  |  | //        command.setDestinationPosX((short) 2);     // 目标库位排 | 
 |  |  | //        command.setDestinationPosY((short) 1);     // 目标库位列 | 
 |  |  | //        command.setDestinationPosZ((short) 1);     // 目标库位层 | 
 |  |  | //        crnThread.write(command); | 
 |  |  |  | 
 |  |  |  | 
 |  |  | //        // 写 | 
 |  |  | //        CrnCommand command = new CrnCommand(); | 
 |  |  | //        command.setCrnNo(slave.getId()); // 堆垛机编号 | 
 |  |  | //        command.setTaskNo((short) 0); // 工作号 | 
 |  |  | //        command.setAckFinish((short) 1);  // 任务完成确认位 | 
 |  |  | //        command.setTaskMode(CrnTaskModeType.NONE); // 任务模式:  库位移转 | 
 |  |  | //        command.setSourcePosX((short)0);     // 源库位排 | 
 |  |  | //        command.setSourcePosY((short)0);     // 源库位列 | 
 |  |  | //        command.setSourcePosZ((short)0);     // 源库位层 | 
 |  |  | //        command.setDestinationPosX((short)0);     // 目标库位排 | 
 |  |  | //        command.setDestinationPosY((short)0);     // 目标库位列 | 
 |  |  | //        command.setDestinationPosZ((short)0);     // 目标库位层 | 
 |  |  | //        crnThread.write(command); | 
 |  |  |  | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } |