Bit Right Shift - Mitsubishi Electric Q173CPU Programming Manual

Q series motion controller
Hide thumbs Also See for Q173CPU:
Table of Contents

Advertisement

7 OPERATION CONTROL PROGRAMS
7.5.5 Bit right shift : >>
Format
[Usable data]
Setting
16-bit
data
Bit device
integer
type
(S1)
(S2)
[Setting data]
[Functions]
[Errors]
[Program examples]
(S1) >> (S2)
Word device
64-bit
32-bit
floating
integer
point
type (L)
type (F)
Setting data
(S1)
(S2)
(1) The data specified with (S1) is shifted to the right by the number of times specified
with (S2).
(2) If the most significant bit of (S1) is 1, 1 enters the most significant bit of the right
shift result.
If the most significant bit of (S1) is 0, 0 enters the most significant bit of the right
shift result.
(3) When (S1) is a 16-bit integer type and (S2) is a negative number or not less than
16, the result is 0.
(4) When (S1) is a 32-bit integer type and (S2) is a negative number or not less than
32, the result is 0.
(1) An operation error will occur if:
• (S1) or (S2) is an indirectly specified device and its device No. is outside the
range.
(1) Program which shifts #0 two bit positions to the right and substitutes the result to
D0
D0 = #0 >> K2
b15
D0
0 0 0 0 1 0 0 1 0 1 0 0 1 1 0 1
Usable Data
Constant
16-bit
32-bit
Coasting
integer
integer type
timer
type (K/H)
(K/H, L)
Description
Data to be right-shifted
Number of right shifts
b0
#0
7 - 22
F/FS
Number of basic steps
64-bit
Calculation
conditional
floating
expression
expression
point
type (K)
Data type of result
Data type of (S1)
(Integer type)
b15
b0
0 0 1 0 0 1 0 1 0 0 1 1 0 1 0 0
G
4
Bit
Comparison
conditional
expression
: Usable

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Q173cpunQ172cpuQ172cpun

Table of Contents