Skip to main content

Variables – Dynamic Reading

The "Variables – Dynamic Reading" transfer object allows you to read variables whose names are not determined until runtime. Unlike with the Variable Transfer Object, you do not select the variable during project configuration; instead, you pass the variable name via an input pin—for example, from an upstream transfer object, a database query, or a script.

The transfer object has two pins:

PinDirectionDescription
VariableNameInputName of the variable to be read. An array of names is also possible; in this case, all specified variables are read.
ValueOutputThe read value. For an array of names, an array of values in the same order.

After double-clicking the transfer object, configure the following properties:

PropertyDescription
ScopeIf “Global (across all flows)” is enabled, the variable is searched for in the global scope. Otherwise, it is searched for in the local scope of the respective flow.
BehaviorIf “Create variable if not present” is enabled, an unknown variable is automatically created as a type-less variable when read. If the option is disabled, an unknown variable name results in a transfer error—this way, typos in variable names are immediately detected.

Automatically created global variables are retained even after restarting the OPC router. The Variables dialog in the Plug-ins section offers the option to import such runtime-created variables into the configuration; they can then be edited like any other variable.

Values of variables of the type “Secret String” are displayed masked in transfer monitoring, even within value arrays. The actual value is passed on unchanged to the next transfer object.