Register  |  Login
 
PLC Training Forum
Forum
 
  Forum  PLC Programming  Allen Bradley  MOV Instruction
Previous Previous
 
Next Next
New Post 8/30/2010 1:16 AM
  flatline01
2 posts
Welcome Me!


MOV Instruction 
Modified By flatline01  on 8/29/2010 11:19:28 PM)

I am having a problem fully understanding the MOV instruction..I wrote a program once with a start and stop(the stop being the DN bit of the timer) circuit on a 15 min timer turning on one output....I did it on one rung..Another guy did it similar but used a MOV instruction....I was wanting to know how did he do it...That will help me understand the MOV instruction better.....(RSLogix500).....Thanks

 
New Post 8/30/2010 3:02 PM
  Admin
170 posts
Journeyman


Re: MOV Instruction 

Without having more information on what was trying to be acomplished, it will be hard to answer this question.  Generally I would not think of a mov instruction as something that would be used for turning outputs on and off.  I guess it could be used that way... but why?  Maybe it will help to talk about the MOV instruction.  Probably the best way to get info about it is to add one into your program, put your cursor on it and press F1 for help.  That will bring up the instruction help for the MOV instruction.  It is a pretty simple instruction.  It moves a register value from one location to another.  So you could move the value in N7:0 to N7:1.  If you put some logic in front of it, you can control when it moves that information.  If you mov N7:0 to O:1 then you would be moving the value from the N7:0 register into an output word and could control outputs that way.  Depending on which bits were set in the 16 bit N7 word, the corresponding outputs would come on.  This is not an acceptable way to control your outputs in most cases. 

 
New Post 8/31/2010 2:54 AM
  flatline01
2 posts
Welcome Me!


Re: MOV Instruction 
Modified By flatline01  on 8/31/2010 1:00:45 AM)

Thanks for the reply.................... The program is for a water timer that shuts water on and off...You push input button i:0/1and it starts the 15 minute timer that is hard latched to output O:0/1..When the DN bit sets from the timer it drops out the latch to the input....Now can someone explain to me how would you use a MOV instruction in this very simple program and it still work....I have seen it done before...I just want to understand how it was done...Thanks

 
New Post 8/31/2010 11:36 AM
  Admin
170 posts
Journeyman


Re: MOV Instruction 

With something like this, it would be easier to explain what was being done if I had the program to look at.  I can only guess how it was done.  I pretty much explained how it could be done in my previous post, but let me expand on that.  Integers in the SLC are 16 bit numbers (It would probably be worthwhile to review our numbering system video).  So you can view that integer in a location such as N7:0 in a decimal format as say a number 2.  Or you can view it in a binary format.  That number 2 would show up as:  0000000000000010

You can play with that in the data table by changing the view format in the lower right side of the window.  For integers it defaults to decimal but you can change the view to binary.  Now an output word is also 16 bits.  Normally you address each bit with an output instruction, but it is possible to move a whole word into the output word.  When you view your outputs in the data table it defaults to a binary view.  You can change the view if you want to decimal if you want to get a better feel of how data is stored in the PLC.  O:0 is a 16 bit word just like N7:0 is a 16 bit word.  Generally with an output word, you are more interested in the individual bits; however you can operate on O:0 as a word if you want to.  That is how someone would use the MOV statement to activate outputs.  If you were to use the MOV to move a 2 into O:0 then bit O:0/1 would be set to on just as in the example for N7:0 above. To turn the output back off a 0 could be moved into the output word O:0.  To affect multiple outputs you would just need to move in different numbers.  To understand this better go into your data table and look at the outputs.  change the view to decimal and put a 3 into the word.  Change the view back to binary and you will find that you have two of the outputs set.  Toggle a couple of the output bits and change your mode back to decimal and see how it affects the value.  Once you play with it and better understand how this works, you will understand how a person can use the MOV statement to affect their outputs. 

Once again, this is not a good way to write a program.  Sequencers operate like this and I am sure that there are some machines out there that use this method of operating outputs; however it can make the logic hard to follow and goes against what most people expect to find in a program; therefore, can be confusing.  Keep in mind that with PLC's we are programming for a community that comes after us to troubleshoot just as much as we are programming for a specific function. 

Russell

 
Previous Previous
 
Next Next
  Forum  PLC Programming  Allen Bradley  MOV Instruction
  
 

 

  
Like this Site?

Check out our PLC Training Facebook site and "like" us!

Click Here!

  
Squidoo

Checkout our new Squidoo lens!  We have posted an interview with Russell White on PLC training.

To see it Click Here!

Let't wake up Squidoo and let them know we are here!

  
Terms Of Use  |  Privacy Statement
Home  |  Subscriptions  |  Training Videos  |  PLC Training  |  Articles  |  PLC Training Forum  |  Contact  |  About Us
Copyright © 2008 - 2011 by Automation Technologies, Inc. - All Rights Reserved