Structured Text in PLC: Parking Information Systems

Car parking is an application where automation is very important and works the best. Due to the amount of vehicles coming and going, it is necessary that the parking lot has proper control over them. Otherwise, there is no use to manage the volume of such vehicles. For this purpose, let us create a sample program for such vehicle management. In this post, Learn how to automate parking information systems using Structured Text in PLC programming for engineering students.

Parking Information Systems

Let us understand the case scenario first. We have a parking lot where there are three slots for car parking. The lot has a gate which opens automatically based on car sensing at the incoming or the outgoing and closes automatically based on no car sensing at the incoming and outgoing.

When an incoming car is sensed and a slot is empty inside, then the gate opens. Also, when an outgoing car is sensed, then too the gate will open. When both the sensors are not sensed for 10 seconds, the gate closes. When the slot is full, a lamp depicting occupied will turn on and when any slot becomes empty, the lamp will turn off. For sensing three slots, three sensors are used.

Structured Text in PLC

We will write the PLC STL logic now. For this, we will use Studio 5000 software of Rockwell automation and structured text language. We have the following PLC inputs – slot 1 sensor, slot 2 sensor, slot 3 sensor, incoming car sensor, and outgoing sensor. We have the following PLC outputs – gate open and lamp indication.

Let us have a look at the STL logic now. Refer to the below image. First, we will see how to check whether the lot is full or not. As we have three sensors for the corresponding three slots, if all the sensors are receiving signals, that means a car is present in each slot. So, we turn on a bit named slot_full, else the bit will remain off. When the slot is full, we also turn on a lamp parallelly, or else the lamp will remain off.

Structured Text in PLC: Parking Information Systems

Next, we will write the logic for opening the gate. If the incoming sensor is sensed and the slot is not full, then the output of the car gate will open. Also, if the outgoing sensor is sensed, then too the gate will open to let the vehicle go out.

The output is single-acting; if it is on, then the gate will open and lock mechanically, and if it is off, then the gate will close and lock mechanically. If the gate is opening or closing, and an inverse command is received in between, then it will act immediately. If the incoming sensor is sensed and the slot is full, then the driver will get to know this through the lamp we turned on. So, he will wait or leave till any slot becomes empty.

Now, we will write the logic for closing the gate. When a car is incoming, it will obviously pass through the outgoing sensor when the gate opens. When a car is outgoing, it will obviously pass through the incoming sensor when the gate opens. So, we are using a timer of 10 seconds to check whether any sensor is sensed or not. If the timer is done, then the gate command turns off and the gate will close.

In this way, we saw how to write a PLC program for parking information using structured text language.

Read Next:

Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address

Leave a Comment

Share via
Follow us and never miss an update!