Negate NEG

Dest = Source with its sign flipped.

TagAfter two scans
NegOffset-5
Offset5

How it works

While the rung is true, writes Source with its sign flipped, so 5 becomes -5. A false rung changes nothing.

How it's used

Use NEG to reverse a direction or an offset.

TagValue
Reverse1
Speed300
Command-300

Reverse is on, so Command is -300.

Operands

OperandData typeRead or write
SourceDINT, REAL or a numberReads
DestDINT, REALWrites

Common mistakes

  • Using the smallest DINT-2147483648 has no positive DINT, so it is a fault.