Comment on page
Data to JSON
The
Node_
JSON_Export
node in AugeLab Studio is used to convert data to JSON format. It allows you to connect data inputs and create a JSON-formatted data structure. This documentation will provide an overview of the node's functionality and how to use it effectively.The
Node_
JSON_Export
node converts connected data inputs into a JSON-formatted data structure. It collects data from the connected input sockets and creates a JSON object with headers and corresponding data values.- Node Title: Data to JSON
- Node ID: OP_NODE_JSON_EXPORT
- Tooltip: Connect data to create JSON-formatted data.
The node has one boolean input socket labeled "Start Logging". You can connect a boolean signal to this input socket to trigger the creation of JSON-formatted data. When the signal is
True
, the node will collect data from the connected input sockets and generate the JSON output.In addition to the "Start Logging" input socket, there can be up to ten additional input sockets labeled "Data_1" to "Data_10". These sockets allow you to connect data inputs to be included in the JSON structure.
The node has one output socket labeled "JSON Data". It provides the generated JSON-formatted data as a string.
The
Node_
JSON_Export
node has the following widgets:- Data Headers: This section allows you to set the headers for the data inputs. Each header corresponds to the connected data input socket. If no header is provided, the default header will be used (e.g., "Data_1" for the first input socket).
- Text Edits: There are up to ten text input fields where you can enter custom headers for the connected data input sockets. Leaving a text field empty will use the default header for that socket.
The behavior of the
Node_
JSON_Export
node can be affected by the following widget configurations:- Data Headers:
- By default, the node will use the default headers for the connected data input sockets (e.g., "Data_1", "Data_2", etc.).
- To set custom headers, enter the desired header text in the corresponding text input field. This allows you to provide more descriptive headers for your data.
- 1.Drag and drop the
Node_
JSON_Export
node from the node library onto the canvas in AugeLab Studio. - 2.Connect the desired data inputs to the input sockets of the node.
- 3.Set the data headers (optional):
- By default, the node will use the default headers for the connected data input sockets (e.g., "Data_1", "Data_2", etc.).
- To set custom headers, enter the desired header text in the corresponding text input field under the "Data Headers" section. Leave a field empty to use the default header for that socket.
- 4.Connect a boolean signal to the "Start Logging" input socket. When this signal is
True
, the node will collect the data from the connected input sockets and generate the JSON output. - 5.The generated JSON-formatted data will be provided as a string through the "JSON Data" output socket.
- 6.You can use the JSON data for further processing, storage, or transmission.
Let's walk through an example to illustrate how the
Node_
JSON_Export
node works.- 1.Drag and drop the
Node_
JSON_Export
node onto the canvas. - 2.Connect the desired data inputs to the input sockets. For example, let's connect data values to "Data_1" and "Data_2".
- 3.Set custom headers (optional):
- Enter the desired header text for the connected data input sockets in the corresponding text input fields under the "Data Headers" section. For example, enter "Temperature" for "Data_1" and "Pressure" for "Data_2".
- 4.Connect a boolean signal, such as a button press or a trigger, to the "Start Logging" input socket.
- 5.When the signal is triggered, the node will collect the data from the connected input sockets and generate a JSON object with the headers and data values.
- 6.The generated JSON-formatted data will be provided as a string through the "JSON Data" output socket.
- 7.You can use the JSON data for further processing, storage, or transmission.
- The
Node_
JSON_Export
node converts connected data inputs into a JSON-formatted data structure. - Custom headers can be set for the data input sockets to provide more descriptive field names in the generated JSON object.
- The JSON-formatted data is provided as a string through the "JSON Data" output socket.
That concludes the documentation for the
Node_
JSON_Export
node in AugeLab Studio. This node provides a convenient way to convert data into JSON format for further processing or storage.