Publication 1766-RM001A-EN-P - October 2008
268
File Instructions
CPW - Copy Word
Instruction Type: output
The CPW instruction copies words of data, in ascending order, from one
location (Source) to another (Destination). Although similar to the File
Copy (COP) instruction, the CPW instruction allows different source and
destination parameters. Examples include:
•
integer to long word
•
long word to floating point
•
long word to integer
•
integer to PTOX function file
Observe the following restrictions when using the CPW instruction:
•
The length of the data transferred cannot exceed 128 words.
•
Function files can be used for Source or Destination, but not both.
•
When referencing either a PLS file or a function file, addressing must
be specified to the sub-element level.
•
You can reference a sub-element of bits in a function file containing
a combination of read-only and read/write bits.
•
You cannot directly reference the high word of a long word as an
operand in the CPW instruction.
•
A Major fault (003F) is generated if the execution of the instruction
exceeds the data table space.
•
A Major fault (0044) is generated if a write attempt fails to the RTC
function file. This only occurs when attempting to write invalid data
to the RTC function file. Examples of invalid data are: setting the
Day of Week to zero or setting the Date to February 30th.
CPW
Copy Word
Source
#HSC:0.2
Dest
#N7:0
Length
1
CPW
Execution Time for the CPW Instruction
Controller
When Rung Is:
True
False
MicroLogix 1400
2.5630 µs
0.2034 µs
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive