| | |
| | | ArrayList<BasConveyorSta> staNos = getStaNo(); |
| | | int staNoSize = staNos.size(); |
| | | OperateResultExOne<byte[]> result = siemensS7Net.Read("DB100.20", (short) (staNoSize * 18)); |
| | | if (result.IsSuccess) { |
| | | OperateResultExOne<byte[]> resultInable = siemensS7Net.Read("DB100.186", (short) 2); |
| | | if (result.IsSuccess && resultInable.IsSuccess) { |
| | | for (int i = 0; i < staNoSize; i++) { |
| | | BasConveyorSta siteStation = staNos.get(i); |
| | | int siteId = siteStation.getSiteNo();// 站点编号 |
| | |
| | | // staProtocol.setWorkMode((int) siemensS7Net.getByteTransform().TransInt16(result.Content, i * 40 + 8));// 工作模式 |
| | | staProtocol.setWorkNo((short) siemensS7Net.getByteTransform().TransInt32(result.Content, i * 18 + 10)); // 工作号 |
| | | staProtocol.setStaNo((short) siemensS7Net.getByteTransform().TransInt32(result.Content, i * 18 + 14)); // 目标站 |
| | | |
| | | staProtocol.setIsIn( siemensS7Net.getByteTransform().TransInt16(resultInable.Content, 0)); |
| | | |
| | | |
| | | if (!staProtocol.isPakMk() && !staProtocol.isLoading()) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | if (!Cools.isEmpty(result) && result.IsSuccess) { |
| | | |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), device.getId())); |