| | |
| | | add(100);add(101);add(102);add(103);add(104);add(105);add(106);add(107);add(108);add(109);add(110);add(111);add(112);add(113);add(114); |
| | | add(115);add(116);add(117);add(118);add(119);add(120);add(121);add(122);add(123);add(124);add(125);add(126);add(127);add(128); |
| | | add(200);add(201);add(202);add(203);add(204);add(205); |
| | | add(300);add(301);add(302);add(303);add(304);add(305);add(306); |
| | | add(300);add(301);add(302);add(303);add(304);add(305);add(306);add(307);add(308); |
| | | }}; |
| | | |
| | | public SiemensDevpThread(DevpSlave slave) { |
| | |
| | | } |
| | | } |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB100.180", (short) 28); |
| | | OperateResultExOne<byte[]> result0 = siemensS7Net.Read("DB100.180", (short) 36); |
| | | if (result0.IsSuccess) { |
| | | for (int i = 0; i < 7; i++) { |
| | | for (int i = 0; i < 9; i++) { |
| | | Integer siteId = staNos.get(i + 35); // 站点编号 |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (null == staProtocol) { |
| | |
| | | } |
| | | } |
| | | Thread.sleep(50); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.208", (short) 7); |
| | | OperateResultExOne<byte[]> result2 = siemensS7Net.Read("DB100.216", (short) 9); |
| | | if (result2.IsSuccess) { |
| | | for (int i = 0; i < 7; i++) { |
| | | for (int i = 0; i < 9; i++) { |
| | | Integer siteId = staNos.get(i + 35); // 站点编号 |
| | | boolean[] status = siemensS7Net.getByteTransform().TransBool(result2.Content, i, 1); |
| | | StaProtocol staProtocol = station.get(siteId); |
| | |
| | | } else { |
| | | write = siemensS7Net.Write("DB100." + (index-35)*2 + 180, staProtocol.getWorkNo()); // 工作号 |
| | | Thread.sleep(100); |
| | | write1 = siemensS7Net.Write("DB100." + ((index-35)*2 + 14) + 180, staProtocol.getStaNo()); // 目标站 |
| | | write1 = siemensS7Net.Write("DB100." + (index-35) + 216, staProtocol.getStaNo()); // 目标站 |
| | | } |
| | | |
| | | if (!write.IsSuccess || !write1.IsSuccess) { |