Eric Nelson
Lifetime Supporting Member + Moderator
I have what I thought was a simple project. I have products traveling down a tabletop conveyor belt. There is a sensor, a camera, and a reject cylinder. I also have an encoder on the conveyor to keep track of distance. Basic layout is like this, with product traveling left to right.
_SENSOR______CAMERA______________________REJECT
The sensor will detect the leading edge of each product. After the product travels a set distance, the camera is triggered and gives a pass/fail result (ON = Pass, OFF = Fail). The product then travels a set distance to the reject cylinder, which knocks a failed product off the conveyor.
In this application, product is delivered randomly, and there can be 1 or more product between each 'station', so data has to be buffered to allow a varying number of product. In my examples below, the "x" indicates a product on the conveyor.
_SENSOR___x___CAMERA________x______________REJECT
_SENSOR___x___CAMERA___x____x____x_________REJECT
_SENSOR__x__x_CAMERA________x________x_____REJECT
The distance between the sensor, camera, and reject are fixed distances. There will be no more than 2 products between the sensor and camera, but there may be 5 or 6 between the camera and reject.
Normally, I would just use FIFOs to track the product, but in this case, I'm using a Siemens S7-1200. How do I create a FIFO? The last time I used Siemens PLCs was back in the 80s (S5 stuff), and I only had to make modifications to existing programs. I'm having a hard time wrapping my head around this PLC. FBs, DBs, etc. are all greek to me. Once I figured out the STEP 7 software, I actually like it. Now, if I could just figure out how to program the PLC...
I successfully got the high-speed counter programmed, and am accurately reading the distance traveled each scan, including when the encoder wraps around.
I know there are plenty of great Siemens programmers here. I'm hoping someone can give me some pointers, or better yet, an example, to get me started. I'm also open to any other ideas on how to approach this application. There's more than one way to skin a cat. Speaking of cats, what ever happened to Pierre?...
-Eric
_SENSOR______CAMERA______________________REJECT
The sensor will detect the leading edge of each product. After the product travels a set distance, the camera is triggered and gives a pass/fail result (ON = Pass, OFF = Fail). The product then travels a set distance to the reject cylinder, which knocks a failed product off the conveyor.
In this application, product is delivered randomly, and there can be 1 or more product between each 'station', so data has to be buffered to allow a varying number of product. In my examples below, the "x" indicates a product on the conveyor.
_SENSOR___x___CAMERA________x______________REJECT
_SENSOR___x___CAMERA___x____x____x_________REJECT
_SENSOR__x__x_CAMERA________x________x_____REJECT
The distance between the sensor, camera, and reject are fixed distances. There will be no more than 2 products between the sensor and camera, but there may be 5 or 6 between the camera and reject.
Normally, I would just use FIFOs to track the product, but in this case, I'm using a Siemens S7-1200. How do I create a FIFO? The last time I used Siemens PLCs was back in the 80s (S5 stuff), and I only had to make modifications to existing programs. I'm having a hard time wrapping my head around this PLC. FBs, DBs, etc. are all greek to me. Once I figured out the STEP 7 software, I actually like it. Now, if I could just figure out how to program the PLC...
I successfully got the high-speed counter programmed, and am accurately reading the distance traveled each scan, including when the encoder wraps around.
I know there are plenty of great Siemens programmers here. I'm hoping someone can give me some pointers, or better yet, an example, to get me started. I'm also open to any other ideas on how to approach this application. There's more than one way to skin a cat. Speaking of cats, what ever happened to Pierre?...
-Eric