Data Read Global

This function block allows you to read data from a global storage that is accessible across different scenarios, facilitating loops and data sharing. Please note that data integrity is not guaranteed.

πŸ“₯ Inputs

This function block does not require any inputs.

πŸ“€ Outputs

Data The output provides the value associated with the specified key from the global data storage. If the key is not found, it returns -1.

πŸ•ΉοΈ Controls

Data Key A text box where you enter the key of the data you want to read from the global storage.

🎨 Features

Global Data Access This block gives access to data that is stored globally, allowing for easy retrieval and sharing of information between different parts of your application.

Warning for Missing Keys If the specified key is not found in the global storage, the function block logs a warning to help you troubleshoot.

πŸ“ Usage Instructions

  1. Specify Data Key: Enter the desired key into the Data Key text box to indicate which data should be retrieved.

  2. Run the Block: Execute the block to read from the global data storage. The value associated with the provided key will be output.

πŸ“Š Evaluation

When evaluated, this function block attempts to retrieve the data associated with the specified key in the global storage. If successful, it outputs the data; otherwise, it returns -1.

πŸ’‘ Tips and Tricks

Ensure Key Exists

Before attempting to read from global storage, you may want to verify that the key exists. You can use the Data Store Write Global to input the key and value first.

Check Data Types

Make sure that the data stored under the key matches the expected type in your workflow. Mismatches can lead to unexpected behavior in function blocks that process the data.

πŸ› οΈ Troubleshooting

Key Not Found Warning

If you receive a warning saying the key could not be found, double-check the spelling of the key entered and ensure that it was previously stored in the global data storage.

Unexpected Output

If the output is consistently -1, it indicates that the key does not exist. Consider using the Data Store Write Global function block to add the key to storage before reading.

Last updated