Data Write Global
This function block stores incoming data into a shared global storage accessible by other blocks in the same scenario. It is useful when you need to pass values across different parts of a scenario, create simple cross-flow communication, or implement loops that require shared state. Note that using global storage can introduce timing or integrity limitations β it does not guarantee strict data flow ordering.
π₯ Inputs
Generic The data to be stored in the global storage under the chosen key.
π€ Outputs
This function block does not produce any outputs.
πΉοΈ Controls
Key A text field where you enter the name used to store the incoming data in global storage. Use a clear, unique key to avoid unintended overwrites.
π― Features
Persistent cross-block storage within the running scenario, enabling sharing of values, images, lists, or any generic data type.
Works well for creating communication points when direct socket connections are impractical (for example, when implementing loops).
Simple write-only interface: when data is provided to the input, the block writes it to global storage under the chosen
Key.Lightweight and fast for small amounts of data.
βοΈ Running mechanism
When the block receives a value on the
Genericinput, it stores that value in the scenario's global storage using the text entered in theKeycontrol.The block itself does not return a value; other blocks can retrieve the stored data by reading the same
Keyfrom global storage.Because global storage is shared, writes can overwrite previous values with the same key. Timing between writes and reads depends on the flow of the scenario.
π Usage Instructions
Enter a unique name into the
Keycontrol.Provide the data you want to share into the
Genericinput.Use a corresponding read block to access the stored data elsewhere in the scenario.
π‘ Tips and Tricks
Use
Data Read Globalto retrieve values written by this block in other parts of your scenario.For local-only communication inside a tight loop, prefer
Data Write LocalandData Read Localto avoid broad shared-state side effects.To inspect what is being written during development, connect a
Debug Inputblock or useCSV Export/Data to JSONto log content.When storing complex structured data (lists, dictionaries), consider converting it to a serializable format with
Data to JSONbefore writing, and parse it after reading.If you need to save images or many frames, combine this block with
Image LoggerorMulti Image Writerather than keeping large image batches in global memory.Avoid key name collisions by adopting a naming convention (for example, prefixing with a module name or purpose).
β
Best practices
Choose descriptive keys and document them in your scenario so other users know what each key contains.
Keep global writes minimal and infrequent for better predictability.
If multiple writers may update the same key, design a handshake or versioning pattern (for example, write a timestamp or counter alongside the data) so readers can determine freshness.
π οΈ Troubleshooting
If a reader cannot find expected data, confirm the exact
Keytext matches between writer and reader.If values appear stale or overwritten unexpectedly, check other parts of the scenario for writes to the same key and consider using local storage instead.
If you encounter inconsistent behavior in loops, try restructuring the flow to read immediately after a write or use explicit flow-control blocks to synchronize operations.
Last updated
Was this helpful?