NOT

Bit inversion

NOT performs a bit inversion of input variables. The result will be written into the output variable.

Parameters

Input

Unnamed input (BOOL, WORD, DWORD)

Input for NOT operation

Output

Unnamed output (BOOL, WORD, DWORD)

Output as input: Result

Remarks

All operands must be of the same data type.

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
		input_value: WORD:=0;
			(*type: BOOL, WORD or DWORD*)
		negation: WORD:=0;
			(*type: BOOL, WORD or DWORD*)
	END_VAR

This example uses variables. You can also use a constant for the input variable.

POU body

The bits of input_value are inversed (0 is inversed to 1 and vice versa). The inversed result is written into negation.

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 2 ;
        NETWORK_BODY
B(B_F,NOT!,Instance,10,0,15,2,,?D?C);
B(B_VARIN,,input_value,8,0,10,2,);
B(B_VAROUT,,negation,15,0,17,2,);
L(1,0,1,2);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

negation:= NOT(input_value);

IL body

LD

input_value

NOT

ST

negation

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