| | |
| | | if (index < 16) { |
| | | workNoAddress = "DB100." + index * 4; |
| | | staNoAddress = "DB100." + (index * 4 + 2); |
| | | heightAddress = "DB104." + (index * 4); |
| | | } else { |
| | | workNoAddress = "DB100." + (400 + (index - 16) * 4); |
| | | staNoAddress = "DB100." + (400 + (index - 16) * 4 + 2); |
| | | } |
| | | int i = barcodeSite2.indexOf(staProtocol.getSiteId()); |
| | | if (i != -1) { |
| | | heightAddress = "DB104." + (i * 4); |
| | | } |
| | | |
| | | OperateResult writeResult; |
| | |
| | | OperateResult writeResult1 = siemensS7Net.Write(workNoAddress, staProtocol.getWorkNo()); // 工作号 |
| | | OperateResult writeResult2 = siemensS7Net.Write(staNoAddress, staProtocol.getStaNo()); // 目标站 |
| | | if (!Cools.isEmpty(staProtocol.getHeight()) && heightAddress != null) { |
| | | OperateResult writeResult3 = siemensS7Net.Write(heightAddress, staProtocol.getHeight()); // 目标站 |
| | | OperateResult writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); // 目标站 |
| | | if (!writeResult3.IsSuccess) { |
| | | //fangzhi xierukushibai,jiu duoxiejici,meixunhuan |
| | | writeResult3 = siemensS7Net.Write(heightAddress, staProtocol.getHeight()); |
| | | writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); |
| | | if (!writeResult3.IsSuccess) { |
| | | writeResult3 = siemensS7Net.Write(heightAddress, staProtocol.getHeight()); // 目标站 |
| | | writeResult3 = siemensS7Net.Write(heightAddress, Short.parseShort(staProtocol.getHeight())); // 目标站 |
| | | } |
| | | } |
| | | } |
| | |
| | | // array[1] = staProtocol.getStaNo(); |
| | | // OperateResult write = siemensS7Net.Write("DB100." + index*4, array); |
| | | // |
| | | //// OperateResult write = siemensS7Net.Write("DB100." + index*2, staProtocol.getWorkNo()); // 工作号 |
| | | //// Thread.sleep(500); |
| | | //// OperateResult write1 = siemensS7Net.Write("DB101." + index*2, staProtocol.getStaNo()); // 目标站 |
| | | |
| | | /// / OperateResult write = siemensS7Net.Write("DB100." + index*2, staProtocol.getWorkNo()); // 工作号 |
| | | /// / Thread.sleep(500); |
| | | /// / OperateResult write1 = siemensS7Net.Write("DB101." + index*2, staProtocol.getStaNo()); // 目标站 |
| | | // |
| | | // if (!write.IsSuccess) { |
| | | // staProtocol = station.get(staProtocol.getSiteId()); |
| | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | private void write2(StaProtocol staProtocol) throws InterruptedException { |
| | | if (null == staProtocol) { |
| | | return; |