S7-1200 Inspect and Reject...

Eric Nelson

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Randolph, NJ
Posts
4,346
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?... :unsure:

šŸ»

-Eric
 
No idea if this will work or help, i'm just a bit basher so they say. I'm in the middle of having a couple after work... Hence no comments on the code.

Untitled.jpg
 
Thanks for the replies, guys. Although your code wasn't suitable for my application, it did help me better understand how to set up a shift register in the S7-1200. My software came with SP2 on the disk, so I have the latest version. Thanks for the link to the Fieldwrite and Fieldread info.

I played around a bit today, and I think I found a method that will work for me. I created 2 queues. One for the camera trigger, and one for the reject. The camera queue can keep track of up to 3 products, and the reject queue can keep track of up to 9. That's more than enough for this application. I did it 'longhand', just using a bunch of MOVEs to manipulate the data. If nothing else, it's given me a good introduction to this PLC and software. The software is still a bit buggy in my opinion. When you switch back and forth between tabs, it doesn't seem to remember where it was. Then, when you scroll, it jumps to random rungs.

It took me a while to figure out how to upload from the PLC. There's a 'download' in the menu, but no 'upload'. You have to choose 'compare online/offline' and wait for the 'Venn diagram' icon to appear. Then you can select 'upload' and click the sync button.

In any case, thanks for the help!... (y)

šŸ»

-Eric
 
Eric does the upload work if you have no program in the TIA software


I wasnt aware you could upload !!! Or you couldnt when it was released !!

And there is Step 7 11 out now apparently, im gonna ring up the siemens distributor and see if thats the basic one as well
 
How many objects will be on the conveyor between the first sensor and the reject (tracking zone) at the same time?

How smoothly does these objects run (any drag, roll etc)?

Can these objects be removed, added to, close up, jam, etc in the tracking zone?

Any conveyor transfer points, bends,etc (anything that can cause speed change and tracking error)?

Using a FIFO for this type of thing is OK, PROVIDING, you have adequate cover within the code to detect unknown objects and missing objects, blindly using a FIFO where the first object seen at the sensor is assumed to be the first object seen at the reject can be a disaster.

You ned the ability to not only have a FIFO, but to have an expected time 'window' at the other end of the tracking zone.
 
Eric does the upload work if you have no program in the TIA software
It sure does. Just create a new project, add a new device, choose 'Unspecified CPU 1200', and let STEP 7 locate the PLC on your network. These steps are detailed pretty well from 1:25 to 2:30 in this YouTube video.

http://www.youtube.com/watch?v=-Au6m45GIvA

I put together a quick PDF (attached) showing the remaining steps to upload from the PLC.

šŸ»

-Eric
 
How many objects will be on the conveyor between the first sensor and the reject (tracking zone) at the same time?

How smoothly does these objects run (any drag, roll etc)?

Can these objects be removed, added to, close up, jam, etc in the tracking zone?

Any conveyor transfer points, bends,etc (anything that can cause speed change and tracking error)?

Using a FIFO for this type of thing is OK, PROVIDING, you have adequate cover within the code to detect unknown objects and missing objects, blindly using a FIFO where the first object seen at the sensor is assumed to be the first object seen at the reject can be a disaster.

You ned the ability to not only have a FIFO, but to have an expected time 'window' at the other end of the tracking zone.
These are all very good points, Peter. I've had my share of pitfalls over the years, so I realize that what 'might' happen, always will... :rolleyes:

In this application, the product is 'clamped' to the conveyor by an upper
belt, so there shouldn't be much slippage. The trigger for the camera doesn't need to be 'exact', because the camera software will automatically center the image (within reason, of course). At the reject position, the product is no longer clamped by the upper belt, but still have some leeway. It should work fine if fired within Ā±2" of the intended position.

There's always the chance of products being added/removed (mostly removed). There should only be about 5 products max. in this inspection area at a time. Products pass in random groups, so I will have the ability to reset the queue if, say, products remain in the queue for too long.

Thanks for your input!... (y)

šŸ»

-Eric
 

Similar Topics

Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
111
commentaire communiquƩ siemens s7-1200 avec vfd delta ? (cablage et sur tia portal )
Replies
0
Views
80
Hi, I have a 1214 on ip 192.168.0.100. This is connected to other modules through a switch on same network. I need to connect this to a company...
Replies
1
Views
140
Hi. Iā€™m trying to upload program from existing PLC S7-1200. Create new project in TIA v15.1 then upload. After upload successfully, go online but...
Replies
5
Views
195
Hi all, I am trying to do Modbus communications via the CB1241 RS485 Communication Board on a Siemens S71200 PLC. I am using a 1215C CPU. After...
Replies
6
Views
226
Back
Top Bottom