| | |
| | | add(300);add(301); |
| | | add(340);add(341); |
| | | add(345);add(346); |
| | | add(303);add(317); |
| | | add(325);add(331); |
| | | add(333);add(339); |
| | | }}; |
| | | |
| | | public static final ArrayList<Integer> outInStaNos = new ArrayList<Integer>() {{ |
| | |
| | | short outInModel = siemensS7Net.getByteTransform().TransInt16(result102.Content, 0); |
| | | StaProtocol staProtocol = station.get(102); |
| | | staProtocol.setOutInModel(outInModel); |
| | | } |
| | | |
| | | Thread.sleep(50); |
| | | for (Integer siteId : outInStaNos) { |
| | | String dbAddress = "DB100.300"; |
| | | switch (siteId) { |
| | | case 102: |
| | | dbAddress = "DB100.300"; |
| | | break; |
| | | case 105: |
| | | dbAddress = "DB100.302"; |
| | | break; |
| | | case 106: |
| | | dbAddress = "DB100.304"; |
| | | break; |
| | | case 107: |
| | | dbAddress = "DB100.306"; |
| | | break; |
| | | case 108: |
| | | dbAddress = "DB100.308"; |
| | | break; |
| | | } |
| | | |
| | | OperateResultExOne<byte[]> resultRead = siemensS7Net.Read(dbAddress, (short) 2); |
| | | if (resultRead.IsSuccess) { |
| | | //链条转动情况 |
| | | short direction = siemensS7Net.getByteTransform().TransInt16(resultRead.Content, 0); |
| | | StaProtocol staProtocol = station.get(siteId); |
| | | if (direction != 0 && !staProtocol.isLoading()) { |
| | | //状态为正转或反转且无物时,将链条转动信号位复位 |
| | | write4(siteId, 0); |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (result.IsSuccess && result1.IsSuccess) { |