| | |
| | | private SteProtocol steProtocol; |
| | | private short heartBeatVal = 1; |
| | | private boolean resetFlag = false; |
| | | private int value = 0; |
| | | |
| | | |
| | | public SteThread(SteSlave slave) { |
| | | this.slave = slave; |
| | |
| | | steProtocol.setSteNo(slave.getId().shortValue()); |
| | | } |
| | | // steProtocol.setSteNo(siemensS7Net.getByteTransform().TransInt16(result.Content, 0)); |
| | | steProtocol.setMode(siemensS7Net.getByteTransform().TransInt16(result.Content, 2)); |
| | | short i = siemensS7Net.getByteTransform().TransInt16(result.Content, 2); |
| | | if (i == 0) { |
| | | value++; |
| | | } else { |
| | | value = 0; |
| | | } |
| | | if (value > 20) { |
| | | steProtocol.setMode((short) 0); |
| | | } else { |
| | | if (steProtocol.getMode() != null) { |
| | | steProtocol.setMode(steProtocol.getMode()); |
| | | } else { |
| | | steProtocol.setMode((short) 1); |
| | | } |
| | | } |
| | | steProtocol.setStatus(siemensS7Net.getByteTransform().TransInt16(result.Content, 4)); |
| | | OperateResultExOne<Boolean> executeRes = siemensS7Net.ReadBool("V2001.0"); |
| | | if (executeRes.IsSuccess) { |
| | |
| | | } |
| | | } |
| | | |
| | | } catch (Exception ignore) {} |
| | | } catch (Exception ignore) { |
| | | } |
| | | |
| | | if (result != null && result.IsSuccess) { |
| | | // 维护数据库排列层 |