BiancoRoyal / node-red-contrib-iiot-opcua

deprecated - very new developed by PLUS for Node-RED - https://plus4nodered.com
https://www.npmjs.com/package/node-red-contrib-iiot-opcua
BSD 3-Clause "New" or "Revised" License
34 stars 9 forks source link

**Address Space Script** of OPC UA server with Boolean, String or Datetime #120

Closed EngDiego closed 2 years ago

EngDiego commented 4 years ago

Hello, I trying use Address Space Script of OPC UA server with Boolean, String or Datetime but ins`t working. Could you help, what i need to do in code bellow to work? (with Byte, float, double, Int16,32.... works)

const gsamTopCyc = namespace.addVariable({
  "organizedBy": samFolder,
  "browseName": "TopCyc",
  "nodeId": "ns=1;s=TopCyc",
  "dataType": "Boolean",    <<===
    "value": {
      "get": function() {
        return new Variant({
          "dataType": DataType.Boolean,  <<===
          //"value": enable
          "value": flexServerInternals.sandboxFlowContext.get("samTopCyc")
        });
      },
      "set": function(variant) {
        flexServerInternals.sandboxFlowContext.set(
    "samTopCyc",
          parseFloat(variant.value)
        );
        return opcua.StatusCodes.Good;
      }
    }
    });
UlrichEntrenco commented 4 years ago

Hi, I got the same issue. Is it a typo or is the datatype "boolean" not implemented yet? Thanks!

biancode commented 4 years ago

@UlrichEntrenco the type is implemented, but there is maybe a change and it does not work as expected anymore.

biancode commented 4 years ago

please, try the new node-red-contrib-opcua-server