×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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.  

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

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.

 

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

(OP)
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   

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

(OP)
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 :( .

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

Well, what I gave you was a FIFO. :)

But not one in Step 5...

Try www.plcs.net, there might be someone there who could help out.

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

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 www.plcs.net is probably where you will get a more complete answer.

Francis
www.controldraw.co.uk
www.s88control.blogspot.com

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

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.

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

(OP)

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources