Skip to main content

MOVE — Copy a Value

MOVE

Source

source

Dest

dest

Copies a source value (literal or tag) into a destination tag.

Operands

NameType
sourceDINT | REAL
destDINT | REAL

How It Works

When the rung is true, source is read and written to dest every scan. When the rung is false, MOVE does nothing and dest keeps its last value.

Example — Change a Timer Preset at Run Time

Set a timer's preset based on which mode the machine is in.

XIC(ModeFast)MOVE(2000,CycleTimer.PRE);XIC(ModeSlow)MOVE(8000,CycleTimer.PRE)

While ModeFast is selected, CycleTimer.PRE is held at 2000. While ModeSlow is selected, it is held at 8000.

Example — Copy a Reading

XIC(SampleNow)MOVE(TempSensor,LastSample)

Common Mistakes

  • Moving a REAL into a DINT destination without expecting truncation — the fractional part is lost.