Siemens SINUMERIK Commissioning Manual page 463

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

Advertisement

Example
PRESS(VS1)
VAR01 = 16 SHL 2
VAR02 = VAR02 SHL VAR04
END_PRESS
SHR operator
Bits are shifted to the RIGHT using the SHR (SHIFT RIGHT) function. 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.
Use
Syntax:
Description:
Parameters:
Example
PRESS(VS1)
VAR01 = 16 SHR 2
VAR02 = VAR02 SHR VAR04
END_PRESS
Expanding the user interface
Commissioning Manual, 11/2006, 6FC5397-0DP10-0BA0
; Result = 64
; 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.
value
increment
variable =
SHR
Shift Right
value
value to be shifted
increment
number of shift increments
; Result = 4
; 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.
Programming
2.8 Operators
2-113

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents