| | |
| | | staProtocol.setSegApply(status2[2]); |
| | | staProtocol.setApplyErr(status2[3]); |
| | | |
| | | if (!status2[1] && !status[1]) { |
| | | staProtocol.setStartUpFlag(true); |
| | | } |
| | | |
| | | for (int i = 0; i < 8; i++) { |
| | | if (status0[i + 8] != status2[i]) { |
| | | log.info("状态码不一致 [id:{}] [i:{}] [status0:{}] [status2:{}]", slave.getId(), i, status0[i], status2[i]); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | content, seg[0] + i * DeviceField.BARCODE.getByteLength()); |
| | | String barcode = siemensS7Net.getByteTransform().TransString( |
| | | content, seg[1] + i * DeviceField.BARCODE.getByteLength(), |
| | | DeviceField.BARCODE.getByteLength() - seg[1], "UTF-8"); |
| | | DeviceField.BARCODE.getByteLength()-seg[1] , "UTF-8").trim(); |
| | | |
| | | if (!Cools.isEmpty(barcode) && staNo != 0) { |
| | | if (!Cools.isEmpty(barcode) && !barcode.contains("Default") && !barcode.contains("Error") && staNo != 0) { |
| | | StaProtocol staProtocol = station.get(staNo); |
| | | if (staProtocol == null) { |
| | | log.warn("扫码站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo); |
| | | continue; |
| | | } |
| | | staProtocol.setBarcode(barcode); |
| | | News.info("料箱码:{}", barcode); |
| | | //News.info("料箱码:{}", barcode); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (!Cools.isEmpty(weight) && staNo != 0) { |
| | | StaProtocol staProtocol = station.get(staNo); |
| | | if (staProtocol == null) { |
| | | log.warn("称重站点不存在 [id:{}] [staNo:{}]", slave.getId(), staNo); |
| | | log.warn(" [id:{}] [staNo:{}]", slave.getId(), staNo); |
| | | continue; |
| | | } |
| | | staProtocol.setWeight(BigDecimal.valueOf(weight).setScale(4, RoundingMode.HALF_UP).doubleValue()); |
| | |
| | | SafeSignalField.SAFE_SIGNAL_FROM_CONVEYOR.buildAddress(), |
| | | (short) (staNoSize * SafeSignalField.SAFE_SIGNAL_FROM_CONVEYOR.getByteLength())); |
| | | |
| | | |
| | | if (!result.IsSuccess) { |
| | | log.warn("读取PLC安全交互信息异常 [id:{}]", slave.getId()); |
| | | return; |
| | |
| | | staProtocolTake.setInComplete(status2[3]); |
| | | staProtocolTake.setOutComplete(status2[4]); |
| | | // |
| | | if (status[3]){ |
| | | redis.push(RedisConveyorConstant.CONVEYOR_SAFE_FLAG, new SafeSignal(i,(short)0,true)); |
| | | if (status[3]) { |
| | | staProtocolPut.setSafeSignal(new SafeSignal(i, false, true)); |
| | | redis.push(RedisConveyorConstant.CONVEYOR_SAFE_FLAG, staProtocolPut); |
| | | News.info("安全交互信号复位 [id:{}] [staNo:{}]", slave.getId(), staProtocolPut.getSiteId()); |
| | | } |
| | | if (status2[4]){ |
| | | redis.push(RedisConveyorConstant.CONVEYOR_SAFE_FLAG, new SafeSignal(i, (short) 0,false)); |
| | | |
| | | if (status2[4]) { |
| | | staProtocolTake.setSafeSignal(new SafeSignal(i, false, false)); |
| | | redis.push(RedisConveyorConstant.CONVEYOR_SAFE_FLAG, staProtocolTake); |
| | | News.info("安全交互信号复位 [id:{}] [staNo:{}]", slave.getId(), staProtocolPut.getSiteId()); |
| | | } |
| | | |
| | | } |