| | |
| | | |
| | | private Map<Integer, StaProtocol> station; |
| | | |
| | | private volatile boolean connected = false; |
| | | |
| | | private static final int WRITE_RETRY_MAX = 5; |
| | | |
| | | private static final int WRITE_RETRY_INTERVAL_MS = 200; |
| | |
| | | * 读取状态 ====> 整块plc |
| | | */ |
| | | private void read() throws InterruptedException { |
| | | if (!connected || siemensS7Net == null) { |
| | | if (siemensS7Net == null) { |
| | | log.warn("PLC未连接,跳过读取 [id:{}]", slave.getId()); |
| | | return; |
| | | } |
| | |
| | | |
| | | if (!result.IsSuccess) { |
| | | log.error("读取站点状态失败 [id:{}] [error:{}]", slave.getId(), result.Message); |
| | | connected = false; |
| | | return; |
| | | } |
| | | |