Move bit data
This FP instruction moves a bit data from the bit data area specified by s1_Start and s2_End to the bit data block starting from the bit data area specified by d_Start if the trigger EN is TRUE.
Input
Starting address of the source bit data area
Ending address of the source bit data area
Output
Starting address of the destination bit data area
The input and output variables have to be of the same data type.
The operands s1_Start and s2_End should be:
in the same memory area, e.g. DT, WR, FL, LD ...
s1_Start £ s2_End
if s1_Start > s2_End
Corresponding F instructions: F5_BTM
In the global variable list you define variables that can be accessed by all POUs in the project.
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
bStart: BOOL:=FALSE;
(*activates the function*)
END_VAR
VAR_EXTERNAL
bStartAddress: BOOL:=FALSE;
bEndAddress: BOOL:=FALSE;
bTargetAddress: BOOL:=FALSE;
END_VAR
When the variable bStart is set to TRUE, the function is carried out. It moves the bits X1–X8 to the target area YD–Y14.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_F,FP_MOVE_BITS!,,13,1,22,6,,?DEN?Ds1_Start?Ds2_End?AENO?Cd_Start);
B(B_CONTACT,,bStart,6,2,8,4,);
B(B_VARIN,,bStartAddress,11,3,13,5,);
B(B_VARIN,,bEndAddress,11,4,13,6,);
B(B_VAROUT,,bTargetAddress,22,3,24,5,);
L(1,3,6,3);
L(8,3,13,3);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
If (bStart) then
FP_MOVE_BITS(s1_Start := bStartAddress, s2_End := bEndAdress, d_Start => bTargetAddress);
End_if;