Programming
2.3 Variables
Expanding the user interface
Commissioning Manual, 11/2006, 6FC5397-0DP10-0BA0
2-31
Calculation with variables
Variables are calculated every time you exit an input/output field (by pressing the ENTER or
TOGGLE key). The calculation is configured in a CHANGE method that is processed every
time the value changes.
You can scan the variable status to ascertain the validity of the value of the variable, e.g.,
Var1 = Var5 + SIN(Var2)
Otto = PI * Var4
Addressing system variables indirectly
A system variable can also be addressed indirectly, i.e., as a function of another variable:
PRESS(HS1)
AXIS=AXIS+1
WEG.VAR="$AA_DTBW["<<AXIS<<"]" ;Address axis address via
variable
END_PRESS
Changing the softkey label
Example
HS3.st = "New Text" ;Change softkey label
2.3.9 Example 1: Assigning the Variable Type, Texts, Help, Colors properties
Example 1
Assigning the Variable Type, Texts, Help, Colors properties
DEF Var1 = (R///,"Actual value",,"mm"//"Var1.bmp"////8,2)
Variable Type: REAL
Limits or toggle field entries: none
Default: none
Texts:
Long text: None
Short text: Actual value
Graphic text: none
Unit text: mm
Attributes: none
Help display: Var1.bmp
System or user variable: none
Position of short text: No data, i.e., default position
Position of input/output field:
No data, i.e., default position