Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

[Topic] A little help in programing or same ideas whould be useful 1

Status
Not open for further replies.

costyn

Electrical
Jun 10, 2010
5
Hy , so here is my problem.
I what to make a program for a S5 100U PLC, the application consist in rejecting, lets say a blue cube, from a conveyor belt.
I was thinking as follow : the sensor sees the blue cube, a input is made in PLC, which activate a timer (i use a timer because the speed of the conveyor belt is constant and the distance between the conveyor belt and the sensor is 'x' (dose not mater)), and after same time which is equal to the distance travel the blue cube is rejected.
My problem is: if more blue cubes passes the sensor before the firs one is rejected, i think the program will not keep count of first ones, except the last one.

Has anyone any idea to how i should solve this problem.

My experience whit Step 5 is a entry-level .

Thanks in advance for any idea u give me.
 
Replies continue below

Recommended for you

I don't have any experience with a S5, so how about some puesdo-code?

Pick an area of registers that are available to you, for our example we'll pick ten of them. And for our example we'll say that they are registers 1 - 10.

This arbitrary limit of ten registers assumes that you would never be able to stuff ten cubes (of any color) between the photoeye and the kicker. If that isn't the case, you would have to increase this number from ten to something bigger.

'Assuming that you use ten registers:

If cube = blue, Reg10 = 1 'That loads the blue cube into the bottom of the array. Any non-zero number will do.

If cube <> blue, Reg10 = 2 'That loads the non-blue cube into the bottom of the array. You can't use a "0" or a "1", so we will use a "2".

'BTW,("<>" is shorthand for saying "not equal". But you probably knew that. :) )


'This next bit of code will have to be done for each register from Reg10 to Reg 1.

If Reg10 <> 0 and Reg9 = 0, then copy Reg10 into Reg9, and 0 out Reg10

If Reg9 <> 0 and Reg8 = 0 then copy Reg9 into Reg8, and zero out Reg9

If Reg8 <> 0 and Reg7 = 0 .... And so on until you get to Reg1.

'Notice that by doing your "bubble up" from the highest register to the lowest, your program will move your newest entry up the stack in one scan.

'Now add some code to have your kicker look at the value in Reg1, if it is a "1" then kick the blue one out of there, if it is a "2", then let it pass.

'Once you decide to kick or not to kick, zero out Reg1 to make room in your stack (array) to bubble up for the next cube.

 
I would like to thank u for the replay, u have a good idea but i can't implanted it, because i have to use Step 5 programing.

I would luck into it, maybe i cant find something similar in S5.

Thanks one again
 
So , after hours of searching, i have found a way to solve my problem , that is to use a FIFO buffer (first in first out)

Has anyone same suggestion, where i could find documentation to working whit FIFO. I tried looking but whit no luck :( .
 
I don't thinks there is anything about Step 5 that stops you from constructing your own FIFO.
Use a data block for your 'registers' and you can do almost anything using Statement List in Function blocks, including indexed addressing so you can point to a element (register) in the data block.
But as JohnWaa says is probably where you will get a more complete answer.

Francis
 
Don't see why you make this more complicated that it is.Have you seen how a selector system on a conveyor works? Usually that is a flapper that routes items one way or the other.
So what you want to do is set the flapper in one direction and hold it there until you need to set it the other way.
No need for all the FIFO jargon.
 

Hi

So i have partially solve my problem, the solution i have cam up whit are :

1. The first one was to move the pusher beside the sensor, so i had to use only a timer ( a easy solution :D )

2. For the next one, i kept the distance 'x' between the sensor and the pusher, and the speed of the conveyor line constant ( v = ct ), I use counter's, comparators, and timer's, below is an example of the program, i use step 7 because it's easy to use especially the simulator.

3. The 3 one is the hardest for me, because i want to kept count of the line speed, so i have anther input that keep count of the conveyor. After hours of thinking, i come up whit a solution, see attachment line speed, (as previous i use step7 ,after i check if everything is OK ,i will rewrite it for step5).


P.S. and " darai " i will look into your idea
 
 http://files.engineering.com/getfile.aspx?folder=d1c5bd77-03e6-488b-8be3-37192266cb01&file=time_=_constant.pdf
Status
Not open for further replies.

Part and Inventory Search

Sponsor