Expanding the Operator Interface (BE1) 08/2005
3 Syntax
© Siemens AG, 2005. All rights reserved
BE1/3-96 SINUMERIK 840D sl/840D/840Di/810D HMI Installation and Start-Up Guide (IAM) – 08/2005 Edition
Example:
PRESS(VS1)
VAR01 = 16 SHL 2 ;Result = 64
VAR02 = VAR02 SHL VAR04 ;Convert content of VAR02 to 32-bit unsigned
;and shift content to left by number of bits
;specified in VAR04. Then convert
;32-bit value back to format of
;variable VAR02.
END_PRESS
SHR operator
Syntax:
variable = value SHL increment
value value to be shifted
increment number of shift increments
Function:
Bits are shifted to the right using the function SHR. You can specify both the value
to be shifted and the number of shift increments directly or via a variable.
If the limit of the data format is reached, the bits are shifted beyond the limit without
displaying an error message.
Example:
PRESS(VS1)
VAR01 = 16 SHR 2 ;Result = 4
VAR02 = VAR02 SHR VAR04 ;Same effect as SHL but shift to right
Table 3-12
Mathematical functions
SIN(x)
Sine of x
COS(x)
Cosine of x
TAN(x)
Tangent of x
ATAN(x, y)
Arc tangent of x/y
SQRT(x)
Square root of x
ABS(x)
Absolute value of x
SDEG(x)
Conversion to degrees
SRAD(x)
Conversion to radian
Note
The functions operate with radian measure. The functions SDEG() and SRAD()
can be used for conversion.