diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/utils/ReadUtil.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/utils/ReadUtil.java index a958742..2d4255c 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/utils/ReadUtil.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/utils/ReadUtil.java @@ -110,16 +110,16 @@ public class ReadUtil { NodeId nodeId = new NodeId(2, key); //创建数据对象,此处的数据对象一定要定义类型,不然会出现类型错误,导致无法写入 DataValue nowValue = null; - if(NumberUtil.isNumber(String.valueOf(o))){ - nowValue = new DataValue(new Variant(Integer.valueOf(o.toString())), null, null); - } else if (NumberUtil.isNumber(String.valueOf(o))) { + if(NumberUtil.isDouble(String.valueOf(o))){ nowValue = new DataValue(new Variant(Double.valueOf(o.toString())), null, null); + } else if (NumberUtil.isNumber(String.valueOf(o))) { + nowValue = new DataValue(new Variant(Integer.valueOf(o.toString())), null, null); } else { nowValue = new DataValue(new Variant(String.valueOf(o)), null, null); } //写入节点数据 StatusCode statusCode = client.writeValue(nodeId, nowValue).join(); - System.out.println("结果:" + statusCode.isGood()); + System.out.println( key +" 信号写入结果:" + statusCode.isGood()); } client.disconnect(); }catch (Exception e) {