Inst ToolsInst ToolsInst Tools
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: Seven Segment Display Programming with Structured Text
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
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 !
Comparison Instructions in PLC Programming
Types of Interrupt OB in Siemens Tia Portal
Siemens PLC Mathematics Instructions
Real-Time Clock in Omron PLC? – CX Programmer
Speed Control of Pneumatic Cylinder (Explanation with 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
208kSubscribersSubscribe
38kFollowersFollow

Categories

Recent Comments

  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • MIHARITSOA Aina Sitraka on Top Non-PLC Certification Courses for Automation Professionals
  • Vaishnavi on Free Instrumentation Course for Trainee Engineers

Related Articles

PLC Motor Control Circuit

Motor Trip Logic using PLC Programming

PLC Commissioning and Testing

PLC Commissioning and Testing Procedure (Programmable Logic Controller)

Bit Shift Registers PLC Program

PLC Light Sequence Control using Bit Shift Registers

Relay Symbols

Relay circuits

Trolley and hoist PLC control

PLC Crane Movement Control with Limit Switches

Concept of Interlocking in PLC

Concept of Interlocking in PLC

PLC Logic for Water Pumping and Chemical Addition

Developing PLC Logic for Water Pumping and Chemical Addition

PLC Program

PLC Program to Heat and Bend Glass Tubes

More Articles

Electronic Devices & Circuits Objective Questions

Electronic Devices & Circuits Quiz – Set 12

Electric Drives and Traction Objective Questions and Answers

Electric Drives and Traction Interview Questions

Thermal Dispersion Flow Switch Working Principle

Thermal Dispersion Flow Switch Working Principle

Digital Electronics Multiple Choice Questions

Erasable Programmable Read Only Memory Objective Questions

Lime Slaker

Advancements in Lime Slaking Technology: What’s New And What’s Next

Power Electronics Objective Questions

GTO Objective Questions and Answers

Chlorine dioxide measurement principle

Chlorine dioxide Analyzer Principle

Thermography and Thermometry Objective Questions

Thermography and Thermometry Objective Questions

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?