3 . I n s t r u c t i o n S e t
M N050 03003E F or mo re infor ma tio n vi sit:
w w w. e a t o n . c o m
3-83
API Mnemonic
Operands
Function
31
D ROL P
D, n
Rotate Left
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
D
*
*
*
*
*
*
*
*
n
*
*
ROL, ROLP: 5 steps
DROL, DROLP: 9 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
D
: Address to be rotated
n
: Number of bits to be rotated in 1 rotation
Description:
1.
All the bits of
D
are rotated
n
bit places to the left on every operation of the instruction, which
could be every scan.
2.
The status of the last bit rotated is copied to the carry flag M1022.
3.
This instruction works best using pulse instruction (ROLP, DROLP).
4. If
operand
D
uses index F, then only 16-bit instruction is available.
5. If
operand
D
is specified as KnY, KnM, KnS, only K4 (16-bit) and K8 (32-bit) are valid.
6.
Valid range of operand
n
: 1
≤
n
≤
16 (16-bit), 1
≤
n
≤
32 (32-bit)
Program Example:
When X0 goes from OFF
→
ON, all 16 bits of D10 will rotate 4 bits to the left, as shown in the
diagram, and b12 (prior to rotation) will be moved to the carry flag (CY) M1022.
X0
D10
K4
1 1 1
1 1
1 0 0
0
0 0
1
1
0 0
0
1
1 0 0 0
0 0
1 1
0
0
1
1
0
1
1 1
16 bits
Rotate to the left
After one rotation
to the left
Carry
flag
Carry
flag
D10
D10
Upper bit
Upper bit
Lower bit
Lower bit
ROLP
M1022
M1022
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...