PLC Data Move Instructions: MOV, FILL, COP in Ladder Logic Explained

Share:
DCS and Automation
PLC Data Move Instructions: MOV, FILL, COP in Ladder Logic Explained

PLC data move instructions copy values between memory locations. MOV copies a single value. FILL writes one value into a range of registers. COP copies a block of consecutive registers.

MOV Instruction FILL Instruction COP Instruction Ladder Logic Data Handling

Data move instructions are among the most frequently used in any PLC program. They are the foundation of recipe management, setpoint loading, data logging, and initialisation routines in industrial automation.

Hello everyone, today we are going to learn about PLC data move instructions: MOV, FILL, and COP.

We will understand what each instruction does, how the source and destination parameters work, and when to use each one. We will also cover the key differences between MOV, FILL, and COP, look at worked examples for each instruction, and see real application uses in PLC ladder logic programs.
PLC data move instructions

PLC Data Move Instructions MOV FILL COP: What Each One Does

MOV (Move)
Source → Destination

Copies a single value from a source tag or constant into a single destination tag. The source is not cleared. MOV executes every scan when the rung is true.

FILL (File Fill)
Value → Array[0..N]

Writes the same single value into every element of a destination array over a specified length. Used to initialise or reset arrays to a known value.

COP (Copy File)
Array[0..N] → Array[0..N]

Copies a block of consecutive elements from a source array into a destination array of the same length. Used to copy recipes, buffer data, or snapshot an array.

Advertisement

MOV Instruction: Copy a Single Value

The MOV instruction has two parameters: Source and Destination. When the rung is true, the source value is copied into the destination every scan. The source is not changed by the instruction.

MOV Instruction Parameters
MOV
  Source: Setpoint_HMI  ( any tag, constant, or input register )
  Dest:   PID_Setpoint  ( any writable tag or register )
MOV Example: Transfer HMI setpoint to PID block
Rung: [HMI_Write_Bit] ----[MOV]----
Source: HMI_Setpoint_Tag (value = 75.0)
Dest: PID_SP_Tag

Result:
When HMI_Write_Bit is ON, PID_SP_Tag = 75.0
HMI_Setpoint_Tag is unchanged = 75.0
On the next scan, the copy repeats while the rung stays true.
Executes
Every scan while rung is true. Use a one-shot (OSR) if you only want the copy to happen once per rising edge.
Data types
INT, DINT, REAL, BOOL. The source and destination must be compatible data types or use a conversion instruction first.
Source options
Any tag, input register, constant value, or the result of a math instruction stored in a temporary tag.
Common use
Transfer a setpoint from HMI to a PID block. Copy an analogue input value into a calculation tag. Load a constant into a register at startup.

FILL Instruction: Write One Value to an Entire Array

The FILL instruction has three parameters: Source, Destination, and Length. It writes the same value into every destination array element up to the number specified by Length.

FILL Instruction Parameters
FILL
  Source: 0               ( value to write into every element )
  Dest:   Alarm_Array[0]  ( starting element of the destination array )
  Length: 50               ( number of elements to fill )
FILL Example: Clear an alarm array on startup
Rung: [First_Scan_Bit] ----[FILL]----
Source: 0
Dest: Alarm_Array[0]
Length: 50

Result:
Alarm_Array[0] = 0
Alarm_Array[1] = 0
...
Alarm_Array[49] = 0
All 50 elements set to 0 in a single scan.
Tip: FILL with a value of 0 is the fastest way to clear an array in ladder logic. One rung replaces 50 or more individual MOV 0 instructions. Use the First Scan bit (S:FS in RSLogix 500, or a one-shot on the first scan in Studio 5000) to run the FILL once at PLC startup.
Advertisement

COP Instruction: Copy an Entire Array Block

The COP instruction has three parameters: Source, Destination, and Length. It copies a block of array elements from source to destination. COP is used for recipe loading, buffering, and snapshotting arrays.

