Integer shift register

B111_INTEGER_SHIFT_REGISTER

PROGRAM TEST B111
  VAR 
    REAL1: REAL;
    BOOL1: BOOL;
    ARRAYINT: ARRAY[1..24] OF INT;
  FB : LIB.CORE.V1_0.B110_SHIFT_REGISTER;
 END_VAR 
     FB(IN:=INT1,BR:=BOOL1,OUT=>ARRAYINT);
END_PROGRAM

LIB\CORE

V1.0

Shift register containing up to 24 integer values.

InputTypeDescription Default value
IN INT Input value 0
BR BOOLShift by one (at rising edge)False
Output Type Description
OUT ARRAY[1..24] OF INTArray 1..24 of outputs
SHIFTTIMEDT Time of last shift

The block is a shifting register; at each rising edge on the br input the input value in is saved at the first output out, and the output values are moved by one position higher. The value of the output 24 is lost. The shifttime output returns the time of the last shift.

The block is used for averaging, bar graphs, consumption calculations, etc.

  • © Energocentrum Plus, s.r.o. 2017 - 2024