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 !
Process Interlocks and Trips
What is Fail-safe in Siemens PLC?
OpenPLC – PLC Training for Students – Free Tutorials & Courses
What is Human Machine Interface (HMI) ?
PID Block in RSLogix 500
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

  • Kamli on Top Free PLC Software
  • 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

Related Articles

Basics of PID Controllers

PID Controllers in Closed Loop Control Systems – PLC Basics

Creating Logic in Intouch Using Scripting

Create Logic with InTouch Scada using Scripting

Light Tower in Industrial Automation

What is a Tower Lamp? – Light Tower in Industrial Automation

InTouch SCADA Password Protection

InTouch SCADA Login Password Security

Pneumatic valve operation in sequence mode

Sequential PLC Programming for the Pneumatic Valves

PLC Tutorials - Timers and Counters

Difference between Timer and Counter – PLC Basics

PLC Ladder Program for Automatic Car Wash

PLC Ladder Program for Automatic Car Wash using Siemens TIA Portal

Why is 24 Volts Commonly used in PLC Systems?

Why is 24 Volts Commonly used in PLC Systems?

More Articles

Why Armature is placed on Stator for Synchronous machines

Chromatography Questions & Answers

Detection System of Gas Chromatography Questions and Answers

Control Valve Whisper Trim Cage

Problem with Choked Control Valve with Whisper Trim Cage

two chemical streams are mixed together

Practical Process Control System Questions & Answers – 12

Infrared Open Path Gas Detectors Operation

Infrared Open Path Gas Detectors Working Principle

Internet of Things Communication Models (IoT)

Internet of Things Communication Models (IoT)

Light ON OFF Control using PLC

Light ON OFF Control using PLC

How to Use SMD Components in Electronic Circuits

How to Use SMD Components in Electronic Circuits?

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?