Left shift register
Shifts 1 bit of the specified data area d_WR to the left (to the higher bit position). When programming the LSR instruction, be sure to program the data input DataInput, shift ShiftLeftTrigger and reset triggers Reset.
The area available for this instruction is only the word internal relay (WR).
Word internal relay (WR) number range, depends on the free area under .
Input
Specifies the state of new shift-in data:
new shift-in data 1: when the input is ON
new shift-in data 0: when the input is OFF
Shifts 1 bit to the left when the leading edge of the trigger is detected
Turns all the bits of the data area to 0 if the trigger is in the ON-state
Output
Specified data area where data shift takes place
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
Output: INT:=0;
DataInput: BOOL:=FALSE;
ShiftTrigger: BOOL:=FALSE;
ResetTrigger: BOOL:=FALSE;
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_F,LSR!,Instance,10,0,20,5,,?DDataInput?DShiftLeftTrigger?DReset?Cd_WR);
B(B_VARIN,,DataInput,8,1,10,3,);
B(B_VARIN,,ShiftTrigger,8,2,10,4,);
B(B_VARIN,,ResetTrigger,8,3,10,5,);
B(B_VAROUT,,Output,20,1,22,3,);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
Output:=LSR(DataInput, ShiftTrigger, ResetTrigger);