COP commands in Rslogix 500

SiriusMark

Member
Join Date
Mar 2014
Location
Colorado
Posts
80
Please clear something up for me. When using the COP command (among others), the length indicates the amount of elements I want to copy, starting at the source. So if I were to use #N7:5 as the source, N7:15 as the destination, and 3 as the length, the command would actually copy N7:5, N7:6, and N7:7 into N7:15, N7:16, and N7:17 respectively. Right?
 
right ...

but don't take my word for it ... just type in dummy values: 111, 222, 333 into the three "source" locations - then fire up the COPy and see what happens ...

going just a little bit further:

the destination in your example would be #N7:15 (nitpicking: you left off the # sign) ... the RSLogix500 software will automatically fill in the # sign even if you don't ... the # sign indicates that the copy operation is using INDEXED addressing - based on the value stored at S:24 to provide an "offset" ... but do NOT worry about all of that "under the hood" stuff for just a simple COPY operation like you've asked about ... just plug it in - and test it to make sure that it works like you want it to ...

going quite a bit further:

as long as you're COPying from INTEGER locations to INTEGER locations - then things are pretty simple ... BUT ... if you try to COPy from an INTEGER into a FLOATING POINT location, then things will really get crazy ... the reason is that the COPy instruction copies BIT PATTERNS ... specifically, it does NOT copy VALUES ... so ... if (at some point in the future) you need to copy a range of ONE-TYPE of locations into a range of ANOTHER-TYPE of locations - then be prepared to dig deeper ...
 
Last edited:
The only other point I'd make is that the length is in terms of destination elements, not source elements.

Again, this doesn't come into play if you're copying between like data types, but if you're copying from a 16 bit data type (like your N7 words) to a 32 bit data type (L data type), then your length is in terms of 32 bit words. So in that case, if your length was 3, it would copy 6 N7 words and store them in 3 L words.
 
Thank you both. I don't have a testbed PLC set up at this moment, but I can get one installed tomorrow. That should make a huge difference in giving me the ability to test these theories while I work on them. Sometimes the wording in the help files can be confusing, at least to me. I need it broken down Barney style.
 

Similar Topics

And I thought I understood all this :rolleyes: Anyone care to explain in plainer English than the manual, what is the effective difference...
Replies
18
Views
8,559
I am trying to copy an array of real numbers into a UDT with a real data type element. I have attached a snip below showing my COP instruction...
Replies
4
Views
203
Hello all. I have a Danfoss VLT feeding an INT into my CpLX program. I need to concatenate the MSB and LSB for position. I used a COP, making sure...
Replies
10
Views
642
Hello, I have been looking for a reference for the order that a UDT is copied in the COP instruction. More specifically - I have a set of code...
Replies
5
Views
548
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,260
Back
Top Bottom