Making a PLC program for rejecting bottles using Omron PLC CP2E-N and High speed coun

Join Date
Mar 2020
Location
egypt
Posts
1
Hi, i need to make:

1- A PLC Program on Omron PLC CP2E-N using high speed counter E6C3-AG5B 360P/R 2M(Absolute) ,to
Reject bottles on Conveyor built.

2-The rejected bottles are away from the point of decision (inspection Camera).

3-Take into consideration that there may be two consecutive bottles can be rejected .

4-Also I am asking if this rejection can be done by shift register and a photocell (as a second
Methodology).

Thanks

1-actually i took a course and see how to connect the High speed counter to the PLC but it did not cover the case where two consecutive bottles can be rejected .
 
1- No course should teach you how to write specific program, but how to think, systematize and implement.
2- It is good, as long you can track them.
3- We don't need to take in consideration, you should take it in consideration. You took responsibility of PLC programmer, you will be guilty if something goes wrong ;) It is usual and expected.
4 - Generally speaking, it is usually done with incremental encoder, at least two photocells, camera and shift register.
 
Last edited:
In an application like this, the high speed counter is needed to adjust the trigger point of the reject mechanism as the line speed changes.

The reject mechanism takes a fixed number of milliseconds to actuate. At low line speeds the bottle moves a shorter distance during the time it takes for the mechanism to actuate. At higher line speeds the bottle moves a longer distance.

The shift register is just used to keep track the of accept/reject status of each bottle when the reject point is more than one bottle downstream from the point where the decision to accept/reject is made.
 
Use of a high speed counter is not really what you need, you need an input interrupt, for example everytime a pulse from the encoder is true the program interrupts, & runs a routine that moves the data in a shift register, you can use an encoder & perhaps after so many pulses shift the data in the shift register.
It seems you only need a reject signal so a bit shift register would do i.e. if a bottle is to be rejected then a true bit is inserted into the bit shift register, when this bit reaches the reject position the reject mechanism rejects the bottle, now there are a number of things to consider, the speed of the transport conveyor, the encoder resolution, size of the bottles (not too important) etc.
You could use a simple proximity & toothed wheel on the conveyor drive, this would have to be sized so you get x number of pulses per bottle or at the very least one pulse per bottle. without knowing the actual application then it is difficult to give you any real code as I have not got Omron IDE at the moment. but the following may help you.
Using the interrupt say on input 0 (cannot remember how the inputs are addressed) then first create an array of bits for example (cannot remember omron addresses if they still use them) My_Array [0..1000] of bit
So every time an interrupt occurs on input 0 the following code is executed.
A Reject_Sig out (My_array[0]) // if we get a reject signal then set the first bit in the array to a one.
A Int_Pulse Shift left 1 My_Array // Shift the array of bits left one place
So you now have a representation of the bottles & if it is a reject or not that represents a set length of the conveyor.
Example:
<this is the start of where the reject is detected This is reject>
00000001000000100000000000010010011000100000100001
Lets assume the number of pulses generated from the reject detection point is 50 then you need a bit shift of at least say 5 plus (good idea to make it bigger)
So you get a reject signal at the camera station you load a "1" into bit 0 of the shift register, every pulse the data is shifted left one place while the conveyor is running at the reject station then if a one is detected (let's assume bit 50) then it rejects the bottle.
It is almost as simple as that, however, it will depend on many factors i.e. distance between camera & reject station, speed of conveyor how many pulses (perhaps 2-3 pulses per bottle width) etc. Have done this many times using this method but mainly using words/double words for bar codes.
with upto 17 divert stations.
 
Do a search for the terms "reject" and "conveyor" on this forum, there will be many hits and some code examples.

I assume the original question was because a naive program would start a counter when a bottle to be rejected was detected at the point of decision (camera), and then count from that position (or time) to know when to activate the reject station, but with the possibility of multiple rejects between the point of decision and the reject station, one counter cannot handle that scenario.

So a bit shift register, as @parky describes, is what you want.
 

Similar Topics

What do you use for making a list of all the plc's in your plants. I am using excel. I have made a list of the equipment name, processor name, if...
Replies
9
Views
2,301
Hello, I want to make a histogram of an input (y-axis) is plotted against time (x-axis). Using OB35 (100 ms), I want use DB1 (boolean, length...
Replies
12
Views
2,593
hi guys, i have just signed up to this site after reading through it with much interest over the last few weeks. i am as the thread title...
Replies
30
Views
7,103
I work for a major manufacturer of industrial camera equipment. One of our initiatives this year is to make our devices PLC programmer friendly...
Replies
14
Views
4,204
Back
Top Bottom