SIS function blocks > SIS Math Blocks > Logic Solver Calculation function block > Expressions in DeltaV SIS Software > Functions in Logic Solver Expressions

ROTL function

ROTL(x,y). Rotates the unsigned x by y bits to the left (that is, it returns the bitwise left-rotated value of x, rotated by the value of y). The function wraps bits rotated off one end of the value to the other end.
Note

Calc Block parameters IN1 through IN16 are floating point registers; having sections for sign, mantissa and exponent. This is different than integer register format. Mapping or wiring integer parameters to IN1 through IN16 will result in the data being type-casted from Integer to float. ROL, ROR, ROTL, ROTL16, ROTR, ROTR16, SHL and SHR functions are typically used with Integer parameters. Using ROR, ROTL, ROTL16, ROTR, ROTR16, SHL and SHR with floating point registers (IN1 through IN16) can give unexpected results.

Syntax:

'external reference' := ROTL(Integer value, Integer value );

Example:

VAR
   T63; T64; T17; (* Temporary values *)
END_VAR;
T63 := 1;
T64 := 5;
T17 := ROTL(T63,T64);

The above example shows T63 set to the value of 1 and T64 set to the value of 5. T17 is set to the result of ROTL(T63,T64), which is 32.

Note

ROTL performs the same function as ROL.