| | |
| | | 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); |
| | | add(212);add(213);add(214);add(215); |
| | | add(216);add(217);add(218);add(219); |
| | | add(220);add(221);add(222);add(2000); |
| | | }}; |
| | | |
| | | /** |
| | | * 条码数量 |
| | | */ |
| | | private int barcodeSize = 1; |
| | | private int barcodeSize = 5; |
| | | |
| | | /** |
| | | * 入出库模式 |
| | |
| | | break; |
| | | // 写数据 ID+目标站 |
| | | case 2: |
| | | // write3((StaProtocol)task.getData()); |
| | | // Thread.sleep(400); |
| | | // write4((StaProtocol)task.getData()); |
| | | // Thread.sleep(400); |
| | | write((StaProtocol)task.getData()); |
| | | break; |
| | | // 写数据 ID+目标站 码垛完成 给输送线写任务完成 |
| | |
| | | // 写数据 ID+目标站 码垛完成 给输送线写任务完成复位 |
| | | case 4: |
| | | write4((StaProtocol)task.getData()); |
| | | break; |
| | | case 5: |
| | | write3((StaProtocol)task.getData()); |
| | | Thread.sleep(400); |
| | | write4((StaProtocol)task.getData()); |
| | | Thread.sleep(400); |
| | | write((StaProtocol)task.getData()); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | |
| | | //条码扫描器 |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.102",(short)(barcodeSize*10)); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < barcodeSize; i++) { |
| | | String barcode = siemensS7Net.getByteTransform().TransString(result2.Content,i*10,6, "UTF-8"); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB101.840",(short)(barcodeSize*8)); |
| | | if (result2.IsSuccess && staNoSize==staNos2.size()) { |
| | | 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); |
| | | if(!Cools.isEmpty(barcodeThread) && !barcodeThread.getBarcode().equals(barcode)) { |
| | | barcodeThread.setBarcode(barcode); |
| | |
| | | //RGV小车 |
| | | Thread.sleep(200); |
| | | OperateResultExOne<byte[]> result3 = siemensS7Net.Read("DB100.160",(short)2); |
| | | if (result3.IsSuccess) { |
| | | if (result3.IsSuccess && staNoSize==staNos2.size()) { |
| | | Integer siteId = 16; |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |