Software for Education and Industry

   Home   Order Form    Reviews   

Advanced Exercises for PLC Structured Text with Codesys

This tutorial is a series of exercises that will give you practice programming a PLC in Structured Text using Codesys. 
Each exercise is accompanied by a Visualization (pictorial view of the exercise), and custom Image Pool so you can "see things move" as a result of the programs you write.
The variables and instructions for each exercise are given so you can build the Visualization and test the program.
Then you are asked to make various modifications to the control system.  The answer to each modification is provided if you need help.

This tutorial assumes you have completed my tutorial entitled PLC Structured Text with Codesys  or otherwise have a working knowledge of Codesys
and how to launch it, start a new structured text program, create a Visualization, and run a program in Simulation mode.
It also assumes you know the basics of how to program:

Table of Contents


1.  Introduction       

Learn the purpose of this tutorial, what you need to use it, how to best use it, what Structured Text is, what Codesys is, and who uses Codesys.

2.  Hydraulics and Pneumatics

Learn about 2-way, 4-way, momentary and maintained solenoid valves, cylinders, and how to create an ImagePool from custom images for Visualizations. Then program solenoid valves,cylinders,and limit switches to control cylinders.

3.  Spray Station 
Use animation to move cars to a spray station via a conveyor, then spray the cars by pressing a pushbutton.
Initially, spraying can occur at any time, whether a car is present or not. Modify the program so that spraying can occur only when a car is under the sprayer, the conveyor stops when spraying occurs, and restarts when spraying is done.  Also, modify the program so that spraying occurs automatically for 3 seconds when you press the spray pushbutton and there is an indication that the sprayer is out of paint after 15 seconds of spraying so the sprayer can be refilled.


4.  Conveyor Control                  

Control a conveyor with three stations along the conveyor where the conveyor can be stopped. Initially, each stop station consists of a maintained switch. Modify the program by replacing the  maintained switches with momentary switches, and by adding a pushbutton required to reset any stoppage of the conveyor. 

5.  Stamping Station                         
This exercise involves a stamping station where a part can be stamped multiple times. Initially, the part is stamped repeatedly when the Start pushbutton is pressed. Modify the program by adding a counter so that the part is stamped only X times, and add a thumbwheel switch  so the operator can dial-in the number of times the part is to be stamped.


6.  Inspection Station

Use animation to move cars from left to right on a conveyor. Each time the Advance Car pushbutton  is pressed, another car moves onto the conveyor. Initially, only the first car onto the conveyor  can be marked to be sprayed with paint when it gets to the end of the line. Modify the program with a shift register so that any number of cars coming onto the conveyor can be marked to be painted   when they reach the end of the line.

7 . Pressing Operation
Use Structured PLC Programming to design control for a pressing operation. When the Start pushbutton is pressed, a Position cylinder moves a part onto a Raise cylinder which raises the part so that it can be pressed by a Left and Right cylinder. Modify the control as directed for a more efficient operation.


8.  LED Driver

Use a 1 dimensional array to drive a 7-segment LED from a 10 key keypad. Then use a 2 dimensional array to drive the 7-segment LED.

9.  Turret Machine                      

Use Structured PLC Programming to design control for a turret machining operation. When the Start pushbutton is pressed, cylinders move a part to one of four positions for machining. Modify the control as directed for a more efficient operation.

10.  Elevator    

Use Structured PLC Programming to help design control for a simplified elevator. After seeing how hall buttons can call the elevator to the correct floor, modify the program to include call buttons in the elevator car. Learn about element layers in a Visualization, and how to group elements so they move in unison.


11. Traffic Lights                                 

Use Structured PLC Programming to design control for four traffic lights at an intersection. Then modify the program to include a left turn signal that temporarily stops opposing traffic.

12.  Car Wash

Use Structured PLC Programming and a multiplexer to design control for an automated car wash. Then modify the control so that the Soak cycle includes the Rinse solenoid, and modify it again to provide the option of a Two Soap cycle.             

What you need to use this tutorial: