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: Write a PLC Program for Selector Machine using Structured Text
Share
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 > Write a PLC Program for Selector Machine using Structured Text

Write a PLC Program for Selector Machine using Structured Text

Learn how to write a PLC program for a selector machine. Understand the logic and structured text language used in this post.

Last updated: September 18, 2024 3:22 pm
Viral Nagda
PLC Tutorials
No Comments
Share
6 Min Read
SHARE

In this post, we will see a PLC program for writing a selector machine logic using structured text language.

Contents
Write a PLC Program for Selector MachineStructured Text Language

Write a PLC Program for Selector Machine

Let us understand the case scenario first. There are four tanks supplying ingredients to a common mixture tank. According to the recipe made by the operator, the selected ingredients will be fed to the common tank for a set time. If any of the tank levels are low, the process will not run and halt at the corresponding stage.

The operator will manually fill the tank and wait for the level to become normal. If the collection tank level becomes high, then the process will abort or reset; this is because the recipe is designed properly, and filling the tank fully means there is some abnormality in the recipe or process.

After the recipe time is completed successfully, the cycle will reset and wait for the next start operation from the user. Pressing the start button starts the process, pressing the stop button pauses the process, and pressing the reset button resets the process.

According to our requirements, these are the following PLC IOs:

  1. Digital inputs – start push button, stop push button, and reset push button.
  2. Digital outputs – tank-1 discharge valve, tank-2 discharge valve, tank-3 discharge valve, and tank-4 discharge valve.
  3. Analog inputs – tank-1 level, tank-2 level, tank-3 level, tank-4 level, and common tank level.

Structured Text Language

Let us now see the logic for this process. Refer to the below image. First, we will create a logic for starting, stopping, and resetting the logic. We will use two main bits in the logic – cycle running and cycle started.

Cycle running can be started or paused anytime, but the cycle started is a latched bit. It latches once the cycle starts and resets only on reset condition. If the start button is pressed, then we set both these bits.

If the stop button is pressed or if the cycle is not started, then we reset the cycle running bit. If the reset button is pressed, then we reset the cycle started bit.

PLC Program for Selector Machine using Structured Text

Next, we use the batch cycle counter for the process timer. We use a set value of 10 seconds. If the cycle is running, then the counter increments every second. If the cycle is not started, then the counter remains in reset condition. And when the counter is done, then we reset the cycle started a bit.

Now, we will write the logic for the step counter. We use three-step setpoints, which will be written by a recipe in HMI. If the current batch timer value is less than setpoint-1 and the cycle is started, then we are in step number 1.

If the current batch timer value is greater than setpoint-1 and less than setpoint-2 and the cycle is started, then we are in step number 2. If the current batch timer value is greater than setpoint-2 and less than setpoint-3 and the cycle is started, then we are in step number-3. If the cycle is not started, then we are in step number 0.

Next, we need to turn on the valves according to the recipe. The recipe will change its set values according to the current step number. So, we create a case statement of four values.

  • If tank number 1 is selected, then we turn on valve 1 and turn off the remaining valves.
  • If tank number 2 is selected, then we turn on valve-2 and turn off the remaining valves.
  • If tank number 3 is selected, then we turn on valve 3 and turn off the remaining valves.
  • If tank number 4 is selected, then we turn on valve 4 and turn off the remaining valves.

Now, we will write the logic for pausing and aborting the logic. If any of the tank levels is less than 100 liters, then we reset the cycle running bit.

If the common tank level is more than 500 liters, then we reset the cycle started a bit.

If the cycle is not running, then all the valves will remain off.

In this way, we saw how to write a PLC program for a selector machine using structured text.

Read Next:

  • PLC Program for Sequential Motor Control
  • Run Motors Sequentially using PLC Program
  • Sequential PLC Program Pneumatic Valve
  • PLC Program for Water Level Control Logic
  • Structured Text PLC for Sequential Process

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

Functions of SCADA
How to Check Address Overlapping in Tia Portal?
How to Interchange ON Delay Timer and OFF Delay Timer in a PLC
Electrical Cabinet Air Conditioner – Enclosure Cooling, Maintenance
Basic PLC Ladder Programming Example
Function of Racks in PLC – Types of SIEMENS S7-400 PLC Racks
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

Attendance System PLC Program using CX-Programmer
How to Choose a Suitable HMI for Your Application?
PLC Program using START and STOP Buttons
Exhaust Fan Control: Example of PLC Timer Programming
Single-acting Pneumatic Cylinder Operation with Limit Switch
How to Select a SCADA for New PLC Project?
PLC Analog Input Card Resolution Effects on Accuracy
Instrumentation and Control Project Packages – Detail Engineering

Keep Learning

OMRON PLC program for waste-burning automation

Waste-Burning System OMRON PLC Program Example

Types of PLC

Types of PLC

Transmitters 4-20mA Current Failure Alarm Limits

Transmitters 4-20mA Current Failure Alarm Limits

Free Download PLC Book

Free Download Programmable Logic Controller (PLC) Book

Profibus DP Master

DP Master System Configuration in PLC

PLC Subroutine

Allen Bradley PLC Subroutines

PLC Program for Burglar Alarm Security System

PLC Program for Alarm Security System

PC-Based Motion Controller

Various Types of Delta PLC used in Industrial Automation

Learn More

Example of Automated Guided Vehicle with PLC

Example of Automated Guided Vehicle with PLC

Digital Electronics Multiple Choice Questions

Programmable Read Only Memory Objective Questions – Part 1

Process Control Instrumentation Objective Questions

Process Control & Instrumentation Objective Questions – Set 6

Capacitor Principle

Capacitor

Selecting the Best Inductive or Capacitive Sensor

Selecting the Best Inductive or Capacitive Sensor

What is OTDR Testing

Understanding the Difference between HOP Test and OTDR

Electrical Engineering Interview Questions

Electrical Engineering Interview Questions

Difference Between Industrial Computer and Normal Computer

Difference Between Industrial Computer (IPC) and Normal Computer (PC)

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?