Neg (negation)

The Neg instruction converts a value to a negated value.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
NEG
NEG
Neg parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
When set to true, the instruction is enabled.
  • TRUE: Execute the current computation.
  • FALSE: There is no computation.
Applies to ladder diagram programs.
i1
Input
SINT
INT
DINT
LINT
REAL
LREAL
Input and output must be the same data type.
o1
Output
SINT
INT
DINT
LINT
REAL
LREAL
Input and output must be the same data type.
ENO
Output
BOOL
Enables output. Applies to ladder diagram programs.

Neg examples

NEG function block diagram example
NEG function block diagram example
NEG ladder diagram program example
NEG ladder diagram program example
(* ST equivalence: *) ao23 := - (ai10); ro100 := - (ri1 + ri2);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal