Word shifting w AB

Control Freak

Member
Join Date
Jul 2004
Posts
44
Hey all,

Stupid question time... I've put a couple hours into this already, and I've decided that I'd run it up the flagpole. I'm sure this is much simpler than I think it is, but you've got to know when to say when.


When using Omron PLCs, there is a handy Word Shift instruction. It's a nice little way to shift a full word of data the same way that you might shift an individual bit with a BSL [AB] or a ROL [Omron]. It makes part tracking/sorting a piece of cake.

I might use, for example,
bit 0 of the word to indicate part presence
bit 1 of the word to verify inspection #1's results
bit 2 of the word to verify inspection #2's results
etc

The ability to shift word data down the machine gives me some functionality at the end of the line. Perhaps I might have the ability to rework a part that failed inpection #1, but definately scrap a part that failed inspection #2.

In the past I've done a cheap and easy fix by running parallel BSL's to accomplish similar results. This has worked fine so far, but what if I wanted to keep more specific data from each inspection other than simply Pass/Fail, and shift the data with the part?

For example: Inspection #1 fails because the analog result of a test is out of limits. What if I wanted to keep the data from the inspection, and shift it along with the part?

I've thought of a bunch of parallel MOV's, but that would be a pretty large rung - especially if I'm shifting multiple words of data for each part. Am I missing the obvious? Maybe a FIFO instruction or something? Maybe some fancy indirect addressing?

Thoughts? Ideas?
 
Complete re-edit (I initially misunderstood what you were saying)

Look at using the CPY instruction. But there is a trick. If you copy forward then you overwrite what you need, but if you copy backwards then you can shift an entire set of data down.

For example:
N10 contians the data you want to shift and you are shifting 10 words of data. You set it up so that N10:9 contains the newest data while N10:0 contians the oldest data. When you shift, N10:1 is copied down to N10:0, N10:2 copies to N10:1,.... N10:9 copies down to N10:8. Now you load your new data at N10:9.

The instruction is
COP #N10:1 #N10:0 10

Also, if you want to avoid shifting data altogether you can set up a circular queue. An example of how to do that is here. It might be modifiable to your needs.
 
Last edited:

Similar Topics

I'm having some trouble reading messages on a Profibus network. The problem is that one message from the device I'm communicating with contains...
Replies
10
Views
3,219
I am looking for an instruction similar to the RS Logix BTD instruction. I need to be able to strip bits in the middle of a 32 bit double word...
Replies
1
Views
1,900
Hi All, How do I set a password to PLC using Proficy machine software 9.5-9.8 or some other way? I as using Emerson CPE305 CPU. Thanks.
Replies
2
Views
351
I have an AB micro820 analog inputs takes word datatype to scale my input to 0-100% , i need to know the word datatype range does anyone knows...
Replies
3
Views
153
I have a modicon quantum plc and and i have a stu file that have the program but when trying to download it to the plc. it gives not built and...
Replies
0
Views
78
Back
Top Bottom