JSONBuilder.SetObject (METH) ¶ METHOD SetObject : DINT This method adds an object element to the element with index diParentIndex. Generates JSON: {} The output of this method should return NO_ERROR InOut: Scope Name Type Initial Return SetObject DINT Input diParentIndex DINT 0 Output eError ERROR
JSONBuilder.SetValue (METH) ¶ METHOD SetValue : DINT This method sets a value of any supported datatype to the element with index diParentIndex. Supported datatyes are BOOL, BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, LINT, REAL, LREAL, DATEANDTIME, DATE, TIME, STRING and WSTRING Not supported datatypes e.g. LWORD, ULINT, LDT, LTIME, or LDATE do occure an error output -> ERROR.NOTSUPPORTED_DATATYPE InOut: Scope Name Type Initial Return SetValue DINT Input Value __SYSTEM.AnyType diParentIndex DINT 0 Output eError ERROR
JSONData.Clear (METH) ¶ METHOD Clear : ERROR Clears the underlying data array. InOut: Scope Name Type Return Clear ERROR
JSONData.FindAllElementsByKey (METH) ¶ METHOD FindAllElementsByKey : ERROR Find all elements by key. InOut: Scope Name Type Comment Return FindAllElementsByKey ERROR Input wsKey WSTRING(GParams.g_diMaxStringSize) The key to search diStartIndex DINT Index of the array to start the search pResult POINTER TO JSONElement Pointer to the result array udiMaxSize UDINT Maximum size of pResult Output udiResultSize UDINT The size of the result array
JSONData.FindFirstElementByKey (METH) ¶ METHOD FindFirstElementByKey : ERROR Find the first element in the data array by key. InOut: Scope Name Type Comment Return FindFirstElementByKey ERROR Input wsKey WSTRING(GParams.g_diMaxStringSize) The key to search diStartIndex DINT Index of the array to start the search Output jsonElement JSONElement The first element in the array with the requested key
JSONData.FindFirstValueByKey (METH) ¶ METHOD FindFirstValueByKey : ERROR Find the first value of the requested key. InOut: Scope Name Type Comment Return FindFirstValueByKey ERROR Input wsKey WSTRING(GParams.g_diMaxStringSize) The key to search diStartIndex DINT Start index Output jsonElement JSONElement The first value for the requested key
JSONData.GetChildren (METH) ¶ METHOD GetChildren : ERROR Get all children of an element InOut: Scope Name Type Comment Return GetChildren ERROR Input diIndex DINT Index of the parent element pResult POINTER TO JSONElement Children of the parent element index udiMaxSize UDINT Maximum number of children Output udiResultSize UDINT Size of the result array
JSONData.GetElementByIndex (METH) ¶ METHOD GetElementByIndex : ERROR Get an element by index InOut: Scope Name Type Comment Return GetElementByIndex ERROR Input diIndex DINT Index of the element Output jsonElement JSONElement The element with the requested index
JSONData.SetArray (METH) ¶ METHOD SetArray : ERROR Method to set an object InOut: Scope Name Type Comment Return SetArray ERROR Input diIndex DINT Index of the lement diParentIndex DINT Parent index, -1 if top level
JSONData.SetBool (METH) ¶ METHOD SetBool : ERROR Method to set BOOL values InOut: Scope Name Type Comment Return SetBool ERROR Input bValue BOOL Value diIndex DINT Index of the lement diParentIndex DINT Parent index, -1 if top level