Move data block
This FP instruction moves the data block from the data area specified by s1_Start and by s2_End to the block starting from the data area specified by d_Start if the trigger EN is TRUE.
Input
Starting address of the source data area
Ending address of the source data area
Output
Starting address of the destination data area
The following conditions apply:
The input and output variables have to be of the same data type.
The operands s1_Start and s2_End have to be in the same memory area, e.g. DT, WR, FL, LD ...
s1_Start£s2_End
Whenever s1_Start, s2_End and d_Start are in the same data area:
s1_Start=d_Start: The instruction will not be executed.
if s1_Start > s2_End
if the destination range is out of the available range
if s1_Start > s2_End
if the destination range is out of the available range
Corresponding F instructions: F10_BKMV
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*)
aiSource_Array: ARRAY [0..4] OF INT:=[1,2,3,4,5];
aiTarget_Array: ARRAY [0..2] OF INT:=[3(0)];
(*result after a 0->1 leading edge
from start: [2,3,4]*)
END_VAR
When the variable bStart is set to TRUE, the function is carried out.
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_CONTACT,,bStart,6,2,8,4,);
B(B_VARIN,,aiSource_Array[1],11,3,13,5,);
B(B_VARIN,,aiSource_Array[3],11,4,13,6,);
B(B_VAROUT,,aiTarget_Array[0],23,3,25,5,);
B(B_F,FP_MOVE_BLOCK!,,13,1,23,6,,?DEN?Ds1_Start?Ds2_End?AENO?Cd_Start);
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_BLOCK(s1_Start := aiSource_Array[0], s2_End := aiSource_Array[3], d_Start => aiTarget_Array[0]);
End_if;