hfxc226 2 жил өмнө
parent
commit
8c9e397c06

+ 8 - 1
platform-opc/src/main/java/com/platform/opc/util/OpcDAClient.java

@@ -363,6 +363,7 @@ public class OpcDAClient {
     private static String getVal(JIVariant var) throws JIException {
         String value;
         int type = var.getType();
+        log.info("type" + type);
         switch (type) {
             case JIVariant.VT_I2:
                 value = var.getObjectAsShort() + "";
@@ -383,7 +384,13 @@ public class OpcDAClient {
                 value = var.getObjectAsString2() + "";
                 break;
             case JIVariant.VT_BOOL:
-                value = var.getObjectAsBoolean() + "";
+                boolean result = var.getObjectAsBoolean();
+                log.info("result:" + result);
+                if(result){
+                    value = "1";
+                }else{
+                    value = "0";
+                }
                 break;
             case JIVariant.VT_UI2:
             case JIVariant.VT_UI4: