RSLogix File Command Question

hanziou

Member
Join Date
May 2005
Posts
111
So if I see the command:

______________
--------- | COP |----
| |
| Source #N7:0 |
| Dest #F8:20 |
| Length 20 |
--------------



That means that:
the data in N7:0 will be loaded and converted to real and stored in F8:20,
the data in N7:1 will be loaded and converted to real and stored in F8:21,
the data in N7:2 will be loaded and converted to real and stored in F8:22,
.
.
.
the data in N7:19 will be loaded and converted to real and stored in F8:39.

Right?

(The # indicates the starting address for the operation and length is the number of elements. Correct? )

Do the SLCs automatically convert between number formats when using different types in MOV and COP commands?
 
Last edited:
The AB copy command (COP) is a direct byte-for-byte transfer. It WILL NOT perform type conversion.

So in the original example:

N7:0 and N7:1 will be copied into F8:20
N7:2 and N7:3 will be copied into F8:21
N7:4 and N7:5 will be copied into F8:22
.
.
.
N7:38 and N7:38 will be copied into F8:39

Two things to keep in mind. The first is that this is a direct byte for byte copy. The numbers in N7:0 and N7:1, for example, won't look anything what will end up in F8:20. The second thing is that the COP instruction length is in units of the detination data type. So the '20' in this case is 20 floating point values, which is the same quantity of bytes as 40 integers.

This type of thing is often done to get around data transfer limitations on some devices. For example, if your data transport mechanism only supports transferring integers but you need to transfer a float, you can copy a float into two successive integers, transfer them, then copy the integers back to a float to get the value back.

A MOV instruction is different. That instruction WILl do do data type conversions for you if it can.

Keith
 
As Kamenges said, it's an exact copy, no conversion.

Sorry for any confusion, I answered pre edit.
 
Hans,

Since you are copying from a 16 bit word to a float without conversion, it may be helpful for you to view this tehcnote to understand how floating point numbers are stored.

http://domino.automation.rockwell.com/applications/kb/RAKB.nsf/0/85C2838CBFC456D285256AFB00695031?OpenDocument

I linked to a really useful tool to see how floating point numbers are stored here in this thread: http://www.plctalk.net/qanda/showthread.php?t=20575
http://domino.automation.rockwell.c...85C2838CBFC456D285256AFB00695031?OpenDocument
 
To amplify on Kamenges reply the type of the destination defines the number of items copied from the source. If the target was a timer then three words are copied for each item. So a copy from N7 to T4 of 20 items would actually copy 30 N registers. Or at least ry to. But as noted befor, it's a straight copy with no conversions.
 
Last edited:
keith,

in ur reply u said that

N7:0 and N7:1 will be copied into F8:20
N7:2 and N7:3 will be copied into F8:21
N7:4 and N7:5 will be copied into F8:22
.
.
.
N7:38 and N7:38 will be copied into F8:39

N7:38 and N7:38 will be copied into F8:39....so the same value is repeated???

please clarify

Thanks
 
MiamiEngineer said:
keith,

in ur reply u said that



N7:38 and N7:38 will be copied into F8:39....so the same value is repeated???

please clarify

Thanks
I expect that is a typo.

It should say:
N7:38 and N7:39 will be copied into F8:39
 

Similar Topics

I am trying to import addresses and symbols from a PanelBuilder32 application into the RSLogix 5 Address/Symbol database - however each time I...
Replies
5
Views
534
I stumbled onto this behavior the other day, then went looking for old forum posts with the assumption that "there is nothing new under the...
Replies
0
Views
778
Hello All, I am working on converting a program written in RSLogix 500 to Connected Components Workbench. The MicroLogix to Micro800 converter...
Replies
1
Views
1,197
Hello All, I created the shortcut while setting up comms in FT View to a Logix 500 processor, then a offline tag file to the processor .RSS file...
Replies
1
Views
1,719
How can I open a file that says "The requested resource is not recognized by the Security Authority. See your Security Administrator."
Replies
1
Views
2,239
Back
Top Bottom