0% found this document useful (0 votes)
124 views36 pages

PLC Programming with FluidSim Guide

The document provides an overview of Programmable Logic Controllers (PLCs), detailing their components, operation, and programming languages. It includes practical exercises for designing PLC systems for various industrial automation tasks, such as sealing cans, diverting packages, and filling plastic pellets. Each exercise outlines the problem, process, and necessary variables for programming in Codesys.

Uploaded by

Mojery Mohau
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views36 pages

PLC Programming with FluidSim Guide

The document provides an overview of Programmable Logic Controllers (PLCs), detailing their components, operation, and programming languages. It includes practical exercises for designing PLC systems for various industrial automation tasks, such as sealing cans, diverting packages, and filling plastic pellets. Each exercise outlines the problem, process, and necessary variables for programming in Codesys.

Uploaded by

Mojery Mohau
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PLC

Programming
Using FluidSim
By Siyabonga Mthombeni
Introduction to Programmable Logic Controllers

A Programmable Logic Controller (PLC) can be defined as a microprocessor-based controller that


uses stored instructions in programmable memory to implement logic, sequencing, timing,
counting, and arithmetic control functions for controlling machines and processes.

• A Programmable Logic Controllers (PLCs) is a specialized computing devices used in industrial


automation to control machinery and processes.

• A PLC can control various machines or devices such as lights, cylinders, motors and sensors.
Introduction to Programmable Logic Controllers
Introduction to Programmable Logic Controllers
Key Components of a PLC

•Input/Output (I/O) Modules: These interface with external devices. Inputs can be from sensors,

switches, etc., and outputs control actuators like motors and valves.

•Central Processing Unit (CPU): The brain of the PLC, which processes input signals, executes the

control logic, and outputs signals.

•Power Supply: Provides the necessary power for the PLC to operate.

•Programming Device: A computer or handheld device used to program the PLC with control logic.
Working Principle or
Operation of PLC
•PLCs operate in a continuous cycle: Input Scan →
Program Execution → Output Scan.
•During the input scan, the PLC reads the status of
inputs. Then, it executes the programmed logic
based on these inputs, followed by updating the
output
Programming Languages for PLCs
PLCs can be programmed using various languages, including:

•Ladder Logic: A graphical programming language resembling electrical relay logic.

•Function Block Diagram (FBD): Uses blocks to represent functions and connections.

•Structured Text (ST): A high-level text-based language.

•Instruction List (IL): A low-level language similar to assembly.


Inputs/Outputs (I/O)

Inputs:
• Pushbuttons

• Emergency Stop Pushbutton


Inputs/Outputs (I/O)
Inputs/Outputs (I/O)

Outputs:
• Conveyor Belts
• Cylinders (Single-acting/Double-acting)
• Motors
• Pumps
EXERCISE 1: SEALING CANS
Description of the problem

Half liter cans are filled with wall or ceiling paint at a manual workstation. The lids are press fitted with a pneumatic press

Description of the process

•The cans are manually inserted into the press.

•After pressing a pushbutton, the press cylinder is advanced, and the lid is press fitted.

•When the pushbutton is released, the press cylinder remains in the advanced position.

•The cylinder will only retract when the stop pushbutton is pressed (dominant breaking signal).

•The sealed cans are removed manually.

•A single-acting cylinder will be used.

DESIGN A PLC SYSTEM THAT CAN USED FOR THIS SYSTEM


VARIABLES FOR CODESYS

//INPUTS
I0 AT %IX0.0: BOOL; //START PB 0
I1 AT %IX0.1: BOOL; //START PB 0
//OUTPUTS
Q0 AT %QX0.0: BOOL; //SOLENOID VALVE
SOLUTION FOR EXERCISE 1
SOLUTION FOR
EXERCISE 1 (with
EMG STOP)

A suitable PLC circuit will look like this. We follow


IEC 61131-3 standards when programming PLC,
strict adherence is imperative. By law, it is
required that any device that must switch OFF an
electrical circuit, like a stop button, E-Stop button,
limit switches, etc. Must use a N.C contact for
safety reasons. Thus, the stop button (I1) and
the E-Stop button (I2) should actually be a N.C.
buttons.
INTRODUCTION OF SENSORS
EXERCISE 2: Diverting
Packages
Description of the problem
Packages will be diverted from one conveyor to another by means of a diverter.
Description of the process
1. The diverting gate is advanced when the start pushbutton is activated and when
the cylinder is in the retracted end position to ensure that the boxes are properly
diverted.
2. The diverting gate is returned to its initial position when a stop pushbutton is
activated.
General conditions
• A double-acting cylinder will be used.
• A limit switch will be used to detect the end positions.
• An emergency switch must be used to stop in system in case of an accident.
VARIABLES FOR CODESYS

