Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: PLC Programming for Train Detection and Gate Operation
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > PLC Programming for Train Detection and Gate Operation

PLC Programming for Train Detection and Gate Operation

Learn the PLC programming for train detection and gate operation with warning alarms to open or close the railway gate.

Last updated: October 21, 2024 9:15 pm
Editorial Staff
PLC Tutorials
No Comments
Share
7 Min Read
SHARE

This article discusses an example of a PLC program to automatically control the railway crossing system with train detection and gate operation. This system is used to control the process of Opening and Closing railway crossing gates when a train passes. This system uses sensors to detect the arrival and departure of trains. When the system detects a train is coming, the system will automatically Close the crossing gates and Activate a warning Alarm. The system will re-Open the crossing gates after the train has passed the crossing, and the Alarm will be turned Off.

Contents
Train Detection and Gate OperationProgram AddressingProgramming

Train Detection and Gate Operation

The PLC program uses 2 buttons and 4 sensors, the START_SYSTEM (I0.0) button is used to turn ON the system, and the STOP_SYSTEM (I0.1) button is used to turn OFF the system.

The SENS_TRAIN_COME (I0.2) sensor is used to detect an oncoming train, the SENS_TRAIN_LEFT (I0.3) sensor is used to detect a train that has passed a railway crossing, SENS_GATE_DOWN (I0.5) is used to limit the Gate position when Closing, and SENS_GATE_UP (I0.4) is used to limit the Gate position when Opening.

When a Train Comes

The SENS_TRAIN_COME (I0.2) sensor will be Active when it detects an oncoming train. The crossing gate will move CLOSED and the Output OUT_GATE_DOWN (Q0.1) will be ON. Alarm OUT_ALARM (Q0.2) becomes ON to provide a warning.

The crossing gate will Stop Closing when the SENS_GATE_DOWN (I0.5) sensor is Active, so the OUT_GATE_DOWN (Q0.1) Output will become OFF.

When a train has passed

The SENS_TRAIN_LEFT (I0.3) sensor will be Active when it detects that a train has passed a train crossing. 4 seconds later the crossing gate will OPEN. Output OUT_GATE_UP (Q0.0) becomes ON and Alarm OUT_ALARM (Q0.2) becomes OFF.

The OUT_GATE_UP (Q0.0) output will be OFF when the SENS_GATE_UP (I0.4) sensor is Active so that the crossing gate Stops Opening.

PLC Based Automatic Railway Gate Controller
Railway Gate Crossing Control Using PLC Automation

Program Addressing

CommentInput (I)Output (Q)Memory BitsTimer
START_SYSTEMI0.0   
STOP_SYSTEMI0.1   
SENS_TRAIN_COMEI0.2   
SENS_GATE_DOWNI0.5   
SENS_TRAIN_LEFTI0.3   
SENS_GATE_UPI0.4   
OUT_GATE_DOWN Q0.1  
OUT_GATE_UP Q0.0  
OUT_ALARM Q0.2  
SYSTEM_ON  M0 
IR_GATE_DOWN  M2 
IR_GATE_UP  M1 
IR_ALARM  M3 
IR_TIMER  M4 
TIMER_GATE   TM0

Programming

RUNG 0 (SYSTEM ON)

In this Rung, when the START_SYSTEM (I0.0) button is Pressed, the memory bit SYSTEM_ON (M0) will be in the HIGH state. The memory bit SYSTEM_ON (M0) remains in the HIGH state even though the START_SYSTEM (I0.0) button has been Released, because it uses the SET Coil Instruction.

PLC Programming for Train Detection and Gate Operation

RUNG 1 (SYSTEM OFF)

In this Rung, if the STOP_SYSTEM (I0.1) button is Pressed, the memory bit SYSTEM_ON (M0) will become LOW state. Because it uses the RESET Coil Instruction.

RUNG 2 (GATE DOWN ON)

In this Rung, when the NO contact of memory bit SYSTEM_ON (M0) and the SENS_TRAIN_COME (I0.2) sensor in the HIGH state, then the memory bit IR_GATE_DOWN (M2) will be in the HIGH state.

Because it uses the SET Coil Instruction, the memory bit IR_GATE_DOWN (M2) will remain in the HIGH state even though the SENS_TRAIN_COME (I0.2) sensor in the LOW state.

RUNG 3 (GATE DOWN OFF)

In this Rung, when the NO contact of memory bit SYSTEM_ON (M0) and the SENS_GATE_DOWN (I0.5) sensor in the HIGH state, the memory bit IR_GATE_DOWN (M2) will be in the LOW state. Because it uses the RESET Coil Instruction.

How to implement PLC programming for railway gate control

RUNG 4 (GATE UP ON)

