01-12-2011 12:27 PM
Hi can anybody help me? I am trying to link 3 sets of traffic lights together using labVIEW 2009 but am having difficulty with getting all 3 to sync. Does anybody have an example I could look at? Thanks.
01-13-2011 08:53 AM
I'd be happy to lend you a hand with this but I could use a bit more information. What hardware are you using and have you written some code already?
What do you mean by "having difficulty with getting all 3 to sync"?
01-13-2011 11:09 AM
I wnt 2 get the lights to work with each other using a time structure. They need to work on a core each, plus need a control panel which will link to the traffic lights and be able to be switched on and off when an emergency vehicle is coming. Its an assigment for Real Time Systems.
The system that you will create will represent a major road through the middle of a town which has 3 road junctions each controlled by traffic lights. There is also a small traffic control engineer’s office in the town where there is a display of what all the traffic lights are currently set to and alarms for junction failures, bulb failures and total congestion. It also keeps a running display of the current traffic flow per hour updated every 10 seconds and allows the timings of lights and the offset of the lamps to be monitored and set. It will be possible for the engineer to turn off the lights at a junction or to set any or all the junctions into a set but safe state (e.g. To allow emergency vehicles to pass through). All junctions that have been set manually must return to normal mode in a safe manner. NOTE You must NEVER HAVE both roads A and B on Green at the same time on any junction. The layout of the junctions is attached at the back.
Each road junction has the following functionality.
It is a crossroads of 2 main roads with traffic lights at the 4 corners with the timing set in the Control Engineer’s office. The lamps follow the standard sequence of Red, Red & Amber, Green, Amber and back to Red. Lights on the 2 roads must not be Green together but can all be Red for safety. Each junction can operate in 3 different ways dependent on the time of day.
When a car triggers the first junction in the sequence and it goes to Green then the other 2 junctions should change to Green after set offset times so that the vehicle does not need to slow down or stop when travelling on the main route. The main route is defined as South –North on junction A then B then C.
Each junction works independently starting with a 50:50 timing between the 2 roads. The proportion will change based on the amount of traffic going through the junction in each direction. These changes will be monitored in hourly slots.( e.g. if 100 cars used road A in an hour and 50 cars used road B then the timing of the lights would change so that road A would be on 67% and road B 33%).
Night Time Operation
At a certain time the lamps will lock on to a set timing between the 2 roads based on the last intelligent hour’s calculations. However if a car approaches the lights and they are on Red and there is no car coming through the other road then they will change to Green to let the car through. The sequence will then revert to its previous timing cycles.
All the junctions and the Control Engineers console must keep an event log of actions together with date and time.
Each of the junctions must use a separate core on the CPU and be able to simulate traffic flow in both directions on both roads. The fourth core is assigned to the Engineer’s and should be a separate LabVIEW application. The system should communicate in such a way that using separate PC’s for each junction and a separate computer for the Control room can be done with minimum disruption.(i.e. `do not use globals for communication unless you can find a foolproof way to deal with multi PC synchronization).
NOTE To aid testing you may wish to accelerate time so an hour for example is 3 minutes.
All programs must run on the FCET 4 core PC’s in D10 under LabVIEW 9
I am totally stumped lol all i have is 1 set of lights functioning which i found on here somewhere :-( xx
01-13-2011 11:21 AM
Ok then. First, can you post the other code for me to look at? Also, do you fully understand how that code works because that is a good place to start. Then I can try and help you from there.