Diagram:-
Learn PLC programming,Free SCADA programming, Download free PLC books, Free manuals,PLC tutorials,PLC presentation.
December 26, 2018
Explain equal instruction using example
Diagram:-
Latching and unlatching Circuit.
PLC Program for Latching and Unlatching Circuit
Problem Description:
In many basic conveying or water-filling systems, the operator manually
controls a water pump to fill a tank. This requires the operator to:
- Start
the pump manually and wait while the tank fills.
- Monitor
the tank level continuously.
- Stop
the pump manually when the tank reaches the High-Level sensor.
This approach is inefficient and prone to human error.
Automation
Requirement:
The system should:
- Allow
the operator to start the pump manually with a push button.
- Keep
the pump latched ON (i.e., running continuously) after the button is
released.
- Automatically
stop the pump when the tank reaches the High-Level (sensor).
- Prevent
the pump from restarting until the operator initiates it again.
Example Scenario:
Let’s consider a manual water conveying system where:
- A START
pushbutton is used to begin pumping.
- A
High-Level float sensor detects when the tank is full.
- A STOP condition is automatically triggered when the tank reaches this level.
Problem
Diagram
Problem
Solution
In this application, we
consider a storage tank that is filled using a water pump. The
system is equipped with the following components:
- One high-level sensor to detect when the tank is full.
- A control panel with:
- A START push button (PB) to manually
start the pump.
- A STOP push button (PB) to stop the pump
manually if needed.
The operation is as follows:
- When the operator presses the START PB,
the water pump is energized to begin filling the tank.
- The pump continues to run until the high-level
sensor detects that the tank is full.
- Upon detecting the high level, the sensor sends a
signal to automatically stop the pump.
- This sequence is implemented using SET and
RESET (Latch/Unlatch) instructions in the PLC to maintain the pump
state between operator actions and sensor inputs.
Although the actual system
includes a manual discharge valve for emptying the tank, it is not
included in the logic control for this program.
Note: This same logic can also
be implemented using relays in conventional control panels.
Program
Here is PLC program for Latching and unlatched circuit for output.
Network
1
Network 2
List
of Inputs and Outputs
Input
Signal
Description |
Address |
START
Push Button |
I0.0 |
STOP
Push Button |
I0.1 |
High-Level
Sensor |
I0.2 |
Low-Level
Sensor |
I0.3 |
Output
Signal
Description |
Address |
Water
Pump |
Q0.0 |
Program
Description
For this
application, we are using a Siemens S7-1200 PLC programmed with TIA Portal
software. The same logic can also be implemented using conventional relay-based
circuits.
This program
demonstrates a latching and unlatching circuit, commonly used in fluid control
applications.
Network
1: Latching Logic (SET Instruction)
The START push
button (I0.0) is used to start the water pump (Q0.0).
When pressed, it
activates the SET instruction, latching the pump output (Q0.0).
A normally open
contact of the Low-Level sensor (I0.3) is placed in series with the START PB to
ensure the pump only starts if the tank is not already full.
A normally open
contact of the Water Pump output (Q0.0) is also included to maintain the
latched condition once the START PB is released.
Network
2: Unlatching Logic (RESET Instruction)
The High-Level
sensor (I0.2) is used to stop the pump automatically when the tank is full.
A normally open
contact of I0.2 is used with the RESET instruction to unlatch the output
(Q0.0).
For manual
stopping, the STOP push button (I0.1) is connected in parallel with the
High-Level sensor input, providing an alternative way to reset the pump.
Runtime
Test Cases
Inputs Condition |
Output |
Physical Result |
I0.0 = 1 & I0.3 = 1 |
Q0.0 = 1 |
Water Pump ON |
I0.1 = 1 |
Q0.0 = 0 |
Water Pump OFF (Manually) |
I0.2 = 1 |
Q0.0 = 0 |
Water Pump OFF (Auto-Stop) |
Explain greater than instruction using example
Parameter Initialization when Power UP
PLC Program for Automatic Parameter Initialisation on Power-Up
This document outlines a PLC programming solution for automatically initializing critical parameters upon machine power-up, preventing data loss due to power failures and enhancing operational efficiency.
Problem Description
In industrial applications, certain machine parameters (e.g., set speed, batch size, target position) often require specific initial values for proper operation. A common challenge arises when power interruptions occur, potentially causing these parameters to reset to zero or retain incorrect values. This necessitates manual re-entry of data by the operator every time the machine powers up or recovers from a power failure, leading to downtime, potential errors, and reduced productivity.
The objective is to ensure that essential machine parameters are automatically initialized to predefined values whenever the machine is powered on, eliminating the need for manual intervention in such scenarios.
Diagram:-
Problem Solution Approach
To address this, we will implement PLC logic that automatically initializes parameters during the PLC's first scan after power-up. Additionally, a manual initialization button will be provided, allowing operators to reinitialize parameters during normal machine operation if needed.
For demonstration purposes, we will consider "Machine Set Speed" as the parameter to be initialized. It will automatically set to a default value on power-up, and an operator can manually adjust or reinitialize it via a button during runtime.
Hardware and Software
PLC: Siemens S7-1200
Programming Software: Siemens TIA Portal
List of Inputs/Outputs
Type |
Address |
Description |
Input |
I0.0 |
Parameter Initialization Button |
Memory |
MW10 |
Set Speed (from HMI/Display) |
Output |
MW12 |
Speed for Drive (Actual Speed Command) |
PLC Program Description
The program utilizes the S7-1200's system memory capabilities, specifically the "First Scan" bit, to trigger automatic initialization. The system memory bits (Always ON, Always OFF, First Scan, Diagnostic Status Changed) are internal bits provided by the PLC for specific system states. Here, we configure M1.0
as the First Scan bit.
Network 1: Automatic and Manual Parameter Initialization
This network handles the initialization of the MW12
(Speed for Drive) parameter.
We use a Normally Open (NO) contact of the First Scan bit (
M1.0
). This contact is active only for one scan cycle immediately after the PLC transitions from STOP to RUN mode (e.g., on power-up or after a manual restart).When
M1.0
is active, a MOVE instruction is executed. This instruction moves the initial default value (e.g., 5 RPM) intoMW12
(Speed for Drive). This ensures that the motor starts at a safe, predefined speed automatically upon power-up.Additionally, a Normally Open (NO) contact of the Parameter Initialization Button (
I0.0
) is connected in parallel. If the operator presses this button during runtime, it will also trigger the MOVE instruction, reinitializingMW12
to 5 RPM, providing a manual override.
Network 2: Manual Data Entry for Runtime Adjustment
This network allows the operator to modify the machine's set speed during normal operation.
This logic enables the operator to enter a desired speed value into
MW10
(Set Speed from Display) via an HMI (Human Machine Interface) or display unit.A MOVE instruction then transfers the value from
MW10
(Set Speed from Display) toMW12
(Speed for Drive).For example, if the operator enters 100 RPM into
MW10
, this value will be moved toMW12
, causing the motor to run at 100 RPM. This allows for dynamic adjustment of the speed during the running cycle, independent of the automatic initialization.
Runtime Test Cases
Input Condition |
Expected Output (MW12) |
Physical Element Behaviour |
PLC Power-Up (First Scan M1.0 becomes 1) |
5 |
Motor runs at 5 RPM (initial) |
Operator enters 100 into MW10 |
100 |
Motor runs at 100 RPM |
Parameter Initialization Button (I0.0) pressed |
5 |
Motor reinitializes to 5 RPM |