| | |
| | | @Override |
| | | @SuppressWarnings("InfiniteLoopStatement") |
| | | public void run() { |
| | | initCrnProtocol(); |
| | | this.connect(); |
| | | while (true) { |
| | | try { |
| | |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 初始化堆垛机 |
| | | */ |
| | | private void initCrnProtocol(){ |
| | | crnProtocol = new CrnProtocol(); |
| | | crnProtocol.setMode((short) 0); |
| | | crnProtocol.setStatus((short) 0); |
| | | crnProtocol.setTaskNo((short) 0); |
| | | crnProtocol.setTaskFinish((short) 0); |
| | | crnProtocol.setValid((short) 0); |
| | | crnProtocol.setBay((short) 0); |
| | | crnProtocol.setLevel((short) 0); |
| | | crnProtocol.setRow((short) 0); |
| | | crnProtocol.setLane((short) 0); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } catch (Exception ignore) {} |
| | | |
| | | if (result.IsSuccess && result1.IsSuccess) { |
| | | |
| | | log.warn("堆垛机命令下发[id:{},时间:{}] >>>>> {}", slave.getId(), DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmsssss_F), JSON.toJSON(command)); |
| | | OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command))); |
| | | return true; |