OPC UA Compact Server , how to create int variable for node

I am creating a OPC UA node for OPC UA Compact Server
From the example, i able to use the string or double. but unfortunely my new project request me to use a int32, how can i create a node in int32?

const m20230703 = namespace.addVariable({
      "organizedBy": opcUASubFolder102,
      "browseName": "OM_SortingId",
      "nodeId": "ns=1;s=OM_SortingId",
      "dataType": "Double",
      "value": {
        "get": function () {
          return new Variant({
            "dataType": DataType.Double,
            "value": flexServerInternals.sandboxFlowContext.get("OM_SortingId")
          });
        },
        "set": function (variant) {
          flexServerInternals.sandboxFlowContext.set(
            "OM_SortingId",
            parseInt(variant.value)
          );
          return opcua.StatusCodes.Good;
        }
      }
    });

Int32 instead of Double

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.