Chapter 8 Logic Instructions
8-135
FB/FC
FC
ROL is used to rotate left all bits of a variable or constant by the specified
number of bits and the result is output to Out.
Parameters
Meaning
Description Valid range
In
Data to
rotate
Input
The original data to rotate
left
Depends on the data type of the
variable that the input parameter is
Num
Number of
bits
Input
which the bits of the
original data are rotated
Depends on the data type of the
variable that the input parameter is
connected to.
Out Result Output
bits of the original data by
the number of bits
specified by Num to the
Depends on the data type of the
variable that the output parameter is
connected to.
Boolean
Bit string Integer
Real
number
Time, date
String
WORD
LWORD
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
TIME
TOD
DT
STRING
In
●
● ● ● ● ● ● ●
Num
●
The data type of Out must be the same as In.
Note:
The symbol ● indicates that the parameter is allowed to connect to the variable or constant of the data
type.
Function Explanation
ROL is used to rotate all bits of the value of In by the number of bits specified by Num to the left and the
result is output to Out.