PLC Program for Parking Lot Control System.

surilshah

Member
Join Date
Nov 2013
Location
Sydney
Posts
2
Hello,

I am trying to create a program for Omron CJ1M PLC for a Parking Lot Control System. The system design is as follows:

1. Sensor detects a car at the entry,
2. Initiates gate to open,
3. Car passes the gate and another sensor detects this and the gate closes.
4. The car is parked at one of the spots in the car park and sensor detects this and sends a signal to controller suggesting that the spot is occupied.
5. The controller then calculates the remaining spaces and displays the availability on a Display Unit.

This is a common scenario one must have observed at the parking lots in Huge Shopping Malls.

I have to incorporate a Function Block using Structured text in this program.

The problem I am facing is how do I program the inputs from multiple sensors (sensors at the parking spots) as a single input to the function block and use it to in the calculation in the Structured Text and Display the result as the output of the function block.

Please throw some light on this problem.

Thanks.
 
make a subrutine for the gate:
make a subroutine for the exit!!! (almost same as entry but the total counter is sub.
you can add inputs on your function block.
what do you have already like a function diagram, a start etc.
 
A count based on number of entries and exits probably won't be exactly equal to a count based on number of parking space sensors made. You may have to allow for cars transiting between the entry/exit gates and their parking slots.
 
Take a look at the BCNT instruction on page 587 of the W340 manual. It could be used to give you a count of occupied spaces to feed into your function block.
 
A count based on number of entries and exits probably won't be exactly equal to a count based on number of parking space sensors made. You may have to allow for cars transiting between the entry/exit gates and their parking slots.

Yes, thats exactly what I was thinking of. But then how do I program it? I am worried about the inputs from each sensor at the parking slots. Suppose there are 100 parking slots in total, I will have to have 100 inputs from those sensors. With this the program will become very huge and complicated.
 
Please throw some light on this problem.
Search this site for "parking garage". There have been many similar student problems.
http://www.plctalk.net/qanda/showthread.php?t=80043&highlight=parking+garage

The problem I am facing is how do I program the inputs from multiple sensors (sensors at the parking spots)...
But if there is 1 sensor for each spot, then use 1 bit out of seven 16-bit words. You can count the number of 1 bits in these words, and store as the Previous Parked Count. When a new car enters and parks, recount the 1 bits and compare to the Previous Parked Count. If it is 1 more, then the new car has parked. If not, then it is still driving around or has given up and left the lot.
I will have to have 100 inputs from those sensors. With this the program will become very huge and complicated.
5. The controller then calculates the remaining spaces and displays the availability on a Display Unit.
It seems that you are being encouraged to use number arrays, and perhaps pointers and indexed addresses to keep up with the filled spots. If you set up a memory array that has 100 spaces, then you can probably use a single Function Block to check all 100 inputs, one at a time, to find which are filled (= binary "1"), then save the filled bits to the equivalent memory storage bits. Maybe you don't need internal storage bits in this case, but simply to continuously map the Input Sensor bits that are off (=0) to your Display Unit.
 
Last edited:

Similar Topics

This is the reason why I signed up here and decided to get some help before I tackle the traffic light program on Wednesday. It looked good on...
Replies
17
Views
11,702
Hello Everyone, I am working on a program to run on a Direct Logic D0-05 DR-D PLC for a parking garage program. I have a program I wrote...
Replies
73
Views
24,524
Can we use a Simotion D455 ethernet port x127 as a gate, to access S7-1500 plc Tia Portal program ? In the Simatic manager, we used Netpro to do...
Replies
2
Views
87
Posted this to Reddit with little success, so I figured I would share it here as well. Very new to PLCs, but figured I would give it a shot to...
Replies
0
Views
123
I'm a beginner in the automation field and I've set up an automation system connecting several devices (datalogger, radio, etc.) via Modbus RS485...
Replies
5
Views
215
Back
Top Bottom