Bbarnett
Member
Why not use CPS for everything?
When would you actually want to allow the data to change during the copy operation?
When would you actually want to allow the data to change during the copy operation?
The question you have to ask yourself is:When compared to the COP instruction which only performs step 4, you can see there is a tremendous amount of overhead for the CPS instruction. Because of this it should only be used when dealing with I/O and Produce/Consume data.
The COP an COPS are very powerful functions and can do many things. Check the help menu or techconnect documents.
COP and COPS copy the data from one element to another element of the same type.
They can also convert data from one type to another.
2 Int data type to real data type, 2 int’s to a dint data type. There are other conversions as well.
When a cop instruction is executed on an array of data it will make the copy 1 element at a time until complete. For an array or 100 elements it will copy each element one at a time until it function is complete (100 separate copy commands)
If you are copying data from an input, while the copy is doing its thing the input data may actually change before it completes the copy. To prevent the data from changing use the COPS function.
The COPS locks the data in copy elements (inputs) form changing while the copy completes.
The COPS should only be used to copy data from an input. As it takes more processing time to execute and gains you nothing when copying tag to tag. In a tag to tag copy the ladder execution is held up until the copy is completes.
The COP can only copy a tag to a tag it cannot copy a fixed value (12345) to a tag for that use a MOV
The move I believe is a holdover from the old days when they didn’t have the copy function.
It will move the data value from a single element to another single element of the same type ( Bit for Bit move). Where it is helpful is when you want to move a fixed constant value to a tag. Ect. 0 or to move a preset to counter or timer back to default settings. This data cannot be changed unless you are on line programming .
I rarely use a move value as I like to use move a tag so I can change the value without editing the program. I use it to clear a tag or set the value to 0
The COP instruction executes faster than the MOV instruction (assuming a one-tag-to-one-tag copy) because, as daba says, it literally copies a bit pattern from one tag to another. Nothing else.GaryS said:you cane believe that if you want but I had a very extensive conversation with AB techconnect on this subject.
And they recommend we use the cop function over the move function it's a better function to use even with a length of 1 still a better call.
move copies the bit pattern and by default the value. The copy function is much more powerful then the move.
you cane believe that if you want but I had a very extensive conversation with AB techconnect on this subject.
And they recommend we use the cop function over the move function it's a better function to use even with a length of 1 still a better call.
move copies the bit pattern and by default the value. The copy function is much more powerful then the move.
you cane believe that if you want but I had a very extensive conversation with AB techconnect on this subject.
And they recommend we use the cop function over the move function it's a better function to use even with a length of 1 still a better call.
move copies the bit pattern and by default the value. The copy function is much more powerful then the move.
you cane believe that if you want but I had a very extensive conversation with AB techconnect on this subject.
And they recommend we use the cop function over the move function it's a better function to use even with a length of 1 still a better call.
move copies the bit pattern and by default the value. The copy function is much more powerful then the move.