Use PLC to decide order of inputs

roggowb

Member
Join Date
Feb 2006
Location
Gladwin, MI
Posts
5
I have been asked to build a device to indicate the order of 4 inputs. These will be a photocell/light arrangement to decide in which order 4 model cars crossed the 'finish line'.

I plan for any of the inputs to start a timer and when the input is triggered to put the time in a memory location. Then to have the PLC decide which order by comparing the times. The first one is easy because the time will be '0'. My problem is the logic to compare the other three inputs and indicate the order in which the inputs are triggered.

In the BASIC language this would be done by sorting an array and assigning '2', '3' & '4' to the corresponding entries. However, most PC's today do not have a parallel port which could be used for input and output.

Does anyone have any ideas how to decide the order in which the inputs were triggered and be able to supply some of the necessary logic?

Thanks

Bill R.
[email protected]
 
This sounds like the pinewood derby time controller.

There is a setup that the events have that do just what you are asking and interface with a PC. I don't have the info on it, but I can get it if you are interested.
 
Yes, I'm interested. This is indeed a timer for an AWANA (a church related young peoples group) event - similar to Boy Scouts. Any help would be appreciated.
 
You could have the variables first, second, third and fourth. One counter that increments on the inputs. If the counter is one put the number of the input in variable first, and so on. Couldn't that work?

Almost the same as with an array.
 
Start a free-running timer when you release the cars at the top of the track. For each input, use a one-shot to copy the timer's ACC value into a data register for that lane. That will give you a time for each lane.

Back when I was involved with Cub Scouts, that's how we settled disputes over which car won. We only used a two-lane track, but in the final heats, we had each pair of cars race twice, once in each lane. If the same car won both times, there was no problem. If swapping lanes resulted in different winners, we used the total accumulated time for both races to determine the winner. It helped to quell the "your kid's car always got the fast lane" arguments.

If you're not already doing it, I suggest you include a "Dad's race" to your event. We got concerned that the cars our Scouts were racing had really been built by their fathers and that the kids didn't really have much input. The Pinewood derby was turning into an ego trip for the parents. We started letting the fathers build their own cars and compete against each other and found that more of the Scouts had more to do with building their own cars. Just make sure that the main event is still the race with the kid's cars, and not the dad's race. One of our gimmicks was that the winner of the dad's race had to stay late and clean up the hall at the end of the race.
 
roggowb -

An array is just a contiguous chunk of memory - and every PLC has a contiguous chunk of memory - it just might not look like an array that you are familiar with.

What PLC are you using?
 
Presumably, if all you want is the order of finishing without any timing or speed info you could construct it all out of raw logic terms. So something like -


....1...... 2.......3.......4......1Won
---] [-----]/[-----]/[-----]/[-----( )

....1.......2.......3.......4......2Won
---]/[-----] [-----]/[-----]/[-----( )

....1.......2.......3.......4......3Won
---]/[-----]/[-----] [-----]/[-----( )

....1.......2.......3.......4......4Won
---]/[-----]/[-----]/[-----] [-----( )



You could then extend this to decide who was second, third, and last.

Of course you'll still get arguments over whether the scan speed of the PLC is fast enough for these cars!!

Regards

Ken
 
Last edited:

Similar Topics

How do we decide in programming a PLC that we use comparator, timer, registers, flags, function blocks etc for any task or for any network ...
Replies
11
Views
7,476
Hi All, Someone at work has put a PLC system on my desk, that's just been taken off an idle production line. He said "It's an S7 PLC. We don't...
Replies
3
Views
65
I have a project to automate four generator sets. The system will monitor and store the load demand of the factory. Once there's Power outage, the...
Replies
0
Views
37
i have two plc 1. s7-1212dc/dc/dc ip; 192.168.0.1 2. s7-1500 1513-1pn ip; 192.168.3.2 i need to get data from plc1 to plc2. any idea how to do...
Replies
5
Views
73
Back
Top Bottom