3. Instruction Set API 32 Operands: D : Device to be rotated n : Number of bits to be rotated in 1 rotation Explanation: 2. The status of the last bit rotated (marked with ※ ) is moved to the carry flag M1022. 1. This instruction rotates bit status of the device D together with M1022 to the right for n bits. 3. This instruction is generally used in pulse execution mode (RCRP, DRCRP). 4. If operand D uses index F, only a 16-bit instruction is available. 5. If operand D is specified as KnY, KnM or KnS, only K4 (16-bit) or K8 (32-bit) is valid. 6. Valid range of operand n : 1≤ n ≤16 (16-bit), 1≤ n ≤32 (32-bit) Program Example:
When X0 goes from OFF to ON, the 16 bits (4 bits as a group) in D10 together with carry flag M1022 (total 17 bits) will rotate to the right, as shown in the figure below. The bit marked with ※ will be moved to carry flag M1022 X0 Rotate to the right Lower bit Upper bit 1 D10 M1022 16 bits Carry flag After one rotation to the right Lower bit D10 Upper bit 0 M1022 Carry flag 3-93 Mnemonic Operands Function Controllers SA2 ES2/EX2 SS2 SX2 SE Controllers D RCR P Rotation Right with Carry ES2/EX2 SS2 SA2 SX2 SE Type OP Bit Devices Word devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F RCR, RCRP: 5 steps DRCR, DRCRP:
9 steps D * * * * * * * * n * * PULSE 16-bit 32-bit SA2 SX2 SS2 SA2 SX2 SA2 SX2 ES2/EX2 SS2 ES2/EX2 ES2/EX2 SS2 SE SE SE RCRP D10 K4 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 1 1 0 1 0 0 0 0 1 1 1 1 0 0 0 0