CPS (Synchronous Copy File) Ladder Logic Instruction

Definition

The Synchronous Copy File instruction is a ladder logic rung output instruction that copies data from the Source to the Destination x amount of elements long. The Source data remains the same. The CPS instruction cannot be interrupted by other tasks running in the processor. Use this instruction when you want to insure the data being copied is not changed by higher priority tasks running in the processor.

Insure the Length does not travel outside the array boundaries. Use the SIZE instruction to determine how many elements are in an array.

The Copy instruction does a byte-to-byte copy of data. It is possible to write data into other members of tags if the Length is too large. This can happen when copying data to User Defined Tags. No major fault is flagged and therefore unexpected data can show up in members of the UDT.

If the Source or Destination is a Produced Tag, Consumed Tag, I/O data, or data that can be overwritten by a different task the Copy instruction can be interrupted and the Source and/or Destination data can be changed. To insure the data is not changed during a copy use the CPS instruction.

List of possible arguments

SOURCE A and DESTINATION can be combinations of the following data types.

SINT              
INT
DINT
REAL
STRUCTURE

LENGTH is the amount of elements to copy from the Source to the Destination, it can be a constant or tag.

Note: Arithmetic status flags are not affected. No major faults are flagged.