logo
  • Home
  • About
  • Training
  • Programming
  • CS
  • IT
  • IS
  • ECE
  • EEE
  • EE
  • Civil
  • Mechanical
  • Chemical
  • Metallurgy
  • Instrumentation
  • Aeronautical
  • Aerospace
  • Biotechnology
  • Agriculture
  • MCA
  • BCA
  • Internship
  • Contact

PLC Programming Examples

PLC Programming Examples
Practice following PLC examples which are from Digital Logic, Home and Industrial Automation areas.

Get Started

PLC - Logic Gates
PLC - Boolean Functions
PLC - Boolean Don't Care
PLC - Combinational Logic 1
PLC - Combinational Logic 2
PLC - Binary to BCD Converter
PLC - BCD to Excess-3
PLC - Excess-3 to BCD
PLC - Binary to Gray Code
PLC - Gray Code to Binary
PLC - BCD to Gray Code
PLC - Magnitude Comparator
PLC - 4:1 Multiplexer
PLC - 8:1 Multiplexer
PLC - 1:8 Demultiplexer
PLC - 3 to 8 Decoder
PLC - 8 to 3 Encoder
PLC - SR Flip-Flop
PLC - Seven Segment Display
PLC - Parts Stamping
PLC - D Flip Flop
PLC - T Flip Flop
PLC - Latch & Unlatch
PLC - Latch & Unlatch - Sealing
PLC - Latch & Unlatch - Delay
PLC - Burglar Alarm Security
PLC - Car Parking System
PLC - Classroom Capacity
PLC - Automatic Car-Wash
PLC - Operate 4 Outputs - Delay
PLC - Interlocking Drive Motors
PLC - Forward/Reverse Drive
PLC - Control Lights Sequence 1
PLC - Control Lights Sequence 2
PLC - Mathematical Functions
PLC - Outputs Based Equations
PLC - Jump to Other Process
PLC - Pulse Width Modulation
PLC - Subroutine Process
PLC - Traffic/Pedestrian Lights
PLC - Control Traffic Lights
PLC - Single Tank Level Control
PLC - Two Tanks Level Control
PLC - Series Tanks Level
PLC - Parallel Tanks Level
PLC - Tank - Heating Liquid
PLC - Tank - Control Mixing
PLC - Control Processing Line
PLC - Bottle Filling System
PLC - Conveyor - Count Parts
PLC - Conveyor - Pack Parts
PLC - Conveyor Sequence
PLC - Drilling of Parts
PLC - Cleaning/Rinsing Bottles
PLC - Conveyor - Sort Parts
PLC - Heat Tank - Steam Flow
PLC - Products Heating/Mixing
PLC - Maintain Tank Level
PLC - Continuous Tank Reactor
PLC - Unknown Frequency
PLC - Measure PLC Scan Cycle
PLC - Heat/Bend Glass Tubes
PLC - Bottle's Capping Rotation
PLC - Beverage Bottle Capping
PLC - Conveyor Bottle Removal
PLC - Event Time Measurement
PLC - Light as Signal
PLC - Reset NonRetentive O/P
PLC - Counter Preset Value
PLC - Drain Same Products
PLC - Drain Different Products
PLC - Display Tank Level
PLC - Display More Tank Levels
PLC - Spray-Painting
PLC - Separate Big/Small Parts
PLC - Operate Screwing of Parts
PLC - Detect Burned Chips
PLC - Store Process Data
PLC - Store Temperature Data
PLC - Oil/Water Separation

« Prev Page
Next Page »

PLC program to implement Excess-3 to BCD Conversion

Posted on January 20, 2017 by Manish

This is a PLC program to implement Excess-3 to BCD converter.

Problem Description

Implementing Excess-3 to BCD conversion in PLC using Ladder Diagram programming language

Problem Solution
  • BCD can be derived from Excess-3 code by reversing the process used in conversion of BCD to Excess-3 code which is to subtract 0011 or 0011 0011 from given BCD number.
  • For example, Decimal number 12 is represented as 0100 0101 in Excess-3 code. If we subtract 3 (0011 0011) from given Excess-3 code, then the corresponding BCD is 0001 0010.
  • Write the truth table relating Excess-3 and BCD.
  • Write Karnaugh-Map for each output and obtain simplified expression.
  • Implement Excess-3 code to BCD converter using Logic Gates.
  • Implement Logic Gates’ circuit in PLC using Ladder Diagram programming language.

Truth Table relating BCD and Excess-3 codes

Decimal	Excess-3 inputs	                BCD outputs
	E3	E2	E1	E0	B3	B2	B1	B0
0	0	0	0	0	x	x	x	x
1	0	0	0	1	x	x	x	x
2	0	0	1	0	x	x	x	x
3	0	0	1	1	0	0	0	0
4	0	1	0	0	0	0	0	1
5	0	1	0	1	0	0	1	0
6	0	1	1	0	0	0	1	1
7	0	1	1	1	0	1	0	0
8	1	0	0	0	0	1	0	1
9	1	0	1	1	0	1	1	0
10	1	0	1	0	0	1	1	1
11	1	0	0	1	1	0	0	0
12	1	1	0	0	1	0	0	1
13	1	1	0	1	x	x	x	x
14	1	1	1	0	x	x	x	x
15	1	1	1	1	x	x	x	x

