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

SHL function

SHL(x,y). Shift x left by y bits, no carry. SHL (x,y) shifts x (first operand) left by the number of positions y (second operand) specifies and fills with zeroes (0). This function does not carry bits rotated out.
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' := SHL(Integer value, Integer value );

Example:

VAR
   T63; T64; T17; (* Temporary values *)
END_VAR;
T63 := 1;
T64 := 5;
T17 := SHL(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 SHL(T63,T64), which is 32.