Referencing Variables
- Last UpdatedJul 18, 2023
- 1 minute read
Variables can be used to temporarily store information. Variables can be defined either globally in the <param> section of the XML file or locally in an <input> or <output> section.
Variables are defined using the <string> tag as shown in . For example:
<string name="MyIODevice">DISK_PLC</string>
To refer to a variable, use the following syntax:
{SectionName.VariableName}
For this example:
{parameters.MyIODevice}
The SectionName can be omitted if you are referencing a variable defined in the same section.
Variables are evaluated sequentially in the XML file. Variables in the <param> section are assigned first, followed by those in the <input> section, followed by variables in each <output> section in sequence. This means that:
-
Variables in the <param> section can be referenced by the <input> section and every <output> section in the same template.
-
Variables in the <input> section can be referenced by every <output> section.
-
Variables in each <output> section can only be referenced by subsequent <output> sections.