|
@@ -34,7 +34,6 @@ import java.util.*;
|
|
|
public class ModBusServiceImpl implements ModBusService {
|
|
|
|
|
|
private static final Map<Long, ModbusMaster> MASTER_MAP = new HashMap<>(64);
|
|
|
- private static JSONArray array = new JSONArray();
|
|
|
private String show;
|
|
|
|
|
|
@Value("${modbus.host}")
|
|
@@ -83,6 +82,7 @@ public class ModBusServiceImpl implements ModBusService {
|
|
|
private void readTagsValue(){
|
|
|
List<TagVo> tagVos = JSON.parseArray(show, TagVo.class);
|
|
|
BatchRead<String> batch = new BatchRead<>();
|
|
|
+ JSONArray array = new JSONArray();
|
|
|
for (TagVo tagVo: tagVos){
|
|
|
Integer slaveId = tagVo.getSlaveId();
|
|
|
Integer functionCode = tagVo.getFunctionCode();
|
|
@@ -125,7 +125,7 @@ public class ModBusServiceImpl implements ModBusService {
|
|
|
// showVos.add(showVo);
|
|
|
array.add(showVo);
|
|
|
}
|
|
|
-// log.info(array.toString());
|
|
|
+ log.info(array.toString());
|
|
|
webSocketServer.sendInfo(array.toString(), "push");
|
|
|
modbusMaster.destroy();
|
|
|
} catch (Exception e) {
|