Jump to content

Component: JSON Encoder (Comms: IoT/Cloud)

From Flowcode Help
Revision as of 11:57, 3 November 2023 by Wiki bot (talk | contribs) (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Author Matrix TSL
Version 1.0
Category Comms: IoT/Cloud


JSON Encoder component

Allows dynamic key and value pairs to be created and assembled into a formatted JSON string.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_JSONEncoder.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_JSONEncoder.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples

Macro reference

AssignDataAsFloat

AssignDataAsFloat
Assigns a data value as a floating point value 
- UINT Element
Index of the element to assign the data to 
- FLOAT Data
 
- BYTE NumDP
Number of decimal points 
- VOID Return


AssignDataAsNumber

AssignDataAsNumber
Assigns a data value as a integer value 
- UINT Element
Index of the element to assign the data to 
- LONG Data
 
- VOID Return


AssignDataAsString

AssignDataAsString
Assigns a data value as a string 
- UINT Element
Index of the element to assign the data to 
- STRING Data
 
- VOID Return


AssignName

AssignName
Assigns a name value as a string. Call this macro first before assigning data to the element. 
- UINT Element
Index of the element to assign the data to 
- STRING Name
 
- VOID Return


ClearAll

ClearAll
Clears all the names and data values out of the buffer 
- VOID Return


GenerateJSON

GenerateJSON
Generates a JSON data string with the current specified values. 
- STRING Return


Property reference

Properties
Data Bytes
Number of bytes used to store the entire data for the JSON message. Includes names and data values so make sure this is large enough to store everything you want to be able to put into a single JSON data string.