MOV vs COP instructions

MOV copies just one word of data and converts between data types. eg, a DINT 100 moved to a REAL is converted to 100.0

COP copies multiple words of data and performs and exact bitwise copy of the data. Since there is no data type conversion a DINT 100 COPied to a REAL becomes 1.4012985e-43 (Which can be very useful)
 
In Allen Bradley a MOV interprets the source as a numeric value then sets that numeric value into the destination. If it is a float to an integer it will truncate the value.

A COP copies the bit pattern of the source into the storage space of the target without any attempt to interpret it as a value. So COPying between different types can be risky if you don't know what you are doing.
 

Similar Topics

I'm having to make an AOI to use with a generic ethernet device because the manufacturer does not provide an AOP. I just want to do a sanity check...
Replies
13
Views
1,258
I have found several places in an old program where COP of length 1 is used on strings, but other places where MOV is used. Is there an different...
Replies
12
Views
4,007
Why not use CPS for everything? When would you actually want to allow the data to change during the copy operation?
Replies
16
Views
36,677
I know this has been brought up before and I have read through many posts and tried many different things before asking... I am using a ML1400 Ser...
Replies
13
Views
5,125
Would someone be so kind as to explain the difference between the cop, mov and cop instructions and where each one may be used? The instruction...
Replies
4
Views
5,927
Back
Top Bottom