| | |
| | | if (!wrkNoFlag) { |
| | | write = siemensS7Net.Write("DB100." + index * 6, (int) staProtocol.getWorkNo()); // 工作号 |
| | | if (write.IsSuccess) { |
| | | wrkNoFlag = true; |
| | | // OperateResultExOne<byte[]> readResult = siemensS7Net.Read("DB100." + index * 6, (short) 4); |
| | | // if (readResult.IsSuccess) { |
| | | // short workNo = (short) siemensS7Net.getByteTransform().TransInt32(readResult.Content, 0); |
| | |
| | | log.error("写入工作号命令失败。堆垛机plc编号={},站点数据={},写入次数={}", slave.getId(), JSON.toJSON(staProtocol), writeCount); |
| | | } |
| | | } |
| | | Thread.sleep(200); |
| | | if (!staNoFlag) { |
| | | write1 = siemensS7Net.Write("DB100." + (index * 6 + 4), staProtocol.getStaNo()); // 目标站 |
| | | if (write1.IsSuccess) { |
| | | staNoFlag = true; |
| | | // OperateResultExOne<byte[]> readResult1 = siemensS7Net.Read("DB100." + (index * 6 + 4), (short) 2); |
| | | // if (readResult1.IsSuccess) { |
| | | // short staNo = siemensS7Net.getByteTransform().TransInt16(readResult1.Content, 0); |
| | |
| | | if (wrkNoFlag && staNoFlag) { |
| | | break; |
| | | } |
| | | Thread.sleep(200); |
| | | } while (writeCount < 20); |
| | | |
| | | if (!write.IsSuccess) { |