DVP-15MC Series Motion Controller Operation Manual
8-136
Via ROL, the bits shifted out of the left will shift to the null bits in the right one by one. When Num=2, all
bits of the value of In rotates by two bits to the left. The rotation method is that Bit0~Bit5 are shifted to
Bit2~Bit7 respectively, Bit 7 is shifted to Bit1 and Bit 6 is shifted to Bit0.
Precautions for Correct Use
The input variables are not allowed to omit. An error will occur during the compiling of the software
if any input variable is omitted. But the output variable is allowed to omit.
The value of Out is the same as In when the value of Num is 0.
The number of bits by which the bits of original data are rotated left is equal to the value of Num
MOD In when the value of Num is greater than the number of bits of the value of In.
For example, if the data type of In is BYTE, the value of out when Num=USINT#1 is the same for
when Num=USINT#9.
Programming Example
The data types of ROL_In and ROL_Num are UINT and USINT respectively and their values are
300 and 3 respectively. The data type of Out1 is BYTE and the value of Out1 is 2400 when
ROL_EN is TRUE.
The variable table and program
Illustration of the example
1
0
1
0
1
1
0
1
01
1
0
1
0
1
1
Bit0Bit7
In
Out
Num=2, shifted by two bits left
Bit0
Bit7
1
ROL
EN ENO
In Out
ROL_EN
ROL_In Out1
Num
ROL_Num
0
1
0
1
1
0 00
0
Bit0Bit15
ROL_In
Out1
ROL_Num=3 rotated by three bits to the left,
1
0000000
0001011 0 00 10000
Bit0Bit15