Help - Search - Members - Calendar
Full Version: Move function in RSLogix 5000
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
jan.krajniak
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
TWControls
What is the data type of Tag1, Tag2, etc?
jan.krajniak
QUOTE(TWControls @ Feb 13 2007, 06:49 PM) [snapback]49703[/snapback]

What is the data type of Tag1, Tag2, etc?


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!
TWControls
Should work fine. Can you give your sample numbers that you are entering or preferably post your code?
OkiePC
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

Leadcommander
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
jan.krajniak
QUOTE(TWControls @ Feb 13 2007, 07:08 PM) [snapback]49705[/snapback]

Should work fine. Can you give your sample numbers that you are entering or preferably post your code?


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
Gerry
QUOTE(OkiePC @ Feb 14 2007, 01:46 PM) [snapback]49706[/snapback]
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.

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.

OkiePC
Gerry, Thank You for the correction. A MOV can work with different data types...

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.