RS Logix Move Command

mrbob24

Member
Join Date
Jul 2012
Location
Illinois
Posts
17
Hi, Can someone explain to me the use and advantage to using the move command. I see that the more experienced programmers will use it a lot.
Thanks
 
Strictly speaking a MOV (Move) instruction doesn't actually move the data, it simply places a copy of the source data into the destination location.

It is a very useful instruction, because it handles data-type conversion automatically - e.g. if you MOV a floating-point value into an integer-type destination, the result is rounded. The rounding method depends which PLC family you are using.

Conversely, you can use COP (Copy) to move data around (again the source is left unchanged), but COP doesn't take heed of any data-type differences, it just performs a byte-for-byte copy from source to destination. This does, of course, cause problems (e.g. data corruption) if the source and destination locations are different data-types.

COP, on a single element, is faster to execute than MOV, simply because there is no data-type checking or conversion involved.

COP can also handle multiple elements of arrays, MOV will only copy a single element. To copy multiple elements in a MOV-like fashion requires the FAL instruction.

An advanced version of COP in Logix5000 systems, is CPS (Copy Synchronous), which doesn't allow the processor to interrupt the COPying instruction until it has completed. COP can be interrupted by System Overhead Time-Slice, which can cause data-set fragmentation.

Programmers use MOV, FAL, COP, and CPS as best fits the application.
 
Last edited:
Welcome to the forum.

A move is the easiest way to move a value from one location to another.

For example, you have an integer table of timer values for a list of products. Operator chooses a product number and you move the timer values into timer presets.

In some PLCs you have to move data around by adding or subtracting 0 to a word and putting the result in a destination. Others you have to load a register to the accumulator then store the accumlator to a new address. The MOV instruction is simpler for the programmer.

You should be careful about the difference between a Move and a copy instruction. It varies by PLC, but move will often do a data type conversion while copy will make an exact bit by bit copy - it can produce unexpected results when changing between data types.
 
Hi, Can someone explain to me the use and advantage to using the move command. I see that the more experienced programmers will use it a lot.
Hi and welcome.

I use the Allen Bradley MOV instruction a lot, but to answer your question, I have to ask you one, Move compared to WHAT?
 
Thanks, In the program there are 29 moves in a row that go to N7:84. The moves are B3's. If you are moving a bit on why would you put them all in the same integer. Also in this Ladder there are two equals that start off the moves. It is B3:12 equals B3:11 and it has 16 zeros under the source.?
 
In the program there are 29 moves in a row that go to N7:84. The moves are B3's. If you are moving [only one bit], why would you put them all in the same integer?
Putting bits into the same integer is okay, not illegal, and may be necessary. It does seem that the 29 MOV instructions could be reduced by using some FLLs or COPs, and maybe a For-Next loop.
 
Originally posted by mrbob24:

If you are moving a bit on why would you put them all in the same integer.

The instruction isn't moving a bit only. It is moving all 16 bits of the word, thus the 16 zeros in the value display. B3:11, for example, is a word level address. B3:11/0 is a bit level address. B3:11/0 is also B3/176. B file types are really just integer files that can be addressed is a specific way.

Generally speaking, a piece of logic similar to what you describe would be a word level selection. The rungs evaluate some condition and place a value in N7:84 based on that. If two or more rungs evaluate as true the last one in the string will determine the value. You might use this to locate the greatest or least value in a list of values and record that value.

Keith

Keith
 
Keith, Not to sound stupid but i don't get it. I am missing something. I know how PLC's work and have done some programming as i am a maintenance/ Facility Manager but i am not a programmer. I would love to get better at it but i am having problems understanding this. You set a bit B3:3/1 by giving it an input or two. The next line takes B3:3/1 and moves it to N7:8. I get that part. What is the purpose. The PLC already knows the bit is set. Is it for a counter operation? is it for an interface? Do you or can you call up the N7:8 later in the program. Is it saver to move the bit into N then to latch and unlatch?
Sorry i just got to figure out what it is this thing is used for.
Thanks, Bob
 
Bob, unfortunately, it's not an easy question to answer WHY somebody did something. Did they have to? Probably not. Without seeing their program, I don't think any of us can really answer your question.

It could be that they're moving a whole integer into an HMI to indicate a system status, but if they're doing that, they're also breaking it down to an individual bit (e.g. N7:8/1)

Just as you can reference individual bits out of an N7 integer, you can also reference a whole word of booleans (e.g. B3:3)

As I have opportunity to teach people how to program, I always say that when your working on somebody else's program, you kind of have to crawl into their brain - and some brains are easier to crawl into than others. There are many, many ways of writing a program to accomplish the same results. Are the "other" ways wrong? No, not usually. Yes, some are better than others - depending on how you wish to define "better".

So, to generically answer your "What is the purpose" question, we really can't give you an answer without seeing the code. Sorry...
 
Ok that is fair. How do I post the code? Do you need the whole program or only the parts in question? Do i do a screen shot or print it out and then scan it back in?

Bob
 
Ok that is fair. How do I post the code? Do you need the whole program or only the parts in question? Do i do a screen shot or print it out and then scan it back in?

Bob

Providing you can, the whole program is best, because you might not post something that it wholly relevant.

Just compress the project into a ZIP folder and post that as an attachment. There is a 976.6Mb size limit for the .ZIP file
 
FLL instruction

Strictly speaking a MOV (Move) instruction doesn't actually move the data, it simply places a copy of the source data into the destination location.

.......................

Programmers use MOV, FAL, COP, and CPS as best fits the application.

Wonderful description, clearing all my confusions.
Can you please say something about the FLL instruction as well. From what I know it also does a bit by bit copy like the COP instruction, am I wrong ?
 
Wonderful description, clearing all my confusions.
Can you please say something about the FLL instruction as well. From what I know it also does a bit by bit copy like the COP instruction, am I wrong ?

And don't forget type conversion. MOV does type conversion between integer and floats, but bit for bit copies between integers and bit files.

FLL is a file instruction, so I will go out on a limb and say that I would expect it to perform a bit for bit copy based on the element size of the destination.
 
This is an obtuse example, but I used a MOV command to jump in a sequencer. I programmed a sequence of 3 load attempts, and used a successful load to call a MOV to jump past the re-trys.
 

Similar Topics

The class I am taking is currently attempting to do a stoplight program using RSLogix 500 Pro, with Allen-Bradley SLC 500 model 1747-L40B. The...
Replies
5
Views
7,964
Hello, Please Help! I have an array of 20 registers that I want to search for a value. There will be over 100 DINTS Values that come in and if the...
Replies
7
Views
1,817
Hi all, I have an issue with 1756-L62S (revision 20.13) safety lock. We can't figure out who put safety lock on our project. Before I try...
Replies
0
Views
1,026
Hi all, I have an issue with 1756-L62S (revision 20.13) safety lock. We can't figure out who put safety lock on our project. Before I try...
Replies
2
Views
2,425
Hi to everybody. I need to remove memories and rungs comment from a SLC500 program because was used as a base program a wrong file project and...
Replies
8
Views
2,395
Back
Top Bottom