GetSnapshot

Calling this method triggers getting the latest OPC UA value from a list of item references.

Method Name: GetSnapshot

Payload: The payload takes a list of OPC UA items. The below example shows a case with 3 items.

{
  "items" : [
    "ns=3;s=ExampleItem1",
    "ns=3;s=ExampleItem2",
    "ns=3;s=ExampleItem3"
  ]
}

Result The direct method returns a payload, containing values for each item.

StatusCode: 0 means "Good". StatusCode: 2150891520 means "NodeId not defined"

{
    "result": [
        {
            "value": {
                "value": {
                    "Int32": {
                        "@xmlns": "http: //opcfoundation.org/UA/2008/02/Types.xsd",
                        "#text": "71"
                    }
                }
            },
            "statusCode": {
                "code": 0
            },
            "sourceTimestamp": "2022-03-18T12:16:39Z",
            "sourcePicoseconds": 0,
            "serverTimestamp": "2022-03-18T12:16:39.395Z",
            "serverPicoseconds": 0
        },
        {
            "value": {
                "value": {
                    "Double": {
                        "@xmlns": "http://opcfoundation.org/UA/2008/02/Types.xsd",
                        "#text": "-0.2163341783459245"
                    }
                }
            },
            "statusCode": {
                "code": 0
            },
            "sourceTimestamp": "2022-03-18T12:16:39Z",
            "sourcePicoseconds": 0,
            "serverTimestamp": "2022-03-18T12:16:39.395Z",
            "serverPicoseconds": 0
        },
        {
            "value": {
                "value": {
                    "Null": {
                        "@xmlns": "http://opcfoundation.org/UA/2008/02/Types.xsd"
                    }
                }
            },
            "statusCode": {
                "code": 2150891520
            },
            "sourceTimestamp": "0001-01-01T00:00:00",
            "sourcePicoseconds": 0,
            "serverTimestamp": "0001-01-01T00:00:00",
            "serverPicoseconds": 0
        }
    ],
    "diagnostics": []
}

Last updated

Was this helpful?