| | |
| | | add(188);add(189);add(190);add(191); |
| | | add(192);add(193); |
| | | }}; |
| | | public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | | add(200);add(201);add(202);add(203); |
| | | add(204);add(205);add(206);add(207); |
| | | add(208);add(209);add(210);add(211); |
| | | add(212);add(213);add(214);add(215); |
| | | add(216);add(217);add(218);add(219); |
| | | add(220);add(221);add(222);add(2000); |
| | | }}; |
| | | // public static final ArrayList<Integer> staNos2 = new ArrayList<Integer>() {{ |
| | | // add(200);add(201);add(202);add(203); |
| | | // add(204);add(205);add(206);add(207); |
| | | // add(208);add(209);add(210);add(211); |
| | | // add(212);add(213);add(214);add(215); |
| | | // add(216);add(217);add(218);add(219); |
| | | // add(220);add(221);add(222);add(2000); |
| | | // }}; |
| | | |
| | | /** |
| | | * 条码数量 |
| | |
| | | switch (slave.getId()) { |
| | | case 1: |
| | | return staNos1; |
| | | case 2: |
| | | return staNos2; |
| | | // case 2: |
| | | // return staNos2; |
| | | default: |
| | | throw new CoolException("服务器异常"); |
| | | } |
| | |
| | | break; |
| | | // 写数据 ID+目标站 |
| | | case 2: |
| | | // write3((StaProtocol)task.getData()); |
| | | // Thread.sleep(400); |
| | | // write4((StaProtocol)task.getData()); |
| | | // Thread.sleep(400); |
| | | write((StaProtocol)task.getData()); |
| | | break; |
| | | // 写数据 ID+目标站 码垛完成 给输送线写任务完成 |
| | |
| | | |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> resultError = siemensS7Net.Read("DB101.800", (short) (8)); |
| | | if (resultError.IsSuccess && staNoSize==staNos2.size()) { |
| | | if (resultError.IsSuccess) { |
| | | ArrayList<Integer> staNoError = new ArrayList<Integer>() {{ add(217);add(221); }}; |
| | | for (int i = 0; i < staNoError.size(); i++) { |
| | | Integer siteId = staNoError.get(i); // 站点编号 |
| | |
| | | //条码扫描器 |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.840",(short)(barcodeSize*8)); |
| | | if (result2.IsSuccess && staNoSize==staNos2.size()) { |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeSize; i++) { //1:217 2:221 3:null 4:215 5:219 |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*8,6, "UTF-8"); |
| | | BarcodeThread barcodeThread = (BarcodeThread) SlaveConnection.get(SlaveType.Barcode, i + 1); |
| | |
| | | barcodeThread.setBarcode(barcode); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | //RGV小车 |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2); |
| | | if (result3.IsSuccess && staNoSize==staNos2.size()) { |
| | | if (result3.IsSuccess) { |
| | | Integer siteId = 2000; |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | |
| | | } |
| | | staProtocol.setNearbySta(String.valueOf(siemensS7Net.getByteTransform().TransInt16(result3.Content, 0))); |
| | | } |
| | | |
| | | |
| | | |
| | | if (result.IsSuccess) { |
| | | |