In this Rung, when the NO contact of memory bit SYSTEM_ON (M0) and the SENS_TRAIN_LEFT (I0.3) sensor in the HIGH state, then the memory bit IR_GATE_UP (M1) will become in the HIGH state and the TIMER_GATE (TM0) timer Starts counting up to 4 second.

Because it uses the SET Coil Instruction, the memory bit IR_GATE_UP (M1) will remain in the HIGH state even though the SENS_TRAIN_LEFT (I0.3) sensor in the LOW state.

After TIMER_GATE (TM0) has finished counting, the output memory bit IR_TIMER (M4) will be in the HIGH state.

RUNG 5 (GATE UP OFF)

In this Rung, if the NO contact of memory bit SYSTEM_ON (M0) and the SENS_GATE_UP (I0.4) sensor in the HIGH state, then the memory bit IR_GATE_UP (M1) will be in the LOW state. Because it uses the RESET Coil Instruction.

RUNG 6 (ALARM ON)

In this Rung, the memory bit IR_ALARM (M3) will be in the HIGH state when the NO contacts of memory bit SYSTEM_ON (M0) and the SENS_TRAIN_COME (I0.2) sensor are in the HIGH state.

Because it uses a SET Coil, the memory bit IR_ALARM (M3) remains in the HIGH state even though the SENS_TRAIN_COME (I0.2) sensor in the LOW state.

RUNG 7 (ALARM OFF)

When the NO contact of memory bit SYSTEM_ON (M0) and the SENS_TRAIN_LEFT (I0.3) sensor in the HIGH state, the memory bit IR_ALARM (M3) will be in the LOW state. Because it uses the RESET Coil Instruction.

Railway Train Control Systems

RUNG 8 (OUT GATE UP)

In this Rung, when the NO contacts of memory bit IR_GATE_UP (M1) and IR_TIMER (M4) are in the HIGH state, the Output OUT_GATE_UP (Q0.0) will be ON.

RUNG 9 (OUT GATE DOWN)

In this Rung, when the NO contact of memory bit IR_GATE_DOWN (M2) in the HIGH state, the Output OUT_GATE_DOWN (Q0.1) will be ON.

RUNG 10 (ALARM OUTPUT)

In this Rung, when the NO contact of memory bit IR_ALARM (M3) in the HIGH state, the Output OUT_ALARM (Q0.2) will be ON.

Read Next:

  • PLC Product Painting with Weighing System
  • Studio 5000 PLC Program for Digital Alarms
  • Vacuum Cleaner Programming in Omron PLC
  • Washing Machine Automation PLC Program
  • Functional Block Diagram Analog Alarm Logic
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
You've successfully subscribed !

Continue Reading

Example PLC Program
What are High-Speed Inputs in PLC?
Function Blocks in PLC (FBs) – What You Need To Know?
What is Fail-safe in Siemens PLC?
Single-Acting Cylinder Control using Proximity Sensor
Micro Memory Card (MMC) in Siemens PLC
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

PLC Interview Questions and Answers
Difference Between Static and Temp Memory in Siemens PLC TIA Portal
History of Programmable Logic Controllers (PLC)
How to Save a PLC Project to a Micro Memory Card?
Difference between Compact PLC and Modular PLC
Free Download Programmable Logic Controller (PLC) Book
PLC Motor Operation based on Time Cycle Sequence – Program
Function of Racks in PLC – Types of SIEMENS S7-400 PLC Racks

Keep Learning

Types of Allen Bradley PLC

Types of Allen Bradley PLC

PLC Programmer Tools

Tools Required for PLC Programmer to Carry at Site

Retro-Reflective Sensor

What is a Retro-Reflective Sensor? – Principle, Applications

Start the Counting from a Preset Value in PLC

Start the Counting from a Preset Value in PLC

SCADA System Vulnerabilities

SCADA System Vulnerabilities

What is a function call in TIA Portal

Difference Between FC and FB in Tia Portal

Automatic Car Door Simulation

Automatic Door Operation PLC Programming and Simulation

Single Line Diagram of UPS System

UPS Selection Factors for a Control System

Learn More

Pressure Gauges Common Problems

Pressure Gauges : Common Causes for Failures and Their Effective Solutions

Power Electronics Objective Questions

Single Phase Semi-Converters Quiz

Instrumentation Cyber Security Tips

How to Stop Cyber Attacks on PLC or DCS?

Analog Electronics Objective Questions

Analog Electronics Objective Questions – Set 5

Water Treatment Plant SCADA

Typical HMI Screen Design for Water Treatment Plant

What is a Spool valve

What is a Spool Valve? – Types, Configurations, Applications

PID parameters

PID in Siemens TIA Portal

surface-mounted water pump

Surface-mounted Water Pump

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?