Mitsubishi Electric MELSEC-Q/L Programming Manual page 390

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

Operation error
• There is no operation error in the DROR(P) or DRCR(P) instruction.
Program example
• The following program rotates the contents of D0 and D1, not including the carry flag, 4 bits to the right when XC is ON.
[Ladder Mode]
[Operation]
b31
b28 b27
D0, D1 0
0
0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
b31
b28 b27
D0, D1 1
1
1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
Contents of b3 to b0
before execution
• The following program rotates the contents of D0 and D1, including the carry flag, 4 bits to the right when XC is ON.
[Ladder Mode]
[Operation]
b31
D0, D1 0
b31
D0, D1 1
Contents of b2 to b0
before execution
7 APPLICATION INSTRUCTIONS
388
7.2 Rotation Instructions
b24 b23
b20 b19
b16
b15
b12 b11
b24b23
b20b19
b16
b15
b12 b11
Contents of b31 to b4
before execution
b28b27 b24b23 b20b19
b16
0
0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
b28b27 b24b23 b20b19
b16
1
1
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
*
Content of carry flag
SM700 before execution
* : ON/OFF status of the carry flag depends on its status before the execution of DRCR.
[List Mode]
Step
b8 b7
b4 b3
b0
Carry flag
b8 b7
b4 b3
b0
[List Mode]
Step
b15
b12b11
b8b7
b4b3
b15
b12b11
b8b7
b4b3
Before execution
Instruction
Device
Carry flag
(SM700)
0
(SM700)
1
Content of b3
before execution
Instruction
Device
Carry flag
(SM700)
b0
*
Carry flag
b0
(SM700)
1
Content of b3
before execution

Advertisement

Table of Contents
loading

Table of Contents