Variable types

A variable type is a model variable from which you can create instances of the variable. Variable instances can contain other specific variables.

Predefined and custom variable types

Each project contains these predefined variable types:
Custom variable types that you or the application logic create are available only in the project in which you create them.
Tip: Changes to a variable type automatically apply to all instances of the variable. If you delete the variable type, you also delete all the subtypes of the variable type, along with the corresponding instances of the variable.

Variable

Variables contain specific data types (for example, a numeric Int32 value or a String value).

By default, every variable contains these attributes:
Attribute Description
BrowseName Name of the variable in the project.
DataType Data type that the variable can contain.
Description Description of the variable.
DisplayName Translatable variable name that can appear on the interface at runtime.
NodeId Automatically assigned unique identifier.
Value Value of the data.
For example, you can create a label with a string value of OK and then create a dynamic link between the variable and the Text property of a Button object.
Figure 1. Variable with a string value
Figure 2. Dynamic link between the Text property of a button and the string variable

Analog variable

Analog variables are structured variables that represent physical characteristics and ranges.

By default, every analog variable contains these attributes:
Attribute Property Data type Description
EngineeringUnits
Tip: The dynamic link window displays the EngineeringUnits variable type.
Description Localized text Description of the unit of measurement.
DisplayName Localized text Name of the unit of measurement.
UnitId Int32 Numeric unit of measurement.
EURange Lower limit Double Lower limit of the range of values for the variable.
High Limit Double Upper limit of the range of values for the variable.
Constrain Boolean If True: Values out of the range of not accepted and the previous value is retained. If False: Values out of the range are accepted.
For example, you can create a constrained linear gauge that sources data from a constrained variable.
Figure 3. Constrained analog variable
Figure 4. Constrained linear gauge that sources data from the analog variable (runtime)

Node pointer

Node pointers references nodes in the project.

The referenced node must be of the type and class defined by these properties:
Property Data type Description
Kind NodeId Type of object or type of variable from which the node is derived
NodeClass NodePointerNodeClass
  • Instance. The node can be only an instance

  • Type. The node can be only a type.

  • Any. The node can be an instance or a type

For example, Data logger objects have Store node pointer properties.
Figure 5. Node pointer that targets database objects