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: Seven Segment Display Programming with 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 > Seven Segment Display Programming with Structured Text

Seven Segment Display Programming with Structured Text

Programming a seven segment display in a PLC using structured text language. Control the LED segments with digital inputs and outputs.

Last updated: September 17, 2024 12:48 pm
Viral Nagda
PLC Tutorials
No Comments
Share
5 Min Read
SHARE

We have seen how a seven segment display plays a very important role in many types of indications that we see in our daily lives. If we need to control its logic through PLC, then a new programmer has many options to choose from the language to write it. One of the most highly used and efficient level languages is structured text.

Contents
Seven Segment DisplayProgramming with Structured Text

In this post, we will see how to write a seven segment display logic in a PLC program using structured text language.

Seven Segment Display

seven-segment-display-working-animation
Example

Let us understand the case scenario first. There are four PLC digital inputs and seven PLC digital outputs. For a number to be displayed, the inputs will come in sequence as per the below truth table.

In correspondence to the input sequence received, the outputs will turn on accordingly and display the LED segment with numbers. Refer to the second image for more understanding, where you can co-relate this table with the display.

Input I0Input I1Input I2Input I3Output O1Output O2Output O3Output O4Output O5Output O6Output O7Display
000011111100
000101100001
001011011012
001111110013
010001100114
010110110115
011010111116
011111100007
100011111118
100111110119
Seven Segment Display

Programming with Structured Text

Now, let us write this program. Refer to the below image. In the first four lines, we are moving the values of four inputs in the corresponding bits of a single word. Due to this, we get different values of the word.

The value of this word is the same as the display number.

Seven Segment Display Programming with Structured Text

Now, after these first four lines, we are using a case statement. A case statement is used to execute different conditions based on the value of the variable referred. In our case, we are referring to the input status variable. So, based on its current value, we write 0 or 1 to the seven outputs. Each case value ends with “:” and each statement ends with “;”.

Basically, we are just moving true or false values in the digital outputs based on the input conditions. Whatever may be the input value, it will write a corresponding value to the word and this word will then be used as a reference for writing the outputs.

In place of case statements, we can also use if-else statements. But then, the logic would have become a little bulkier and larger to look at. This means, that we would have to write a total of 10 if conditions for the logic. So, we simplified it more by using a case statement.

This logic looks simple in structured text. Imagine using it in ladder language. We would have to write so many rungs with various parallel conditions for turning the output on.

Task For You: Now program the 7 segment display to show the alphabets as shown in the above animation.

In this way, we saw how to write a seven-segment display logic in a PLC program using structured text language.

Read Next:

  • Structured Text PLC Logic for Motor Interlock
  • How Modbus is used in Industrial Networks?
  • Conveyor Speed Logic using Structured Text
  • Burglar Alarm Security System PLC FBD Logic
  • Car Wash Program Functional Block Diagram

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

What is Relay Logic ?
Typical HMI Screen Design for Water Treatment Plant
Site Commissioning Steps for PLC Programmers
Series Tanks Level Control using PLC Ladder Programming
PLC Analog Input Sampling Ladder Logic
PLC Tag Naming Conventions
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

Vendor Document for Project Systems Architecture
Ladder Logic Example of Two Motors Interlinked with another Motor
#13 PLC Best Practices – Disable Unused Communication Ports
#14 PLC Best Practices – Restrict Third-party Data Interfaces
#12 PLC Best Practices – Validate Inputs based on Physical Plausibility
Automatic Empty Bottle detection using PLC Logic
#15 PLC Best Practices – Safe State when PLC Restarts
PLC Packing Machine Control System Program in XG5000

Keep Learning

Omron PLC for Product Painting with Integrated Weighing System

Omron PLC for Product Painting with Integrated Weighing System

PLC Program for motor operation based on time cycle

PLC Motor Operation based on Time Cycle Sequence – Program

PLC Project Examples for EcoStruxure Machine Expert

PLC Project Examples for EcoStruxure Machine Expert

Motion Detection based Street Light PLC Logic Solution

Motion Detection based Street Light: PLC Logic Solution

Programming in Omron PLC

Automatic Vacuum Cleaner Programming in Omron PLC

Learn about PLC, DCS, RTU, SCADA, and PAC

Learn about PLC, DCS, RTU, SCADA, and PAC

Draw a Ladder Logic to control a bulb using push buttons in PLC

Concept of Latching in PLC

Siemens Profibus Interface DP

How to Create New Project Using Simatic Manager

Learn More

pH Analyzer Calibration and Troubleshooting

pH Analyzer Calibration and Troubleshooting

Power Electronics Objective Questions

Single-Phase Full Wave AC-DC Converter Objective Questions

Specific-Conductance-Calibration-Procedure

Specific Conductance Calibration Procedure

Online Analyzers Questions & Answers

Online Analyzers Questions & Answers

Count the Number of Cartons in a Storage Area PLC Logic

Count the Number of Cartons in a Storage Area PLC Logic

PLC Star-Delta starter with interlock

Schneider PLC Example Program for Star-Delta System

7 Marketing Strategies for Engineering Companies

7 Marketing Strategies for Engineering Companies

RF Capacitance Switch Principle

Safety Switches for Controlling Conveyor Operations

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?