100 Space Parking Lot

Vedang Joshi

Member
Join Date
Aug 2012
Location
Toronto
Posts
6
Hi guys I am completely new to plc programming and I have been trying to make a practice program for a lot that holds 100 cars. A counter must increment/decrement depending on if a car enters/exits. It should display the # cars at all times and show full if the limit is reached. So far I know the following:

I:1/0 = Entrance sensor (Count the number of vehicles entering the lot)
I:1/1 = Exit sensor (Count the number of vehicles leaving the lot)

O:2/0 = Indicate lot is full

I have began the code but I have no idea what to do next. Can anyone help?

Thanks
 
Welcome to the forum!
To activate the O:2/0 you could use a compare >= to 100 instruction with the 100 coming from the counter accumulator. It would help us to help you if you would tell us what plc brand, model, and software you will be using. Methods vary depending on which platform you are using. It always helps to post what code you have so far. LogixPro from thelearningpit.com is an excellent learning tool.
 

I:1/0 Counter C5:0
----| |-----------------( Add 1)

I:1/1 Counter C5:0
----| |-----------------( subtract 1)



The counter can be an integer location, or a counter.
It all depends on what type of PLC that you plan to use.

Once you get this figured out, you have to learn about compares.
Don't what to have negative counts or counts greater than 100.
Good luck.
 
Use a up-counter "CTU" and a down-counter "CTD" with the same address e.g C5:0.

C5:0.ACC is the total cars. Pre-Set is lot full, C5:0.DN turns on the Full indication.

Shows us your work so far. Post the program file here. ( Zip it first)

And welcome to the forum.

Edit: gbradley & jrwb4gbm type faster then I do.
 
Last edited:
Sounds like a very good learning exercise, because it provides opportunities to add complexity.

For example, you could make the project a little more "real world" by maintaining separate, cumulative IN and OUT counters which would be copied to long-term storage locations at the end of each day or attendant's shift. This would be an important auditing tool, allowing the money receipts to be compared with the number of cars entering/exiting during a given period. Occupancy at any given moment (the original problem) would be determined by subtracting the OUTs from the INs.
 
Sounds like a very good learning exercise, because it provides opportunities to add complexity.

For example, you could make the project a little more "real world" by maintaining separate, cumulative IN and OUT counters which would be copied to long-term storage locations at the end of each day or attendant's shift. This would be an important auditing tool, allowing the money receipts to be compared with the number of cars entering/exiting during a given period. Occupancy at any given moment (the original problem) would be determined by subtracting the OUTs from the INs.

Add to that, many car parks have multiple entrance and exit lanes, each with their own sensors, and barriers. The car park owners may have a wish to determine lane usage, so accumulate these figures independently, summate the independent totals for the OUTs and INs.

In adding any complexity - be sure to obey any physical laws and practical considerations.

As has already been said, the number of cars in the car park at any one time MUST be positive (0 is considered a positive number in most applications), and must be less than the total number of spaces, although I know of a few car parks that allow more cars IN than spaces at busy times, to avoid queues at the entrance, the excess have to drive around looking for spaces that are always becoming available - a typical example of adding revenue, 'cos once you're in, you're gonna park it !!
 
Here is one example based on the OP's request and Mickey's and gbradley's suggestions. It might need some additions and corrections.
 
I am using rslogix5000 and the file has a .ACD extension that is why I have uploaded a paint document with my current code. I have an idea of how its suppose to work but I do not know how to connect everything together (ex how the Red light indicator should come on when the limit has been reached).

I also included Figure 1 diagram to show that I want to use the basic UpDown Counter but it seems that rslogix5000 does not have that so I had to use two separate counters.

Please advise,

Thanks

Ladder Diagram.jpg
 
Vedang,

On your first rung your entrance input will decrease the count and your exit input will do nothing,
If you name the CTU and CTD counters with the same name then when the input to the counter has a false to true input it will count up in the case of the CTU and count down in the case of the CTD.

Alan

If you want to attach a PLC file to a post you need to ZIP it first before atttaching it.
 
Here is one example based on the OP's request and Mickey's and gbradley's suggestions. It might need some additions and corrections.

I have to disagree with using the first-scan bit to put the counter accumulator back to zero on rung 2 (and why not use the RES instruction instead of a MOV) : if a power-cut occurs, you will have no idea have many cars are in the car-park already, and you'll let another 100 in until it says "Full" again.

I also disagree with the MOV on rung 3 : this is a physical attribute of how many cars are "in" the car-park, whether there is space for them or not. What would happen if the "Lot Full" indicator was faulty, or drivers just chose to ignore it.
 
@daba,
I agree completely with your statements in post #12. As I said in my post with the example, "It might need some additions and corrections".
It was an example only, showing some of the issues that need to be considered, not a complete final working program.
 
It was an example only, showing some of the issues that need to be considered, not a complete final working program.
Gotcha! It was a helpful answer but not the complete solution. ;) What more could a student ask for free?

This looks like the old "100-car Parking Lot" student problem that has been discussed here before.
 
Last edited:

Similar Topics

I am using Schneider elau pack drive servo motor ISH-100. I am facing the problem that On the ISH -100 red light is blinking and pack drive C-600...
Replies
0
Views
33
Hi, I cannot find the DLCA1764.EXE utilty software for data retrieving. Can someone share the link to download this software. Thanks!
Replies
4
Views
95
I have a 170AAO92100 card that I am interested in using as a 10 volt output. Is there setup that I have to do in order to change output or simply...
Replies
0
Views
82
Hi hoping someone can assist me with current issue I am experiencing with an ABB drive. Problem I’m experiencing is a ABB drive supply a large...
Replies
4
Views
194
OK. You guys helped me out a bunch with my first Siemens question. I found a bunch of issues with integrity checking the PLC programs I was...
Replies
7
Views
309
Back
Top Bottom