FP_MOVE_BLOCK

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.

Parameters

Input

s1_Start (INT, UINT, WORD, DINT, UDINT, DWORD, REAL, DATE, TOD, DT)

Starting address of the source data area

s2_End (INT, UINT, WORD, DINT, UDINT, DWORD, REAL, DATE, TOD, DT)

Ending address of the source data area

Output

d_Start (INT, UINT, WORD, DINT, UDINT, DWORD, REAL, DATE, TOD, DT)

Starting address of the destination data area

Remarks

  • 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.

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the area specified using the index modifier exceeds the limit.
  • if s1_Start > s2_End

  • if the destination range is out of the available range

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the area specified using the index modifier exceeds the limit.
  • if s1_Start > s2_End

  • if the destination range is out of the available range

Related topics:

Example

POU header

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

POU body

When the variable bStart is set to TRUE, the function is carried out.

LD body

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

ST body

If (bStart) then
    FP_MOVE_BLOCK(s1_Start := aiSource_Array[0], s2_End := aiSource_Array[3], d_Start => aiTarget_Array[0]);
End_if;

Modified on: 2019-08-23Feedback on this pagePanasonic hotline