Assigment 2
Assigment 2
class: 301
• Ladder diagrams
• Statement listing
• Functional diagrams
• Mimic diagrams
• Timers
• Counters
• Motion
• Integrate Development Environments:
Integrated development environments (IDE) are applications that
facilitates the development of other applications. Designed to
encompass all programming tasks in one application, one of the main
benefits of an IDE is that they offer a central interface with all the tools
a developer needs, An IDE, or Integrated Development Environment,
enables programmers to consolidate the different aspects of writing a
computer program.
IDEs increase programmer productivity by combining common
activities of writing software into a single application:
✓ Source code editor: Writing code is an important part of programming.
We start with a blank file, write a few lines of code, and a program is born!
IDEs facilitate this process with features like syntax highlighting and
autocomplete.
✓ Debugger: Debuggers are used during testing and can help
developers debug their application programs.
✓ Build tools: These can help automate developer tasks that are
more common to save time.
Example:
What Is Integrated Development
Environment (IDE)?
An integrated development environment (IDE) is a software suite that combines all
the development tools into a single graphical user interface (GUI). As a result, it
makes the development process more efficient and faster.
Some examples of popular integrated development environments
are NetBeans, Microsoft Visual Studio, Adobe Flex Builder, and Eclipse.
Now, let’s see the following features in an IDE that can improve overall productivity:
• Code editor – mainly used for writing and editing the source code. Many IDEs
also integrate with a text editor like an HTML editor that can highlight
keywords and syntax errors.
• Code completion – known as a code prompt, this feature is used to analyze
the entire code to identify and insert missing code components. Using it will
save time and minimize bugs or errors.
• Compiler – translates the plain text into a programming
language like JavaScript and Python so a computer can process it.
• Debugger – helps developers find and fix error codes in an application or a
website during the testing phase. For instance, debugging your
WordPress site will ensure its functionality and performance work well before
publishing it to users.
• Build automation tools – these are used to automate creation and software
development processes, such as compiling the source code into machine
code, packaging the binary code, and running automated tests.
• Programming language support – most IDEs are dedicated to a specific
programming language. For example, Xcode is used to develop macOS with
the Objective-C and Swift languages. However, some IDEs also offer multiple
languages like Eclipse and Komodo IDE.
• Version control – enables developers to track any changes they’ve made. It
also can help the IDE connect with the source repository they use.
• Ladder diagrams
Example (1) in pumping station
There may be three cases in this scenario.
1. Case-1
In the first case, there is no water present in the tank. So, both the sensor-1 and
sensor-2 are in their ideal status.
2. Case-2
In the second case, there is some amount of water in the tank or we can say that the
water tank is half filled up. So in this case sensor-1 detects that there is water inside the
tank, but sensor-2 is in its ideal status. There is no water at sensor-2. It means that the
tank is not filled fully with water.
3. Case-3
The third case represents that the tank is filled fully with water. There is water at both
sensor-1 and sensor-2.
In both the first and second cases, we have to give the motor to remains ON because
the tank is only partially filled with water. But in the third case, we have to stop the
motor because in this case tank is filled fully with water.
A Less than or equal logic energize when the input value is less than or equal
to the setpoint.
A Greater than or equal logic energize when the input value is greater than or
equal to the setpoint.
S1 connected in the first line and the last line of the above ladder diagram is
programmed to the heater output circuit to control the circuit.
MOV instruction carries and displays the output values of the temperature
measuring device, MOV instruction addresses a thermocouple here.
All the MOV, LEQ, GEQ are addressed to the same integer file.
Source A in both LEQ and GEQ are the thermocouple current output, which is
compared with the setpoint value at the source B.
Setpoint for LEQ will be the lower range value and for GEQ it is the upper
range value.
• If source A < source B of the LEQ logic, then the low temp and heater
output becomes TRUE. The heater remains to ON as long as these
two conditions satisfies - Low temp output is TRUE and High temp
output is FALSE.
• Even if the Low temp output turns FALSE the heating continues until
the High temp turns TRUE. Look at the latch in the last line of the
ladder diagram.
• The heater continues to be ON until the temperature reaches the upper
range value.
• When the temperature reaches higher range value, the source A will
be equal to source B of the GEQ logic. Then the High temp becomes
TRUE.
• The heater turns OFF when the High temp becomes TRUE.
• The heater remains OFF until the temperature reaches the lower range
value. And starts again.
The cycle is repeated to maintain an average setpoint temperature.
1. Case-1
In the first case, there is no water present in the tank. So, both the sensor-1 and
sensor-2 are in their ideal status.
2. Case-2
In the second case, there is some amount of water in the tank or we can say
that the water tank is half filled up. So in this case sensor-1 detects that there is
water inside the tank, but sensor-2 is in its ideal status. There is no water at
sensor-2. It means that the tank is not filled fully with water.
3. Case-3
The third case represents that the tank is filled fully with water. There is water
at both sensor-1 and sensor-2.
In both the first and second cases, we have to give the motor to remains ON
because the tank is only partially filled with water. But in the third case, we have
to stop the motor because in this case tank is filled fully with water.
As shown in the below image, we have two sensors, Sensor1 will detect whether the
water is present in the tank and the Sensor2 will detect the tank is full of water
Example (2) in pumping station
PLC Program for Water Level Control
Logic Description:
• Auto : if Auto Mode selected in Local Control Panel, then pump will be
logically controlled based on Low Level Switch and High Level Switch
• Manual: if Manual Mode Selected in Local Control Panel, then irrespective
of Low-Level Switch & High-Level Switch Status, Pump will be controlled
manually using ON/OFF button in Local Control Panel.
• When the water level reaches low level then pump will be stopped.
• if the level of the water reaches high point, the pump will start so that the
water can be drained and thus lowering the level.
• Indication Panel: This panel contains LED’s to show the status of the
water level control. It has Pump Running, Low Level & High Level Signals
• If pump is running then the Pump Running status lamp will be ON.
• then, if Low Level Switch activated then Low-Level Status lamp will be ON.
• if High Level Switch activated then High Level Status lamp will be ON
Example (3) in heating system:
Example (1) example (2)
Example (3)
• Steps (Stages)
• Transitions
• Actions.
Stages
Each stage indicates the state of the process. A step can be active or inactive.
As shown in the figure below, a transition not only can have one input step
and one output step but also can have more input steps and more output
steps, connected by the directed links.
These sequential flow chart diagrams show the stages in sequential order
and are widely used to present algorithms, workflow, or process flow.
Typically, a sequential flow chart displays the steps as charts of various kinds.
Their order is established by connecting them with lines.
Each stage is identified with a number that must be unique and not it must
necessarily keep an order consistent with the sequence of the process.
Transitions
In between two steps, a transition is a step represented by a horizontal line
across a vertical line. It is containing the logic condition allowing the transfer
from one step to another.
Actions
The actions associated with the stages are represented by a rectangle sidebox
where the type of action to be carried out is indicated (only the active ones). A
stage can have one or more actions associated with it.
The process is broken down into stages, which will be activated sequentially.
One or more actions are associated with each stage. These actions will only be
active when the stage is active.
Program operation
Sequential Flow Chart (SFC) steps are connected with each other same as
the flow chart. SFC is conducive to Boolean operation AND or OR decisions.
AND decisions are simply placed in series and OR decisions are placed in
parallel.
• Symbolic and
• Literal
Between stage and stage, there must be a transition. The Transition conditions
are written to the right of the line that joins them. There may be a jump or step
backward seen same as flow charts.
•Off-delay
A off-delay (TOF) timer is a PLC programming instruction which use to switch off the
output or system after a certain amount of time. See here, a basic structure of AB PLC
Off delay timer programming instruction. In PLC programming, when the off-delay timer
is energized (True), it immediately turns ‘on’ its output.
•Retentive on-delay
In delay timer
When the restart signal is interrupted, the timer returns to its value,
catches it, and the output state returns to its state
When the timer starts, the image is opened. When RLO is turned on, the
timer takes its points at their origin and stops output Q.
If the signal is played on R, the timer will take its points to their origin and
stop running directly at the same moment
stored in the delay timer
That is, when the signal is turned on at S, he puts it on the screen and
then turns on the Q output, and if the signal is turned off at S, the timer
does not stop counting
pulse timer
When the output starts, the time starts, the schedule, with the help of, it
shuts it down at the right moment, it turns it off, it prints it stops the
output x
It studies the time it starts at the right time, at the right time, at the right
time, and sets it up and plugs in to stop the output Q
These are the blocks that are used as a counter in PLC ladder logic. All counter blocks
have some inputs and some outputs.
Inputs,
• CU – Count Up Input
• CD – Count Down Input
• S – Set Input for presetting counter
• PV – Value for presetting counter
• R – Reset Input
Outputs,
• Q – Status of Counter
• CV – Current counter value
• CV_BCD – Current counter value in BCD coded
Up Counter(S_CU)
For each pulse at Count Up(CU) bit, the current Counter Value(CV) will be increased by
1. When there is a pulse at Set input(S), it will set Presetting Value(PV) at the current
Counter Value(CV).
When there is a pulse at Reset input(R), the counter block will get reset and the current
counter value is set at 0 again.
Example,
There is an indicating alarm when the production limit reaches 100.
Down Counter(S_CD)
For each pulse at Count Down (CD) bit, the current Counter Value (CV) will be
decreased by 1. When there is a pulse at Set input(S), it will set Presetting Value (PV)
at the current Counter Value(CV).
When there is a pulse at Reset input(R), the counter block will get reset and the current
counter value is set at 0 again.
Example,
There is an alarm showing that the production limit has reached below 10.
Up Down Counter(S_CUD)
This block has both the count up and count down functions.
At each pulse at Count Up(CU) bit, it will increase the current Counter Value(CV), and
each pulse at Count Down(CD) bit, will decrease the current Counter Value(CV).
When there is a pulse at the Set input(S), it will set Presetting Value(PV) at the current
Counter Value(CV).
When there is a pulse at Reset input(R), the counter block will get reset and the current
Counter value is set at 0 again.
Example,
Suppose there is a limit of 50 vehicles in a parking lot. So it will show the vacant
positions and parking full indicator.
Subroutine instructions
There are two main instructions used for calling a subroutine and returning to the
calling routine. Figure 4 shows the network rung that calls a subroutine called
“Auto Mode”. It is going to call the subroutine at any time when the “System OK”
memory contact MB180 is true. So I hope you can feel now how your program is
more organized and readable when you go through the main program and easily
can catch what the program does by reading the names of the called subroutines.
Exactly, having a meaningful name for subroutines is very important to give the
advantage of the readability of your program. So, my friends please make sure
you chose a purposeful name for your subroutines.