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

How to Communicate with Excel from Intouch SCADA?
PLC Programming Example with Pushbutton and Motor
OpenPLC – PLC Training for Students – Free Tutorials & Courses
Best Practices of PLC Wiring – Programmable Logic Controller
200+ Quiz on Electrical Meters, Measurement, and Troubleshooting
Scheduled Daily Plant Watering PLC Program
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 Ladder Program for Automatic Car Wash using Siemens TIA Portal
Compare Modbus, Fieldbus, and Profibus
PLC Program for Controlling Sequence of Conveyors with Interlock
CX-Programmer Products Sorting & Counting – Omron PLC
Troubleshoot Allen Bradley PLC Logic
PLC Logic Functions
Face Mask Making Machine using PLC and HMI
Overview of SIEMENS PLC – S7-1500, S7-1200, S7-400, S7-300

Keep Learning

Program to implement T Flip Flop logic

T Flip Flop PLC Ladder Diagram

Batch Mixing with PLC Ladder Logic Program

Batch Mixing with PLC Ladder Logic Program

Open Platform Communication (OPC)

Open Platform Communication (OPC)

PLC program to control pump

Troubleshooting PLC Permissive Inputs

Allen-Bradley PLC

#15 PLC Best Practices – Safe State when PLC Restarts

Advanced Ladder Logic PLC Example

Automatic Sanitizer – Complex Ladder Logic PLC Examples

Ladder Logic Questions and Answers

Ladder Logic MCQ Questions and Answers

Safety interlock for motor starters in Siemens PLC

Motor Starter Logic using Siemens PLC Tia Portal

Learn More

PLC based Automatic Packaging System

PLC based Automatic Packaging System

Disk valves

What is a Disc Valve ?

pneumatic piston actuator

Working Principle of Pneumatic Actuators

Top 10 Podcasts about Electronics

Top 10 Podcasts about Electronics

What is NEST loading=

What is Nest Loading? – DCS and PLC Control Systems

microwave flow detector applications

Microwave Flow Sensor – Working Principle and Applications

Electric Bell Working animation

Electric Bell Working animation

PLC Retrofitting Project

What is a PLC Retrofitting Project? – Importance, Procedure

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?