COP — Copy File

Description
Section titled “Description”COP (Copy File) copies Length elements from one array to another every scan its rung is true. It is a MOV for whole arrays: a recipe into the working set, a snapshot of readings into a log buffer, a taught sequencer table into storage. It is an output instruction with no state and no status bits. Do not use COP to convert types; both arrays must be the same kind, numeric to numeric or STRING to STRING, and the copy is element for element. For one value use MOV; to write one value into every element use FLL.
Operands
Section titled “Operands”| Operand | Type | Format | Valid Range | Required | Description |
|---|---|---|---|---|---|
| Source | Array tag, or an element of one | Tag, Tag[n] |
Numeric or STRING array | Yes | Where copying starts. Naming an element starts the copy at that offset. |
| Dest | Array tag, or an element of one | Tag, Tag[n] |
Same kind as Source | Yes | Where copying lands. An element sets the start offset. |
| Length | Whole number | 4 |
1 up to what both arrays have room for from their offsets | Yes | Elements copied. |
A copy that would run off either array, or between a numeric array and a STRING array, is refused at validation. Numeric arrays of different types copy as numbers: INT to DINT is exact, REAL to INT truncates each element.
Scan Behavior
Section titled “Scan Behavior”Prescan
Section titled “Prescan”Nothing. Dest keeps its power-up values.
Rung-condition-in is false
Section titled “Rung-condition-in is false”The instruction does nothing. Dest holds.
Rung-condition-in is true
Section titled “Rung-condition-in is true”Elements are copied in order from Source to Dest, every scan the rung is true. The copy completes within the scan; nothing else runs in between.
Postscan
Section titled “Postscan”Nothing.
Example
Section titled “Example”Scenario: Recipe A’s four parameters are copied into the working array the machine reads, when the operator selects recipe A.
Tags:
Load_A— Select recipe A, BOOLRecipe_A— Stored recipe, INT[4], loaded 10, 20, 30, 40Active— Working parameters, INT[4]
Rung 1:
—] [Load_A———[COP Recipe_A Active 4]———Scan 1 — Load_A = 0. The block lists every element of each array under its operand: Recipe_A reads 10, 20, 30, 40 and Active reads 0, 0, 0, 0. The rung is false.

Scan 2 — Load_A = 1. Active reads 10, 20, 30, 40.

A long array’s list is trimmed in the middle to fit the block; the Tag Browser shows every element.
See Also
Section titled “See Also”- CPS — Synchronous Copy File (identical on this platform)
- FLL — Fill File (one value into every element)
- MOV — Move (one element)
- SQL — Sequencer Load (a taught table worth copying)
- Move/Logical Instructions — Category index
Offsets. COP Log[4] Log[0] 4 moves the second half of an eight-element log down over the first half. Overlapping copies proceed element by element in ascending order, so shifting down is safe and shifting up needs care.
Every scan. A COP on a rung held true copies on every scan, which is harmless for a constant recipe but will overwrite any edit to Dest. Gate it with an ONS to copy once.
The block never colours. Watch the rung wire and the Dest value list.
Applies to LadderIDE >=1.2.2 · Last reviewed 2026-09-11 · Screenshots verified 2026-09-11