Sign in to follow this  
Followers 0
Kah Chun

Bit Shift

9 posts in this topic

Hi, I've got a question here in regards to the bit shift instruction. There is an existing logic in the PLC to detect red mark on boxes. When the sensor is triggered, it will latch on a bit (B3:1/8) and the BSL will shift the bit left when the instruction goes from false to true. A pneumatic actuator will then reject the detected box. The logic has been written quite a while ago and is always doing the its job admirably. -> XIC B3:1/5 BSL #B3:15 R6:15 B3:1/8 5 There is now a request to reject 3 boxes instead of just 1. One before and one after the detected box. Is there an easy way to go around this with minimum changes being made to the existing logic and BSL? ********************Problem partially solved*************************** Edited by Kah Chun

Share this post


Link to post
Share on other sites
Unless I am mistaken you're missing a piece of the logic. B3:1/5 is the what I would call the package or window detected trigger and causes the data stack to shift left. B3:15 is your stack of data and your red mark sensor must set a bit somewhere in this stack. B3:1/8 is the off load of the BSL and represents the box at the pneumatic actuator. You simply need to change the OTL instruction which manipulates 1 bit in B3:15 to manipulate three bits, preferably the present one , one before and one after. Post more if this doesn't help.

Share this post


Link to post
Share on other sites
That is what I thought at first also but the problem is the bit tracking for the one after the defective part doesn't exist yet. If part is bad, latch "Bit Address" bit for BSL and fire BSL. So the current one is at bit 0 of the integer. Writing to the one before the defective part is easy. Just latch the integer in the BSL's bit 1. But the one after the defective part is actually in limbo at this point. Going to need to shift all of the logic down by one that runs off of the BSL to make room for the part after the defective part if that makes any sense Does that make any sense?

Share this post


Link to post
Share on other sites
It makes perfect sense because I'm struggling with this problem too. I manipulate the latch bit to start the rung with the BSL register on it but I can only reject the 'detected' box and the one immediately after it. I still couldn't think of a good way to reject 3 boxes; the 'detected' box, the one before and the other one after using BSL. The tricky part is that I need a trigger from the sensor to start the BSL ie I can't 'pre-bit shift' a bit without a signal?

Share this post


Link to post
Share on other sites
What I am thinking will be the easiest "in the short run" is to create a storage bit for that last reject. The deal with it on the next part. Or wait, do we really need to log it as three parts ot reject? We only have one bad part. Why not deal with this in the remove part code? In other words right now you are looking at a bit in the BSL register to be 1 to remove the part. Look for that bit to be 1 or the one before it or after it to be 1. It would require no modifications to the BSL code and probably just a few more XICs Follow what I'm thinking?

Share this post


Link to post
Share on other sites
Can you post the logic that sets the bit in the stack? What TW means is this I think... BST XIC B3:15/7 NXB XIC B3:15/8 NXB XIC B3:15/9 BND OTE B3:0/5 If b3:0/5 is the reject solenoid and B3:15/8 is the "red marked box" or "unload bit" then just add the above two XIC's (B3:15/7 and B3:15/9) The bit that is set to 1 ie red marked box has to move through all three positions Edited by Gary Burton

Share this post


Link to post
Share on other sites
This whole discussion brings out an important point for code designers. When building a tracking plan always allow room for growth if you want your code to be considered robust. Using a 16 bit shift register when you need 12 spaces is a good example and would have saved the poster a bunch of headache had his original designers done this. TW is right although not pretty you'll have to lengthen your BSL by 1 and then you can load before and after. Otherwise you'll need to design some "memory" logic to latch the bit after. As I think about it the easiest to understand and fit in here might be to add a second BSL of length 2. So that when you load the original BSL you load this one as well. On the next box the new BSL unloads and sets a bit in the original BSL. Hope I make this clear to understand.

Share this post


Link to post
Share on other sites
I like this fix. It is the first thing that came to mind when reading the OP. Just add two branches to the code that examines the shifted bits and triggers the rejector. For example if you are currently looking at bit 13 and if it's set to a one, you eject the product, Then change that logic to look at bits 12, 13, and 14 (3 XIC branches in parallel) and if any of them are set, trigger the ejector. Doesn't get much simpler than that...

Share this post


Link to post
Share on other sites
Thank you everyone for your input and suggestion.

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