//INPUTS
I0 AT %IX0.0: BOOL; //START PB
I1 AT %IX0.1: BOOL; //STOP PB
I2 AT %IX0.2: BOOL; //EMG STOP PB
I3 AT %IX0.3: BOOL; //LIMIT SWITCH
//OUTPUTS
Q0 AT %QX0.0: BOOL; //SOLENOID VALVE
PLC Circuit
SOLUTION TO EXERCISE 2
EXERCISE 3:Filling plastic pellets

Description of the problem


Plastic pellets need to be filled from a storage silo. The silo is opened and closed with a flap. The
process will be started from two locations.
Description of the process
1. The flap is opened by pressing either one of two pushbuttons, and the bulk material is
emptied out of the container due to the cylinder advancing.
2. When the stop pushbutton is activated, the flap is closed as the cylinder retracts.
VARIABLES FOR CODESYS

//INPUTS
I0 AT %IX0.0: BOOL; //START PB 1
I1 AT %IX0.1: BOOL; //STOP PB
I2 AT %IX0.2: BOOL; //EMG STOP PB
I3 AT %IX0.3: BOOL; //START PB 2
//OUTPUTS
Q0 AT %QX0.0: BOOL; //SOLENOID VALVE 0
PLC CIRCUIT
SOLUTION FOR EXERCISE 3
EXERCISE 4: Optimizing the inspection of
beverage crates
Description of the problem
Beverage crates are checked for completeness with the help of an inspection unit. Incomplete crates are pushed off of the
roller conveyor by pressing a pushbutton. Problems occur repeatedly with the setup used thus far. The pushbutton is not
pressed long enough and, as a consequence, the single-acting cylinder doesn’t advance to the front end position. The
ejected beverages crates become jammed in the ejection area. Develop a controller with which this problem can be
eliminated.
Description of the process
1. The cylinder of a piston rod should advance as soon as pushbutton is activated.
2. 2. After the piston rod reaches the front end position and activates a magnetic proximity switch, it should be retracted
automatically
General conditions
A double-acting cylinder will be used.
VARIABLES FOR CODESYS

//INPUTS
I0 AT %IX0.0: BOOL; //START PB 1
I1 AT %IX0.1: BOOL; //STOP PB
I2 AT %IX0.2: BOOL; //EMG STOP PB
I3 AT %IX0.3: BOOL; //MAGNETIC PROXIMITY SENSOR
//OUTPUTS
Q0 AT %QX0.0: BOOL; //SOLENOID VALVE 0
PLC
Circuit
SOLUTIONS FOR EXERCISE 4
PLC CIRCUIT
EXERCISE 5:
Description of the problem
Bottles need to be diverted in groups of three from one conveyor to another by means of a
diverter. After being switched on, the system should run continuously. It should not be
switched off until a stop signal is generated.
Description of the process
1. The sequence is started by pressing a pushbutton.
2. If three bottles are present the retracted end position, the diverting cylinder’s piston rod is
advanced.
3. The bottles are diverted and transported to a second conveyor belt.
4. The sequence is stopped by pressing a second pushbutton
VARIABLES FOR CODESYS

//INPUTS
I0 AT %IX0.0: BOOL; //START PB
I1 AT %IX0.1: BOOL; //STOP PB
I2 AT %IX0.2: BOOL; //EMG STOP PB
I3 AT %IX0.3: BOOL; //PROXIMITY SWITCH FP
I4 AT %IX0,4:BOOL; //PROXIMITY SWITCH BP
//OUTPUTS
Q0 AT %QX0.0: BOOL; //SOLENOID VALVE 0
Q1 AT %QX0.0: BOOL; //SOLENOID VALVE 1
PLC Circuit
SOLUTION TO EXERCISE 5 without
timer
Line 1 is a start/stop circuit that allows this code to run continuously
Variables with Timer
//INPUTS
I0 AT %IX0.0: BOOL; //START PB 0
I1 AT %IX0.1: BOOL; //STOP BUTTON
I2 AT %IX0.2: BOOL; // EMG STOP
I3 AT %IX0.3: BOOL; //PROXIMITY SENSOR 1
I4 AT %IX0.4: BOOL; // PROXIMITY SENSOR 2

//OUTPUTS
Q0 AT %QX0.0: BOOL; //SOLENOID 0
Q1 AT %QX0.1: BOOL; //SOLENOID 1
SR_0: SR;
TON_0: TON;
M0: BOOL;
SOLUTION TO EXERCISE 5
with timer
Continuous
PLC Code
with 2
timers

You might also like