Description, 4 instruction details, Chapter 2 instructions – KEYENCE Visual KV Series User Manual
Page 191: Sra / @sra / sla / @sla

2.4 Instruction Details
1
2
3-167
Chapter 2 Instructions
Description
•
Operations using the SRA instruction
When input relay 0000 is ON, the contents of DM0000 are transferred to the internal
register and shifted serially right by the operand value (5). The operation result is
written into DM0001. The contents of D
0
are shifted to carry bit 2009.
In the above example, the contents shift to the right by the operand value (5) every
scan time while input relay 0000 is ON.
Use @SRA, a differentiation type instruction, to execute the instruction only once
when input relay 0000 turns ON.
•
Operation using the SLA instruction
When input relay 0001 is ON, the contents of DM0000 are transferred to the internal
register and shifted serially left by the operand value (10). The operation result is
written into DM0011. The contents of D
15
are shifted to carry bit 2009.
In the above example, the contents shift to the left by the operand value (10) every
scan time while input relay 0001 is ON.
Use @SLA, a differentiation type instruction, to execute the instruction only once
when input relay 0001 turns ON.
Note: Special utility relay 2009 may turn ON in accordance with the operation
results; however, it changes immediately when another operation is executed.
Carry
1 1 0 0 1 0 0 0 1 1 1 0 0 1 0 0
0
2009
0 0 0 0 0 1 1 0 0 1 0 0 0 1 1 1
0
2009
D
15
D
14
D
13
D
12
D
11
D
10
D
9
D
8
D
7
D
6
D
5
D
4
D
3
D
2
D
1
D
0
D
15
D
14
D
13
D
12
D
11
D
10
D
9
D
8
D
7
D
6
D
5
D
4
D
3
D
2
D
1
D
0
Carry
1 1 0 0 1 0 0 0 1 1 1 0 0 1 0 0
0
2009
1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
1
2009
D
15
D
14
D
13
D
12
D
11
D
10
D
9
D
8
D
7
D
6
D
5
D
4
D
3
D
2
D
1
D
0
D
15
D
14
D
13
D
12
D
11
D
10
D
9
D
8
D
7
D
6
D
5
D
4
D
3
D
2
D
1
D
0
Carry
Carry
SRA / @SRA / SLA / @SLA
KVNKA Chap 02_4dP.p65
08.3.11, 0:03 PM
167