Fnc 31 - Rol / Rotation Left - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
11.2
FNC 31 – ROL / Rotation Left
Outline
This instruction shifts and rotates the bit information leftward by the specified number of bits without the carry
flag.
1. Instruction format
FNC 31
D
ROL
P
2. Set data
Operand Type
D
n
*1.
Do not set a negative value to the number of bits to be rotated.
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
D
n
1: In 16-bit operations, K4Y
In 32-bit operations, K8Y
2: This function is supported only in FX
Explanation of function and operation
1. 16-bit operation (ROL and ROLP)
"n" bits out of 16 bits of
Command
input
FNC 31
ROLP
• The final bit is stored in the carry flag (M8022).
• In a device with digit specification, K4 (16-bit instruction) is valid.
Carry flag
Before
execution
The status of
the bit "16−n" is
copied.
After
execution
Carry flag
M8022
The contents of
b12 are stored.
Mnemonic
16-bit Instruction
ROL
5 steps
ROLP
Word device number storing data to be rotated leftward
Number of bits to be rotated
[n ≤ 16 (16-bit instruction), n ≤ 32 (32-bit instruction)]
Digit Specification
1
1
, K4M
, K8M
/FX
3U
are rotated leftward.
D
D
n
"n" bits (in the case of K4)
High order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
M8022
1 1 1
1
1 1 1 1 0 0 0 0 0 0 0 0
Leftward
rotation
High order
b15b14b13b12b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
1
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1
Before shift
b11 to b0
11 Rotation and Shift Operation – FNC 30 to FNC 39
Operation Condition
32-bit Instruction
Continuous
9 steps
Operation
Pulse (Single)
Operation
Description
*1
Word Devices
Special
System User
Index
Unit
V Z Modify K H
1
2
and K4S
are valid.
and K8S
are valid.
PLCs.
3UC
Low order
After the
instruction
is executed
b12 (16−n) to
once
b15 are moved.
"n" bits
Low order
1
Before shift
b15 to b12
11.2 FNC 31 – ROL / Rotation Left
Mnemonic
Operation Condition
Continuous
DROL
Operation
Pulse (Single)
DROLP
Operation
Data Type
16- or 32-bit binary
16- or 32-bit binary
Others
Con-
Real
Charac-
Pointer
stant
Number
ter String
E
" "
309
11
12
13
14
15
P
16
17
18
19
20

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents