jsonReadVariableList

This function block reads a list of variables and outputs their current values as a JSON object.

Function Block Interface

I/O Parameter Description Data type Default Value
IN pVariableList Address of the list of variables to read UDINT (STRING*)
IN pCache Address of the cache variable to use UDINT (jsonCache_typ*)
IN BufferSize Size of memory to allocate for internal data buffers UDINT 100000
IN MaxIterations Maximum number of iterations to perform while processing UDINT 10000
OUT Status Function block status. 0 = Successful read. UINT
OUT pJSONObject Address of the JSON object containing the variable values UDINT (STRING*)
OUT JSONObjectLength String length of the JSON object UDINT

Protocol

VariableList: ["globalVar", "myTask:localVar"]

JSONObject: [
    {
      "globalVar": 25
    },
    {
      "myTask:localVar": {
        "elem1": "Hello",
        "elem2": 123.456
      }
    }
  ]