Create a Variable
How to create a variable
We would like to transform our temperature property created here from Celsius to Fahrenheit. To do so, we will use a variable.
In the configuration view, go to Variables and click on the top right Add
button.
Here is the form, already filled for the example.
Variable Name
The same nomenclature advice applies for both properties and variables, so we named the variable CNC_temperature_fahrenheit
.
The only mandatory rules for variable names are:
- No spaces or special characters
- Numbers are allowed, but not for the first characters (underscore is allowed)
- Some names are protected, ex: NOW or TIME
- You can not have duplicated variable names, even between variables and stream properties
Formula / Expression
Expressions can be seen as Excel formulas, without the functions. The main feature with expressions is to reuse other variables, including stream properties. Use $ to show the list of variables and reference others in your expression.
Syntaxe rules apply to expressions as well, but we will see them later. For now, let's stick with simple mathematical expressions.
Units
Like properties, they also are optional. Here we decided to indicated that our temperature was in Fahrenheit.