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

Parameter | Parameter Type | Data Type | Description |
---|---|---|---|
EN | Input | BOOL | When set to true, the instruction is enabled.
|
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 ladder diagram program example

(* ST equivalence: *) ao23 := - (ai10); ro100 := - (ri1 + ri2);
Provide Feedback