Finding MSB of LSR instruction

lou_dc

Member
Join Date
May 2006
Location
Rhode Island
Posts
8
Hello All. I have a question for the group. I am working on a vision system where parts are fed onto a turntable and pass under a camera where it is inspected and the camera outputs a pass/fall to my PLC which is a Micrologix 1000 32 I/O.. I want to use a LSR (Left Shift Right) instruction to keep track of the part and its "pass/fail" status. There is a eject station 90 degrees from the camera where I have a gate which senses the part going through and as they exit I blow off good parts... Problem is that in between the camera and the blow off there can be a varying amount of parts depending on the part spacing and turntable speed.. What is the best way to find out the MSB (most significant bit) of the LSR so I can keep track of how many parts are between my camera and blow off and remove only the MSB...I was thinking of using a bunch of compare functions ie IF B3:0/5 =1, If B3:0/4=1 etc... Is there a better way that anyone has uses. Thanks......
Lou...
 
Not sure I understand LSR. are you going to use the camera to count how many parts are passing under it or are You going to use the PLC? I would keep track of the pass fail in the PLC.
Now for the fun stuff. You have to know how many parts are between the camera and the eject station. Do you change jobs in the camera if so can you use that job data to determine the number of parts between the 2?
 
I don't believe there is an LSR Instruction. Do you mean BSR - Bit Shift Right, or BSL - Bit Shift Left?

Stu.....
 
I want to use the BSL instruction to keep track of the of parts and identify them with a pass/fail status result from the camera... I can't assume a fixed number of parts between the camera and the eject station. Their might be for example 6 at one time and 4 the next depending on how well the parts feed onto the table. This is why I want to examine the most significant bit of the BSL.....and act and reset that one....
 
My crystal ball says you HAVE to know how many pieces are between the inspection and reject points.
 
I think I need to know the MSB so that I can determine how far the BSL instruction has moved (ie how many parts are between the camera and the eject station) and unlatch that bit as it is ejected...??
 
OK either you are not explaining it very well or we are all missing something.
Knowing the most significant bit will do nothing for you unless you know how many part are between the 2 points.
This just doesn't sound right to me so play along and see it it makes sense to you.
you: don't know how many parts are between the 2 points right?
Me: you Have to track the number or parts somehow.
You: I will use the MSB to track them.
My thoughts: how are you going to unload that stack once you load it? If you have 10 parts between the 2 points you will need to look at bit 9 , if you have 20 parts you will need to look at the second word 3rd bit.
Second setup. You are running a fresh batch of parts assuming that the machine is empty. Wouldn't the first bad part be in position 1 of the reject tracking? If you looked at the MSB of that work you would see that bit 0 is set and nothing else is.
Does that make sense?
 
Last edited:
OK either you are not explaining it very well or we are all missing something.
Knowing the most significant bit will do nothing for you unless you know how many part are between the 2 points.
This just doesn't sound right to me so play along and see it it makes sense to you.
you: don't know how many parts are between the 2 points right?
Me: you Have to track the number or parts somehow.
You: I will use the MSB to track them.
My thoughts: how are you going to unload that stack once you load it? If you have 10 parts between the 2 points you will need to look at bit 9 , if you have 20 parts you will need to look at the second word 3rd bit.
Second setup. You are running a fresh batch of parts assuming that the machine is empty. Wouldn't the first bad part be in position 1 of the reject tracking? If you looked at the MSB of that work you would see that bit 0 is set and nothing else is.
Does that make sense?
OK I am probably not explaining it right. I have a trigger sensor at the camera station. I have a eject sensor at ejection. I use two BSL; one to track number the parts passing the trigger and another which holds the pass/fail status lets say BSL 1 and BSL 2. The trigger sensor loads the stack. If I have 7 parts between trigger and eject my BSL 1 would look like 01111111 with BSL 2 maybe 01010111. I eject part 7 and unload the bit 7 on both BSL. If my BSL 1 is 00111111 then I unload bit 6... If I run a fresh batch then I must clear everything out and make sure there are no parts between camera and eject sensors.. Make sense?
 
That us what I figured you would do. My question is how Do you know which to use 6 or 7?
what if you plan on using the 7th position and you have 00111111 (Good parts) and 00100011(Bad parts)
How does the PLC determine which to use? The good part is in the 6 position and the bad part is in the 6 position also. MSB would look at that and see it needs to eject the part right?
 
I have seen a FIFO used in this instance before, one drawback is if a part is removed from the process between the camera and reject station you will be out of sequence.
 
I have seen a FIFO used in this instance before, one drawback is if a part is removed from the process between the camera and reject station you will be out of sequence.
I guess I could place a guard between station to prevent someone from doing that. However, have you seen a better alternative method used in this instance?
 
That us what I figured you would do. My question is how Do you know which to use 6 or 7?
what if you plan on using the 7th position and you have 00111111 (Good parts) and 00100011(Bad parts)
How does the PLC determine which to use? The good part is in the 6 position and the bad part is in the 6 position also. MSB would look at that and see it needs to eject the part right?
The first BSL isn't really good parts it just acts more of a counter setting a bit everytime a part passes the trigger... The second BSL has the good/bad status... So if BSL 1 is 01111111 and BSL 2 is 01011111 then there is a part in position 7 and it is good (ie 1) so I eject it in good bin. Register shifts when a new part enters at the camera section. Now BSL 1 is 01111111 but BSL 2 is 00111111 so that one is bad. I unload bits as they pass the reject station. Timing would be tricky as I need to make sure I don't unload and shift at the same time...Your thoughts?
 
I have seen a FIFO used in this instance before, one drawback is if a part is removed from the process between the camera and reject station you will be out of sequence.
If the parts are added at a certain rate and a part just happens to be missing then stuff a 0 into the FIFO. The number of entries in a FIFO should be relatively constant. The problem with a FIFO is that the size much be changed when the production changes so that the number of parts between the camera and reject station changes. I prefer circular queues for this reason.

I would use an encoder to keep track of the rate of turn. I would use a circular queue and store the encoder count in the queue for each piece.
 

Similar Topics

Hey all, pretty new to PLC and got a question regarding finding the MSB or the last non-zero bit in a SINT array in studio5000... I am reading...
Replies
2
Views
830
Hi all, I'm in the process of upgrading a PanelView1200 HMI program to be developed in FactroyTalk View Studio. The filetype for PanelView 1200...
Replies
7
Views
277
Having an issue connecting to my Micro820 PLC. I don't have an IP Explorer and I know its MAC Address is 5C:88:16:D8:E6:65. I'm connected to the...
Replies
5
Views
901
I have reached a dead end trying to find an EDS file. Manufacturer says to contact third party tech support. Clueless. RSLINX can see it, just...
Replies
9
Views
1,790
Hello, I have an array of 300 of UDT. In each UDT is an array of 3 DINT and another array of 3 REAL. I have 10 controllers that pull data from...
Replies
7
Views
1,160
Back
Top Bottom