Sign in to follow this  
Followers 0
automator

word shift register (not bit)-- how to?

15 posts in this topic

Hi, First time post here, seems like the right place to post this problem: I have a synchronous indexing conveyor that I would like to track the color of components. I need an instruction like BSL, not at the bit level but at the word level, each word would store an integer which would represent color. I tried using the FIFO instructions but the pointer moves, not the data. I am using RsLogix 500 and an ML 1500. Any clever ideas/examples would be appreciated. Thanks! Edited by automator

Share this post


Link to post
Share on other sites
I think indirect addressing may be the answer. You would still need an index though. If N7:0 contains your color data, then use MOV N7:0 N9:[N7:100], where N7:100 is your index.

Share this post


Link to post
Share on other sites
Try this schema adjust as needed suit you 'B3:1/0 is Flag for Part arrival 'B3:0/1 is for Red Part 'B3:0/2 is for Yellow Part 'B3:0/3 os for Green Part SOR XIC B3:1/0 XIC B3:0/1 MOV 1 N7:251 EOR SOR XIC B3:1/0 XIC B3:0/2 MOV 2 N7:251 EOR SOR XIC B3:1/0 XIC B3:0/3 MOV 3 N7:251 EOR 'B3:1/2 is Flag for Parts are Indexing SOR XIC B3:1/2 COP N7:1 N7:0 250 EOR 'B3:1/3 is Flag for Part at Exit Removal Point 'N7:122 will change based on your conveyor size and resolution of encoder N17:0 if the Color Communication Register to your HMI SOR XIC B3:1/3 MOV N7:122 N17:0 EOR

Share this post


Link to post
Share on other sites
Thanks for the response. I am having trouble understanding this: When you say "MOV N12:1 N12:0 9" I interpret this as: Move the value of N12:1 into N12:0 but what does the "9" designate? Thanks again!

Share this post


Link to post
Share on other sites
Be careful which direction you are copying. If you COPy Source N7:1 Dest N7:0 Length 10, it will work as expected. If you COPy Source N7:0 Dest N7:1 Length 10, all ten words will be filled with the contents of N7:0! If you really want the data to move in the incresing index direction, use dummy storage locations and two COPies: COPy Source N7:0 Dest N17:0 Length 10 'N17:0 thru N17:9 is my temporary storage for the copy COPy Source N17:0 Dest N7:1 Length 10 That will work like a FIFO without the overhead. BTW, the FIFO will move the data, once the POSition value is equal to hte LENgth. When you start out with an empty FIFO, it has to "fill up" first before the data starts shifting through it. The COPy method is usually simpler and easier to follow though... Good Luck!

Share this post


Link to post
Share on other sites
What is being said is to watch how the scan works or you will copy over the previous register before moving it to the next register.

Share this post


Link to post
Share on other sites
Thinking outside the box: If you have only a few colors, another approach would be to create a series of bit shift reigsters, one for each possible color ) and synchronize the operation of the shift registers.

Share this post


Link to post
Share on other sites
Hi, I have not worked on Rslogix 500 but i think it will support the structured text language and arrray of word. The code shown below is made in Rslogix 5000. For count:= 99 to 0 do COP(EDtS_BID[count],EDtS_BID[count+1],1); end_for; here, Count : integer EDtS_BID : WordArray[100] I hope this will solve ur purpose.......... Regards, ybc

Share this post


Link to post
Share on other sites
Rslogix 500 does not support structured text, only ladder logic.

Share this post


Link to post
Share on other sites
As usual. there is not enough info provided to get proper advise. How long is the fifo or queue? How often must the data be shifted? ??? The pointer moves? Is there an array of pointers too? Usually one just increments the index register instead of shifting all the data. What is wrong with incrementing the index register? The best solution can only be determined after knowing the length of the queue or FIFO and how often it must be shifted. Using the the COP function to copy 1000 words every 100 millisecond could put a serious drain on the processing power. If the number of data items is small I may use a COP instruction but I would always copy down and not up to avoid having to COP twice. ( WHY CAN'T ROCKWELL FIX THIS? ) I usually use array indexing so the data is stationary. Usually I am interpolating between points.

Share this post


Link to post
Share on other sites
Yes, you are right. I am looking to shift 122 words every 3 seconds. I just want to shift these words like a shift register shifts bits. I could not get the COP command to do this, do you have an example? Thanks, Scott

Share this post


Link to post
Share on other sites
It seems like the OP is releated to tracking parts through a index system. So that when a RED part gets to the RED position it will be dealt with there. Since there are more then two types of parts, a bit shift wouldn't work. Usually, in a case like this, the number of 'slots' is small. Around 20 slots would be alot. So the question is, "How do you shift the values from one 'slot' to the next?"

Share this post


Link to post
Share on other sites
It will work. You will need to post your code that doesn't work before anyone can be of much help.

Share this post


Link to post
Share on other sites
COPy in a SLC is limited to 128 words. If you're copying 122 integers, it should work. If they're floats, you may need to do 64 or less at a time... If you are copying up, use a dummy file for interim storage, or change it around to copy down, or use a FFU, FFL pair, and preload the position so that it stays done. I can probably find examples of each of these methods if you need them...here is an example of copying up using a dummy file for interim storage. This exmple shows 15 floats and 15 integers being "fifo'd" via COPy in a SLC 5/05. Note that this is from a conditional subroutine and only executes when I call the routine. That is why there are no conditions on these rungs. Edited by OkiePC

Share this post


Link to post
Share on other sites
No problem..... You can easily implement this logic in ladder using compare and jump instructions..... I hope u got it... Regards, yogesh

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