FP_MOVE_INVERT

Data inversion and move

This FP instruction logically inverts the data or equivalent constant specified by s and transfers it to the data area specified by d if the trigger EN is TRUE.

Parameters

Input

s (WORD, DWORD)

Source data to be inverted

Output

d (WORD, DWORD)

Destination data

Remarks

The variables s and d have to be of the same data type.

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if the area specified using the index modifier exceeds the limit.
sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if the area specified using the index modifier exceeds the limit.
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*)
		wInput_value: DWORD:=16#00001234;
			(*this value will be 
inverted*)
		wOutput_value: DWORD:=0;
			(*result after a 0->1 leading
edge from start:
16#FFFFEDCB*)
	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 := 5 ;
        NETWORK_BODY
B(B_F,FP_MOVE_INVERT!,,17,0,27,4,,?DEN?D@'s'?AENO?Cd);
B(B_CONTACT,,bStart,6,1,8,3,);
B(B_VARIN,,wInput_value,15,2,17,4,);
B(B_VAROUT,,wOutput_value,27,2,29,4,);
L(8,2,17,2);
L(1,2,6,2);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF (bStart) then
    FP_MOVE_INVERT(s := wInput_value, d => wOutput_value);
END_IF;

Modified on: 2019-06-03Feedback on this pagePanasonic hotline