Copy array COPY
Copies Count elements from one array line to another.
How it works
While the rung is true, copies Count elements from the Source array, starting at Source start, into the Destination array, starting at Dest start. Both arrays hold the same type. Every Source element is read before any is written, so copying within one array works even when the ranges overlap. A Count of 0 copies nothing. A negative Count, or a range past the end of either array, is a fault and writes nothing at all.
Operands
| Operand | Data type | Read or write |
|---|---|---|
| Source | Array of BOOL, DINT, REAL | Reads |
| Source start | DINT or a number | Reads |
| Dest | Array of BOOL, DINT, REAL | Writes |
| Dest start | DINT or a number | Reads |
| Count | DINT or a number | Reads |
Common mistakes
- Expecting the part that fits to be copiedIf any of the range is past the end of either array, nothing is copied. Check Start and Count against the array size.