FP_MOVE2

Move two values to a destination area

This FP instruction copies two values from the inputs to a destination area defined by d_Start.

Parameters

Input

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

Source area

Output

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

Destination area

Remarks

The input and output variables have to be of the same data type.

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • If the values specified using the index modifier are out of range.

  • If the transfer range is outside the accessible range.

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • If the values specified using the index modifier are out of range.

  • If the transfer range is outside the accessible 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
		rArray: ARRAY [0..1] OF REAL:=[2(0.0)];
		bEnable: BOOL:=FALSE;
		rValue2: REAL:=3.4;
		rValue1: REAL:=1.2;
	END_VAR

POU body

When the variable bEnable is set to TRUE, the function is executed.

LD body

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_VARIN,,rValue1,18,2,20,4,);
B(B_VARIN,,rValue2,18,3,20,5,);
B(B_VAROUT,,rArray[0],28,2,30,4,);
B(B_CONTACT,,bEnable,5,1,7,3,);
B(B_F,FP_MOVE2!,,20,0,27,5,,?DEN?D@'s1'?Ds2?AENO?Cd_Start);
L(1,2,5,2);
L(7,2,20,2);
L(27,3,28,3);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

If (bStart) then
    FP_MOVE2(s1 := rValue1, s2 := rValue1, d_Start => rArray[0];
End_if;

Modified on: 2019-01-25Feedback on this pagePanasonic hotline