Posted 15 Feb 2022 HI Everyone, i m quite new at PLC programming. I have to wite a programm for long product rejection. Now i have used a sensor to detect the hight of the product. As soon as the long product is detected it sets a bit and this bit works as input for a counter now for counting i have used another sensor signal which is the chain pulse signal.For blowing the product off i have used a pneumatic solenoid valve. after the long can is detected the counter reads 3 pulses of the chain pulse sensor and as it gets third pulse it generates an output. after the out put is on with that output a off delay timer is on which holds the solenoid valve on for 5 ms and as soon as the timer preset value is reached it resets the sequence. Hope i could explain the purpose and process i m going through. Now the issue is if there are continuous long products on the conveyor after the first product is detected After that till the time the counter is reached and that product is blown off all the other long products get through how can i drop all the consecutive long products. u can find the program in attached file Thank u model.cxp Share this post Link to post Share on other sites
Posted 15 Feb 2022 I didn't enter in the details because I don't understand if using a counter is mandatory or not. If not mandatory, a shift register may be more appropriate for your problem: you could start to elaborate on this. 1 person likes this Share this post Link to post Share on other sites
Posted 17 Feb 2022 Thank u for replying No its not mandatory. My sensor and Blow off stations are 3 chain pulse away from each other. But my doubt is how would it process the consecutive long products Share this post Link to post Share on other sites
Posted 17 Feb 2022 if CNT not mandatory then you could start elaborating a logic with SR moreover you can find in books several examples with SR that you can adapt easily to your problem. On top of that one should use SR instead of CNT because a SR keeps more information than a CNT. In fact, for each increment of a SR there can be a 0 or 1 (item long or short e.g.) and this may allow to reconstruct the time hystory of the process. This feature it is not present in the CNT that is way it is better to use SR. Share this post Link to post Share on other sites
Posted 17 Feb 2022 As suresh_ suggests, a shift register is the perfect method for this application. Below is an example of how to use it. I did not modify your program but I did label the contacts to make it clear. Notice I use the N.O. contact for Height. I typically do that to make the inspection fail safe. You may use inverted logic. 1 person likes this Share this post Link to post Share on other sites
Posted 18 Feb 2022 (edited) Hi, I have replaced the CNT with the SR in my programm but there is an isuue, if there are consecutive long items on the chain it is not dropping all of them it just blows off the first one i think the reason is since my sensor and the blow off station are 3 chain pulse away i have to keep the SR's Data bit energised to keep shifting the data by the clock pulse which is chain pulse signal and sinse the data bit is energised , it is not registering the next long product until the first sensed can is blown off and sequence is reset. Please see the file attached and suggest me a way to drop every long item, i have used a NO type sensor for long item detection and also an NO type sensor for chain pulse (clock Pulse to the SR) thank u model.cxp Edited 18 Feb 2022 by sudhanshushahi16@gmail.com Share this post Link to post Share on other sites
Posted 18 Feb 2022 1) The SFT instruction will store the value of your Long Item Detected. You do not need to latch it. Try using 2.13 (Long Item Detected) in the first leg of the SFT instruction. If the timing becomes an issue then you may need to latch it but only until it is stored in the SFT instruction. 2) The 3rd leg of the SFT instruction will reset all data bits in W41. Try using CF114 (Always OFF) for this. Share this post Link to post Share on other sites
Posted 18 Feb 2022 (edited) 58 minutes ago, IO_Rack said: If the timing becomes an issue then you may need to latch it but only until it is stored in the SFT instruction. If this is the case then latch the Long Item Detected. Then look at this: Use Data Shift in the middle leg of the SFT instruction. This will push sensor data into the shift register and shift the data. Then use the Data Reset to reset the sensor latch (Long Item Detected). Edited 18 Feb 2022 by IO_Rack Share this post Link to post Share on other sites
Posted 20 Feb 2022 Thanks a lot guys removing latch from SR data bit and using CF114 to reset SR solved the issue Thank A lot @IO_Rack and @suresh_ for helping me out with this u guys are really apreciate it. thaks a lot again Share this post Link to post Share on other sites
Posted 22 Feb 2022 You are welcome. How critical is your product rejection? You may want to evaluate the hardware and software to make it fail-safe. For example.... what happens if the sensor fails? What happens if the solenoid fails? Share this post Link to post Share on other sites