|  |  |  | 
|---|
|  |  |  | //        array[10] = command.getDestinationStaNo(); | 
|---|
|  |  |  | array[9] = command.getCommand(); | 
|---|
|  |  |  | OperateResult result18 = siemensNet.Write("DB100.18", (short)0); | 
|---|
|  |  |  | Thread.sleep(200L); | 
|---|
|  |  |  | Thread.sleep(100L); | 
|---|
|  |  |  | OperateResult result = siemensNet.Write("DB100.0", array); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | int i=0; | 
|---|
|  |  |  | do{ | 
|---|
|  |  |  | //堆垛机任务写入后,回读一次,看是否成功 | 
|---|
|  |  |  | Thread.sleep(300); | 
|---|
|  |  |  | Thread.sleep(100); | 
|---|
|  |  |  | OperateResultExOne<byte[]> resultRead = siemensNet.Read("DB100.0", (short) 20); | 
|---|
|  |  |  | if (resultRead.IsSuccess) { | 
|---|
|  |  |  | CrnCommand one = new CrnCommand(); | 
|---|
|  |  |  | 
|---|
|  |  |  | log.error("堆垛机命令地址写入后回读失败[id:{}]>>>>重写[{}] >>>>> 写入[{}],===>>回读[{}]", slave.getId(), i,JSON.toJSON(command),JSON.toJSON(one)); | 
|---|
|  |  |  | result = siemensNet.Write("DB100.0", array); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }while(i<5); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (command.getAckFinish() == 0) { | 
|---|
|  |  |  | short commandFinish = 1; | 
|---|
|  |  |  | Thread.sleep(100L); | 
|---|
|  |  |  | result = siemensNet.Write("DB100.18", commandFinish); | 
|---|
|  |  |  | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }while(i<5); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | // 日志记录 | 
|---|
|  |  |  | BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class); | 
|---|