Sign in to follow this  
Followers 0
jan.krajniak

Move function in RSLogix 5000

9 posts in this topic

Hello everyone: I am writing a ladder logic program for a PLC based pump controller as part of my "research project" (class) at school. However, I have run into a little trouble with the "move" function. I have been using it to transfer the value from one tag to another (i.e. Tag1=100, Tag2=whatever, would use Move - Source: Tag1, Dest: Tag2), but my logic would be failing. Then, when I used mathematical functions instead (i.e. Tag1=100, Tag2=whatever, would use Multiply - Source A: 1, Source B: Tag1, Dest: Tag2) the logic works flawlessly. Hence, I am thinking that I am using the function wrong, or maybe there is another function meant for this purpose. Can anybody help me?? Thank you very much, I really appreciate all the help you guys give (and have given me in the past already). Jan

Share this post


Link to post
Share on other sites
What is the data type of Tag1, Tag2, etc?

Share this post


Link to post
Share on other sites
Both are defined as REAL. Just a sample "rung". The Entered_Setpoint is a value provided by the HMI. When a certain conditions are fulfilled (and I know they are, because using math functions makes it work), Entered_Setpoint is "moved" to System_Setpoint. Thank you for helping!

Share this post


Link to post
Share on other sites
Should work fine. Can you give your sample numbers that you are entering or preferably post your code?

Share this post


Link to post
Share on other sites
Sometimes novices expect the MOVe command to clear the source after they move its contents to the destination. It does not work that way with AB PLCs. A MOVe command is like a single element COPy instruction. It puts a copy of the contents of the source into the destination, and they need to be of the same data type. It does not alter the source in any way. A COPy will do the same for multiple elements and they don't necessarily have to be the same data type. Maybe this will help? Paul

Share this post


Link to post
Share on other sites
Very good OkiePC I hadn't thought a novice might have been expecting that. One point a copy dosn't work when copying more than one length when working with Ints to Dints and visa versa. The PLC treats the memory as a continuous memory location. To copy multiple Ints to Dints use a FAL instruction. Sorry to be pedantic. Regards

Share this post


Link to post
Share on other sites
Thank you both very much for your help!! I think both of you are correct, ergo it should work. It seems like the problem is not with the move function, but with some of the input hardware. Apparently, when I had "move" in there before, we had the hardware configured a little differently (just the position of a speed probe on an electric motor), and when that was moved around (believe it or not, just the tilt of the motor), it would work fine. Coincidentally, when we tilted the motor we also changed the functions to add/multiply. Once everything worked, we assumed the problem was "move". Now, when we removed the tilt of the motor, it stopped working again :). I will check to see if this is really the cause of the problem tomorrow morning (been on campus for 12 hours now having classes/working, getting kinda hungry :) ). I am thinking it is the speed probe, cause the program is "breaking" at very low RPM only, and when a more aggressive gain is set for the controlling PID (which gets past that reagion fast ..), there seems to be no problem. Thanks a lot so far, I will post an update. Jan

Share this post


Link to post
Share on other sites
This explanation could be misleading.... The source and destination for a MOV instruction do not have to be of the same data type. The MOV instruction will do type cobversion if necessary. caveat: MOVing a DINT to an INT can result in truncation. The COP instruction can copy single or multiple elements. The number of bytes copied is determined by the data type of the destination. The COP instruction does not do type conversion.

Share this post


Link to post
Share on other sites
Gerry, Thank You for the correction. A MOV can work with different data types...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0