Buffers

jthornton

Member
Join Date
Jul 2002
Location
Poplar Bluff, MO
Posts
295
Can anyone explain why on the following code would one want to move from an input to a number? This system has a PLC5 connected to two SLC500's via DH+ I think.
ladder5.jpg
 
What type of card is in slot 7? Looks like an analog card . If thats the case then that's how the input should be addresed.

Not to be smart but look at the very top line in the ladder, not the code itself but the descriptor in green background.

A piece of well written/documented code will tell what its doing and sometimes why.


Drewcrew6
 
Maybe the code dealing with the input channels is used in multiple machines, and so is written using N33:10 - N33:13. Suppose the analog input module is located in a different slot in each different machine. When you commision a new machine, rather than search for every occurrence of I:X.0 - I:X.3, you need only modify this one rung to adapt the program to the configuration of the PLC.
 
The PLC logic could have been written before the inputs were assigned. When inputs were assigned, they could then be copied to the integers without having to change any logic.
Another reason could be for transfering the information to a DCS.
 
I don't know what the programmer is doing (I could guess - he want's all the analog data into consecutive N registers, probably to do For-Next scaling of All analog inputs - but it's just a guess), but he's doing it inefficiently.

A single instruction:

+--------- COP ---+
---| Source: #I:7.0 |
| Dest: #N33:10 |
| Length: 4 |
+-----------------+



Would replace the rung shown.

If you want to find out what's going on, select N33:10, right click, and pick CROSS-REFERENCE N33:10. You'll see what other instructions use that address, if any. If you don't see anything besides this MOV for it, scroll down the cross-reference list to see if N33:[pointer_address] is used in the program.
 
I can think of one reason to do individual moves as opposed to a block copy and that would be to make it easier to 'see' the individual registers and their descriptions at a glance without going to the data table.

I often put 'dummy' rungs in some of my programs to make it easier to see the data. For that same reason, I will sometimes use individual math functions instead of a compute statement, since I can see the individual values and write to the registers while on-line.
 
MOV Statement

This is why I would use a MOV in RSLogix5 or RSLogix500....

The MOV instruction is an output instruction that copies a value
from a source address to a destination address. As long as the rung remains true, the instruction moves the data each scan.

This command makes a copy of the original and places the
duplicate in a new location (Dest). The original value remains intact and unchanged in its Source location.

This output instruction functions much like the COP (File Copy) instruction. MOV uses less memory than COP. COP has a faster execution time. COP can operate on an element or a file; MOV can operate on a word.

© 1997 Rockwell Software Inc.

Once the data from the analog input has been moved into an integer file you can manipulate the data any way your little heart desires.

Thanx Danocane
 
Back to John's original question of "WHY would it be done?" Kim Gold's second answer looks the most logical to me.
Another reason could be for transferring the information to a DCS.
This hypothesis would be confirmed if there are other instances in the same program where other "word" values (example: O:2.0 and B3:4, etc.) are moved into contiguous locations (example: N33:14, N33:15, etc.) This is commonly done to "pack" data from scattered locations in the SLC into one contiguous "all-together-in-a-row" block. This makes it, as Kim mentioned, much easier and quicker for a DCS or an HMI to exchange data with the SLC.

There is another possibility - but admittedly it's a long shot. Suppose that the guy who programmed this SLC grew up programming PLC-5's instead? This "analog I/O buffering" is highly recommended (but not always implemented) in that platform because of the way the analog input and output modules exchange data with the processor. Sometimes programmers keep on using old techniques (even when they're no longer required) just because they've "always done it this way". Key words in case you're interested on follow up research: asynchronous, Block-Transfer-Read, Block-Transfer-Write. If you stay with SLC's, you probably won't ever have to worry about this "problem".

Allen's suggestion of using one COPY command (rather than four MOVE's) is certainly more polished and concise - but personally, I like Greg's "keep it out in the open" policy. The people coming along behind you may not share your "program deciphering" skills. As long as you're not concerned with memory availability and scan time issues, I'd say lay it all out. Extra program instructions are cheap when compared to troubleshooting time. If you start running short on processor resources, then make use of Allen's more elegant solution. (There is programming - and then there is art).
 
The main plc in this plant is a PLC5 that has two SLC500's connected to it via DH+ and a PC running Wonderworks as the SCADA so maybe WilWil and Ron are correct as to the reason...

And the file N30 is labeled BUFFER_IN and N31 is labeled BUFFER_OUT so all together in a block makes sense to me.

Thanks so much for the input.

Inquiring minds want to know....

John
 

Similar Topics

I am programming a pumping facility and am testing all code in the emulator as best I can before going to site. Instead of Aliasing my Inputs and...
Replies
5
Views
1,799
Hi all, Thank you for viewing my post. I'm modifying a system and added logic to it with the RsLogix 5K. I'm doing CIP routines and have my...
Replies
5
Views
2,262
Hello, I have a MP277 panel, where I have got an alarm buffer. It is nice, but does anybody know how I can save the buffer to some kind of file...
Replies
4
Views
3,320
I recently had a problem with a system that is several years old. It has grown a LOT in the last couple of years. I needed to get Data from a...
Replies
3
Views
5,895
I have two SLC505's on my ethernet network. I want to pull information from a string file on one PLC and use the information in the second plc...
Replies
8
Views
4,619
Back
Top Bottom