COP Instruction Parameters
COP
  Source: Recipe_A[0]    ( starting element of the source array )
  Dest:   Active_Recipe[0] ( starting element of the destination array )
  Length: 10               ( number of elements to copy )
COP Example: Load Recipe A into the active recipe array
Rung: [Load_Recipe_A_Bit] ----[COP]----
Source: Recipe_A[0] ( 10 elements: temp, pressure, time... )
Dest: Active_Recipe[0]
Length: 10

Result:
Active_Recipe[0] = Recipe_A[0]
Active_Recipe[1] = Recipe_A[1]
...
Active_Recipe[9] = Recipe_A[9]
Source array Recipe_A is unchanged.

MOV vs FILL vs COP: Side by Side

ParameterMOVFILLCOP
What it copiesSingle value to single destinationOne value to every element of an arrayBlock of array elements to another array
SourceSingle tag or constantSingle value or constantArray starting element
DestinationSingle tagArray starting elementArray starting element
Length parameterNot usedRequired (number of elements to fill)Required (number of elements to copy)
Source cleared?NoNot applicableNo
Typical useSetpoint transfer, constant loadingArray initialisation, clearing registersRecipe loading, array snapshot, buffer copy
ExecutesEvery scan rung is trueEvery scan rung is trueEvery scan rung is true

Real Applications of MOV FILL COP in PLC Programs

Recipe management
Store multiple recipes as separate arrays. Use COP to load the selected recipe into the active process array when the operator selects a product.
Startup initialisation
Use FILL to clear all counters, timers accumulated values, and alarm arrays to zero on the first scan after a PLC restart.
Setpoint transfer
Use MOV to transfer a setpoint from an HMI tag into a PID instruction setpoint tag. Use a one-shot to prevent continuous overwriting during normal operation.
Data logging buffer
Use COP to copy a snapshot of live process data into a separate buffer array before transmitting or archiving, so the live data is not disturbed during the transfer.
Default value loading
Use MOV to write default setpoints into control tags when a manual reset pushbutton is pressed, restoring known safe values after an operator adjustment.

Watch: PLC Data Move Instructions Explained

Advertisement

PLC Data Move Instruction Questions Engineers Ask

What does the MOV instruction do in PLC ladder logic?
The MOV instruction copies a single value from a source tag or constant into a destination tag. The source is not cleared. MOV executes every scan while the rung condition is true.
What is the difference between MOV and COP in ladder logic?
MOV copies a single value to a single destination. COP copies a block of array elements from one array to another. COP requires a Length parameter specifying how many elements to copy.
What does the FILL instruction do in PLC programming?
FILL writes the same single value into every element of a destination array over a specified Length. It is used to initialise or clear arrays quickly without using multiple MOV instructions.
Does MOV clear the source value after copying?
No. MOV only reads the source and writes to the destination. The source remains unchanged. To clear the source after copying, add a separate MOV 0 instruction to the source tag.
When should I use a one-shot with a MOV instruction?
Use a one-shot (OSR) when you want the MOV to execute only once per rising edge, not every scan. This prevents the destination from being overwritten continuously while the rung stays true.

Related Articles on This Site

External References

Advertisement

What We Learn Today

  • MOV copies a single value from source to destination every scan the rung is true. FILL writes one value into every element of an array over a specified length. COP copies a block of consecutive array elements from one array to another. All three instructions leave the source unchanged.
  • Use MOV for single setpoint transfers and constant loading. Use FILL to initialise or clear arrays at startup with one rung instead of many MOV instructions. Use COP to load recipes, snapshot live data into a buffer array, or copy process parameter sets between arrays.
  • MOV executes every scan while the rung is true. Add a one-shot (OSR) contact in series when you only want the copy to occur once per trigger. This prevents the destination from being overwritten on every scan while the enabling condition stays active.
I hope you like above blog. There is no cost associated in sharing the article in your social media. Thanks for reading!! Happy Learning!!

Leave a Reply

Your email address will not be published. Required fields are marked *