Boolean expression for each Excess-3 code bits

B3= m(	11, 12) + d (0, 1, 2, 13, 14, 15)
B2= m(7, 8, 9, 10) + d (0, 1, 2 13, 14, 15)
B1= m(5, 6, 9, 10) + d (0, 1, 2 13, 14, 15)
B0= m(4, 6, 8, 10, 12) + d (0, 1, 2 13, 14, 15)

Karnaugh-Map for each output
plc-program-implement-excess-3-bcd-conversion-01
plc-program-implement-excess-3-bcd-conversion-02
Realizing code conversion using Logic Gatesplc-program-implement-excess-3-bcd-conversion-03

PLC Program

Here is PLC program to implement Excess-3 to BCD converter, along with program explanation and run time test cases.

List of Inputs and Outputs
 E3=				I:1/0	(Input)
 E3=				I:1/1	(Input)
 E1=				I:1/2	(Input)
 E0=				I:1/3	(Input)
 B3=				O:2/0	(Output)
 B2=				O:2/1	(Output)
 B1=				O:2/2	(Output)
 B0=				O:2/3	(Output)

Ladder Diagram to obtain Excess-3 code outputplc-program-implement-excess-3-bcd-conversion-04

Program Description
  • By simply reversing the process of BCD to Excess-3 Code conversion, BCD can be derived from given Excess-3 code.
  • RUNG000 to RUNG003 are for BCD bits B3 to B0 respectively.
  • Simplified expression is converted into Logic Circuit and the circuit is implemented in Ladder Diagram as shown in fig above.
  • RUNG000 is for B3 in which two AND gates and output of these gates are ORed together to form bit B3. I:1/0, I:1/2, I:1/3 are connected in series as an AND gate and I:1/0, I:1/1 are connected similarly in series.
  • Output of these AND gates (E3E2E1 and E3E2) are connected in parallel to each other contributing as OR function.
  • Similarly all other inputs in Rungs are connected.
Runtime Test Cases
Decimal	Excess-3 inputs	                BCD outputs
	E3	E2	E1	E0	B3	B2	B1	B0
3	0	0	1	1	0	0	0	0
4	0	1	0	0	0	0	0	1
5	0	1	0	1	0	0	1	0
6	0	1	1	0	0	0	1	1
7	0	1	1	1	0	1	0	0
8	1	0	0	0	0	1	0	1
9	1	0	1	1	0	1	1	0
10	1	0	1	0	0	1	1	1
11	1	0	0	1	1	0	0	0
12	1	1	0	0	1	0	0	1

Sanfoundry Global Education & Learning Series – PLC Algorithms.

To practice all PLC programs, here is complete set of 100+ PLC Problems and Solutions.

« Prev Page - PLC Program to Implement BCD to Excess-3 Code Conversion
» Next Page - PLC Program to Implement Binary to Gray Code Conversion
« PLC Program to Implement BCD to Excess-3 Code Conversion
PLC Program to Implement Binary to Gray Code Conversion »

Deep Dive @ Sanfoundry:

  1. Java Programming Examples on Graph Problems & Algorithms
  2. C++ Programming Examples on Graph Problems & Algorithms
  3. C++ Programming Examples on Data-Structures
  4. C++ Programming Examples on Set & String Problems & Algorithms
  5. C Programming Examples on Set & String Problems & Algorithms
  6. C Programming Examples on Graph Problems & Algorithms
  7. Java Programming Examples on Collection API
  8. C Programming Examples on Data-Structures
  9. C++ Programming Examples on STL
  10. PLC Programming Examples
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn | Facebook | Twitter | Google+

Best Careers

Developer Tracks
SAN Developer
Linux Kernel Developer
Linux Driver Developer
Linux Network Developer

Live Training Photos
Mentoring
Software Productivity
GDB Assignment
Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro, Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology
SAN II - Admin
Linux Fundamentals
Advanced C Training
Linux-C Debugging
System Programming
Network Programming
Linux Threads
Kernel Programming
Kernel Debugging
Linux Device Drivers

Best Reference Books

Computer Science Books
Algorithm & Programming Books
Electronics Engineering Books
Electrical Engineering Books
Chemical Engineering Books
Civil Engineering Books
Mechanical Engineering Books
Industrial Engineering Books
Instrumentation Engg Books
Metallurgical Engineering Books
All Stream Best Books

Questions and Answers

1000 C Questions & Answers
1000 C++ Questions & Answers
1000 C# Questions & Answers
1000 Java Questions & Answers
1000 Linux Questions & Answers
1000 Python Questions
1000 PHP Questions & Answers
1000 Hadoop Questions
Cloud Computing Questions
Computer Science Questions
All Stream Questions & Answers

India Internships

Computer Science Internships
Instrumentation Internships
Electronics Internships
Electrical Internships
Mechanical Internships
Industrial Internships
Systems Internships
Chemical Internships
Civil Internships
IT Internships
All Stream Internships

About Sanfoundry

About Us
Copyright
TOS & Privacy
Jobs
Bangalore Training
Online Training
SAN Training
Developers Track
Mentoring Sessions
Contact Us
Sitemap
© 2011 Sanfoundry