Operator - Performs an integer negation of the input.

Inputs

Input

Data type

Description

IN

DINT

Integer value.

Outputs

Output

Data type

Description

Q

DINT

Integer negation of the input.

Truth table (examples)

IN

Q

0

0

1

-1

-123

123

Remarks

In FBD and LD language, the block NEG can be used. In LD language, the operation is executed only if the input rung (EN) is TRUE. The output rung (ENO) keeps the same value as the input rung. In ST language, "-" can be followed by a complex boolean expression between parenthesis.

ST Language

Q := -IN;
Q := - (IN1 + IN2);

FBD Language

Fixed_Image

LD Language

The negation is executed only if EN is TRUE.
ENO keeps the same value as EN.

Fixed_Image


Created with the Personal Edition of HelpNDoc: Ensure High-Quality Documentation with HelpNDoc's Hyperlink and Library Item Reports