| | |
| | | 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) { |
| | | OutputQueue.DEVP.offer(MessageFormat.format("【{0}】[id:{1}] <<<<< 实时数据更新成功",DateUtils.convert(new Date()), slave.getId())); |
| | | |