| | |
| | | put(1036, 512);put(1103, 476);put(1047, 452);put(2037, 270);put(4001,294); |
| | | |
| | | }}; |
| | | public static final Map<Integer, Integer> siteAgvOffsetMap = new HashMap<Integer, Integer>() {{ |
| | | put(1037, 0);put(1039, 2);put(1041, 4);put(2033, 0);put(2034,2);put(4003,4);put(4006,6); |
| | | |
| | | }}; |
| | | |
| | | // 特殊站点集合 |
| | | private static final Set<Integer> specialSites = new HashSet<>( |
| | |
| | | private static final Set<Integer> specialSites3 = new HashSet<>(//机械臂站点 |
| | | Arrays.asList(1098,1093,1087,1082,1074,1071,1061,1058)); |
| | | |
| | | private static final Set<Integer> specialAgvSites = new HashSet<>(//agv取放货站点 |
| | | Arrays.asList(1037,1039,1041,2033,2034,4003,4006)); |
| | | |
| | | public static final ArrayList<Integer> BarcodeList = new ArrayList<Integer>() {{ |
| | | add(0); add(1); add(2); |
| | |
| | | write((StaProtocol)task.getData()); |
| | | log.error("输送线下发命令:"+((StaProtocol) task.getData()).getWorkNo()+","+((StaProtocol) task.getData()).getStaNo()); |
| | | break; |
| | | // case 3: |
| | | // writeAgv((StaProtocol)task.getData()); |
| | | // break; |
| | | default: |
| | | break; |
| | | } |
| | |
| | | OperateResultExOne<byte[]> result4 = null;//1054-1079 |
| | | OperateResultExOne<byte[]> result5 = null;//1080-1110 |
| | | OperateResultExOne<byte[]> resultErr = null; |
| | | OperateResultExOne<byte[]> resultAlarm = null; |
| | | OperateResultExOne<byte[]> resultPlc = null; |
| | | OperateResultExOne<byte[]> resultAgv = null; |
| | | |
| | | if(staNoSize == 102){ |
| | | result1 = siemensS7Net.Read("DB100.0", (short) (2768));//1001-1028 |
| | |
| | | result4 = siemensS7Net.Read("DB103.0", (short) (2824));//1054-1079 |
| | | result5 = siemensS7Net.Read("DB102.0", (short) (3428));//1080-1110 |
| | | resultErr = siemensS7Net.Read("DB3.0", (short) (536)); |
| | | // resultAlarm = siemensS7Net.Read("DB800.0", (short) (220)); |
| | | // resultAgv = siemensS7Net.Read("DB901.0", (short) (5)); //agv取放货请求 |
| | | // resultPlc = siemensS7Net.Read("DB902.0", (short) (5)); //输送线确认 |
| | | }else{ |
| | | result1 = siemensS7Net.Read("DB200.0", (short) (3000));//2001-2030 |
| | | result2 = siemensS7Net.Read("DB201.0", (short) (720));//2031-2037 |
| | | result3 = siemensS7Net.Read("DB400.0", (short) (600));//4001-4006 |
| | | resultErr = siemensS7Net.Read("DB3.0", (short) (354)); |
| | | // resultAlarm = siemensS7Net.Read("DB800.0", (short) (126)); |
| | | |
| | | // resultAgv = siemensS7Net.Read("DB901.0", (short) (7)); //agv取放货请求 |
| | | // resultPlc = siemensS7Net.Read("DB902.0", (short) (7)); //输送线确认 |
| | | } |
| | | |
| | | |
| | |
| | | staProtocol.setSensorDecL(statusSign[19]); |
| | | staProtocol.setSensorArriveR(statusSign[20]); |
| | | staProtocol.setSensorDecR(statusSign[21]); |
| | | |
| | | // Integer offsetAgv = siteAgvOffsetMap.get(siteId); |
| | | // |
| | | // boolean[] statusPlc = siemensS7Net.getByteTransform().TransBool(resultPlc.Content, offsetAgv, 1); |
| | | // boolean[] statusAgv = siemensS7Net.getByteTransform().TransBool(resultAgv.Content, offsetAgv, 1); |
| | | // |
| | | // if(specialAgvSites.contains(siteId)){ |
| | | // // 心跳 |
| | | // staProtocol.setHeartbeatDevp(statusPlc[0]); |
| | | // staProtocol.setHeartbeatAgv(statusAgv[0]); |
| | | // // 输送线(PLC) |
| | | // staProtocol.setConveyorAllowPick(statusPlc[1]); |
| | | // staProtocol.setConveyorAllowPlace(statusPlc[2]); |
| | | // staProtocol.setConveyorPickDone(statusPlc[3]); |
| | | // staProtocol.setConveyorPlaceDone(statusPlc[4]); |
| | | // staProtocol.setSafetyDoorOpen(statusPlc[5]); |
| | | // staProtocol.setExternalEmergencyStop(statusPlc[6]); |
| | | // // AGV |
| | | // staProtocol.setAgvRequestPlace(statusAgv[1]); |
| | | // staProtocol.setAgvRequestPick(statusAgv[2]); |
| | | // staProtocol.setAgvPickDone(statusAgv[3]); |
| | | // staProtocol.setAgvPlaceDone(statusAgv[4]); |
| | | // staProtocol.setAgvForbidden(statusAgv[5]); |
| | | // } |
| | | |
| | | |
| | | if( (staProtocol.getPassTimeOut() || |
| | |
| | | staProtocol.isHighErr()? 1L:0L, |
| | | staProtocol.isLeftErr()? 1L:0L, |
| | | staProtocol.isRightErr()? 1L:0L, |
| | | staProtocol.isBarcodeErr()? 1L:0L |
| | | |
| | | staProtocol.isBarcodeErr()? 1L:0L, |
| | | staProtocol.getErrCode() |
| | | ); |
| | | bean.insert(basDevpOpt); |
| | | } catch (Exception ignore) { |