AS Series Programming Manual Symbol D : Device to rotate n : Number of bits in a group _6 Explanation 1. This instruction divides the bits in the device specified by D into groups ( n bits in a group), and then rotates these groups to the left. 2. Only the DROL instruction can use the 32-bit counter, but not the device E. 3. For 16-bit instructions, the value of n must be between 1–16. For 32-bit instructions, the value of n must be between 1–32. When n is less than 0, the instruction is not executed. When n exceeds the range, the instruction is executed with n at the maximum value (32) of the range. 4. In general, the ROLP and DROLP pulse instructions are used.
Example When X0.0 switches from OFF to ON, the instruction divides the values of the bits in D10 into groups (four bits as a group), and then rotates these groups to the left. The value of the bit marked ※ is transmitted to the carry flag SM602. 6-260 API Instruction code Operand Function 0902 D ROL P D, n Rotating bits in a group to the left Device X Y M S T C HC D FR SM SR E K 16# “$” F D n BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type D n Pulse instruction 16-bit instruction 32-bit instruction AS AS AS