Siemens SINUMERIK Commissioning Manual page 427

Sinumerik 840di sl/840d sl/840dbase software and hmi advanced
Hide thumbs Also See for SINUMERIK:
Table of Contents

Advertisement

2.7.8
Evaluate (EVAL)
Description
The EVAL function evaluates a transferred expression and then executes it. With this
function, expressions can be programmed during runtime. This can be useful, for example,
for indexed access operations to variables.
Programming
Syntax:
Description:
Parameters:
Example
VAR1=(S)
VAR2=(S)
VAR3=(S)
VAR4=(S)
CHANGE()
REG[7] = EVAL("VAR"<<REG[5])
IF REG[5] == 1
ELSE
ENDIF
END_CHANGE
Expanding the user interface
Commissioning Manual, 11/2006, 6FC5397-0DP10-0BA0
(exp)
EVAL
Evaluates an expression
exp
REG[7] = VAR1
IF REG[5] == 2
REG[7] = VAR2
ELSE
IF REG[5] == 3
REG[7] = VAR3
ELSE
IF REG[5] == 4
REG[7] = VAR4
ENDIF
ENDIF
ENDIF
Logic expression
;
The expression in parentheses produces
VAR3 if the value of REG[5] is equal to 3.
The value of VAR3 is, therefore, assigned
to REG[7].
Programming
2.7 Functions
2-77

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents