0
0
FreertosHow-ToBeginner · 3 min read

How to Use Move Instruction in PLC Programming

The MOVE instruction in PLC copies a value from a source to a destination without changing the source. Use MOVE by specifying the source and destination addresses; it transfers data instantly during program execution.
📐

Syntax

The MOVE instruction syntax requires two operands: the source and the destination. The source is the data you want to copy, and the destination is where you want to store that data.

Format: MOVE source, destination

This instruction copies the value from source to destination without altering the source.

plc
MOVE source, destination
💻

Example

This example copies the value from memory location MW10 to MW20. After execution, MW20 will hold the same value as MW10.

plc
NETWORK 1
// Move value from MW10 to MW20
MOVE MW10, MW20
Output
If MW10 = 1234 before execution, then MW20 = 1234 after execution.
⚠️

Common Pitfalls

  • Forgetting that MOVE copies data but does not modify the source.
  • Using incompatible data types between source and destination can cause errors.
  • Overwriting important data by moving values without checking destination contents.

Always verify source and destination addresses and data types before using MOVE.

plc
NETWORK 2
// Wrong: Moving from a bit to a word
MOVE I0.0, MW20  // This can cause unexpected results

NETWORK 3
// Correct: Moving word to word
MOVE MW10, MW20
📊

Quick Reference

InstructionDescriptionExample
MOVECopies value from source to destinationMOVE MW10, MW20
SourceData to copy (memory, input, constant)MW10, I0.0, #100
DestinationWhere data is stored (memory, output)MW20, Q0.0

Key Takeaways

Use MOVE to copy data from one location to another without changing the source.
Ensure source and destination data types are compatible to avoid errors.
Always check destination before moving data to prevent overwriting important values.
MOVE instruction syntax is simple: MOVE source, destination.
MOVE works instantly during program scan, reflecting updated values immediately.