Programmable Logic Controller
Programmable Logic Controller
Memory organisation:
The term processor memory organisation refers to how certain areas of memory in a given PLC are used.
Not all PLC manufacturers organize PLC memories in the same way. Although they do not all use the same
memory makeup and terminology, the principles involved are the same.
Fig shows an illustration of the Allen-bradley PLC-2 memory organisation known as a memory map. Every
PLC has a memory map, but it may not be like the one illustrated. The memory space can be divided into
two broad categories: the user program and the data table.
The user program is where the logic ladder program is entered and stored. The user program is entered
and stored. The user program will account for most of the total memory of a given PLC system. It contains
the logic that controls the machine operation. This logic consists of instructions that are programmed in
ladder logic format. Most instructions require one word of memory.
The data tables stores the information needed to carry out the user program. This includes information
such as the status of input and output devices, timer and counter values, data storage, and so on. Contents
of the data table can be divided into two categories: status data and numbers or codes. Status is on/off
type of information represented by 1s and 0s, stored in unique bit locations. Number or code information
is represented by groups of bits.
A processor files is the collection of program files and data files created under a particular processor file
name.
Program files
Program files are the areas of processor memory where ladder logic programing is stored. They may
include:
System functions(file 0)-this file is always included and contain various system related information and
user-programmed information such as processor type, i/o configuration, processor file name, and
password
Reserved(file1)-this file is reserved by the processor and is not accessible to the user.
Main ladder program(file2)-this file is always included and contains user programmed instructions that
define how the controller is to operate.
Sub –rountine ladder program(file3-255)-these files are user-created and are activated according to
subroutine instructions residing in the main ladder program file.
Data files
The data file portion of the processor’s memory stores input and output status, processor status, the
status of various bits, and numerical data. All this information is accessed via the ladder logic program.
These files are organized by the type of data they contain and may include:
Output (file0)-this files stores the state of the output terminals for the controller.
Input(file1)-this file stores the status of input terminals for the controller.
Status(file2)-this files stores controller operation information. This file is useful for troubleshooting
controller and program operation.
Bit(file3)-this file is used for internal relay logic storage.
Timer(file4)-this file stores the timer accumulated and preset values and status bits.
Counter(file5)-this file stores the counter accumulated and preset values and status bits.
Control(file6)-this file stores the length, pointer position, and status bit for specific instructions such as
shift registers and sequencers.
Integer(file7)-this file is used to store numerical values or bit information.
Reversed(file8)-this file is not accessible to the user.
Network communications(file9)-this file is used for network communications if installed or used like
files 10-255.
User-defined(files10-255)-this files are user-defined as bit, timer, counter, control, and/or integer data
storage.
PLC Scan:-
Processor scanning
PLC scan is a sequential process in which the PLC processor performs specific duties on a cyclic Basis.
During its operation, the CPU completes three processes:
I) reads the input data from the field devices via the input interfaces
Ii) executes the control program stored in the memory system
Iii) writes the output devices via the output interfaces.
This process of sequentially reading the inputs, executing the program in memory, and updating the
outputs is known as scanning. Figure illustrates a graphic representation of a scan.
Input scan: during the input scan, the CPU scans each input module for the on or off states of
each of the associated input points. The on (or) off input states are stored in the input status
file.
Program file: after the input are read and stored in the input status file, the processor will use this
information to solve the ladder program. The processor scans the user program starting at rung zero at the
left power rail, working left to right, and evaluating one instruction at a time until the output instruction is
reached. The output status is the logical resultant of the solving input logic for that rung. The logical one
or zero output status is placed in the output status file. When the rung zero is completed, the processors
goes on the rung one, rung two, rung three, and soon, sequentially, to the last rung of ladder logic is
executed, there is one additional rung in the program. This last rung is automatically inserted by the
software. The last rung is the “end rung”. The end rung alerts the CPU that it has reached the end of the
ladder program. Most PLC CPU’s solve the user logic in this manner. This time it takes for the CPU to scan
the user program varies depending on which instructions are used and the on or off status of the
instruction. With some PLC’s if they determine a rung has no change of becoming true during the current
scan, they will skip over the remaining instructions on that particular rung and evaluate it as false. This
procedure is used to speed up the processor scan time.
Output scan: This output scan is the functions where the CPU writes the on or off status, one word at a
time, to the associated output module. Each output status word is made up of on or off electrical signals
for each module output point latches it’s on or off signal into its electrical hardware to keep the output in
the proper status until the next output scans sends an update. The time it takes to read an input, solve the
user program, and turn on or off the corresponding output is called the system through put.
PLC programming language refers to the method by which the user communicates information to
the PLC.
Ladder Diagram:-
Ladder diagram language is the most commonly used PLC language and is designed to mimic
hardwired relay logic.
Functional block diagram programming uses instructions that are programmed as blocks wired
together to accomplish certain functions.
Instruction list programming language consists of a series of instructions that refer to the basic
AND, OR, and NOT logic gate functions.
Equivalent inst
ruction
Hardwired relay
list program
control circuit
Modes of Operation:
A processor has basically two modes of operation: the program mode and some variation of the run mode.
The number of different operating modes and the method of accessing them varies with the manufacturer.
Run Mode:
Places the processor in the RUN mode.
Executes the ladder program and energizes output devices.
Prevents online program editing.
PROG Mode:
Places the processor in the program mode.
Allows you to perform program entry and editing.
Prevents the processor from scanning or executing the ladder program.
TEST Mode:
The test mode is used to operate or monitor the user program without energizing any outputs.
Remote Mode:
The Remote position allows the PLC to be remotely changed between program and run mode by a
personal computer connected to the PLC processor. The remote mode may be beneficial when the
controller is in a location that is not easily accessible.
The program symbols for a plc input will look like a normal open or normally closed contact used in
typical electrical diagrams the symbols are as shown in table
The real world switches are connected to the inputs terminal and the output relay and contact are
connected to the output terminals of the plc
The input and output terminals are grouped together and placed in modules. Each of the manufactures
produce s a variety of input and output modules. Since the programmable controller may have hundreds
of inputs or outputs modules, it is important to have some kind of numbering system to identify each
module and all its input and output terminals
The generalised identification numbering system of input and output terminals of plc consist of the
following parameters:
Input /output \-module number - rack number – slot number – word number- terminal number
Following this generalised numbering system, manufactures prepare their own system. The allen baradly
numbering system is y:e.s/b. the meaning of each character has been shown in table
Y : e . s / b
Y=0 Element Slot number (decimal) Word Word number Bit Terminal
For output delimiter Slot 0, Adjacent to the power Delimiter. required if the delimiter number,
terminal supply in the first classis, Required only number of inputs inputs
Y= 1 for applies to the processor if a word or outputs 0-15
input module (CPU). number is exceeds 16 for the outputs 0-
terminals Succeeding slot are I/O slots, necessary slot range 0-255 15
Numbered from 1 to a
maximum of 30.
EQUIVALENT LADDER DIAGRAM:-
Multiplexer:-
If the instruction memory bit is a 1 (true) this instruction will allow rung continuity through itself, like a
closed relay contact.
XIO
The Examine If Open (XIO) instruction looks and operates like a normally closed relay contact.
This instruction asks the PLC’s processor to examine if the contact is open.
It does this by examining the bit at the memory location specified by the address for a 0 or 1.
As with any other input the memory bit is set to 1 or 0 depending on the status of the input. A 1
corresponds to a true status or on condition.
The instruction is interpreted as false when the bit is 1 and will not allow rung continuity through itself.
Figure 7-2 shows the construction of an on-delay pneumatic (air) timer. The time-delay function
depends on the transfer of air through a restricted orifice. The time-delay period is adjusted by
positioning the needle valve to vary the amount of orifice restriction. When the coil is energized, the
timed contacts are delayed from opening or closing. However, when the coil is de- energized, the
timed contacts return instantaneously to their normal state. This particular pneumatic timer has
1
instantaneous contacts in addition to timed contacts. The instantaneous contacts change state as
soon as the timer coil is powered while the delayed contacts change state at the end of the time
delay. Instantaneous contacts are often used as holding or sealing contacts in a control circuit.
Mechanical timing relays provide time delay through two arrangements. The first arrangement, on
delay, provides time delay when the relay coil is energized. The second arrangement, off delay,
provides time delay when the relay coil is de-energized.
PLC TIMER:
All PLCs have timer instructions. Even though each manufacturer may represent timers differently on
the ladder diagram, most timers operate in the same manner. A timer consists of the following parts:
timer address, preset value, time base and accumulated value.One outstanding feature of
programmable timer is the variety of time base available. Most PLCs offer two or three time bases.
The most common time base are 0.01 sec, 0.1 sec and 1sec. intervals.
TIMER ELEMENT:
A timer instruction is one element. A timer element is made up of 16-bit words.
2
Word zero contains the three status bits, EN, TT, and DN (status bits will be covered as we
introduce each timer instructions).
Word one is for the preset value.
Word two is for the accumulated value.
EN TT DN Reserved Bits
Preset Value
Accumulated Value
ENABLE(EN)BIT:
The enable bit is true (has a status of1) whenever the timer instruction is true, When the timer
instruction is false, the enable bit is false (has a status of 0).
TIMER-TIMIMNG(TT)BIT:
The timer-timing bit is true whenever the accumulated value of the timer is changing, which means
the timer is timing, When the timer is not timing, the accumulated value is not changing, so the
timer-timing bit is false.
DONE(DN)BIT:
The done bit changes state whenever the accumulated value reaches the preset value. Its state
depends on the type of timer being used.
PRESET VALUE: (PRE)
The preset value specifies the value that the counter must count to before it changes the state of the
done bit. The preset value is the set point of the counter and ranges from -32,768 to +32,768.
ACCUMULATED VALUE: (ACC)
It is the current count based on the number of times the rung goes from false to true. It can also
range from -32,768 to +32,768
TIMER NUMBER:
This number must come from the timer file. In the example shown, the timer number is T4:0, which
represents timer file 4, timer 0 in that file. There may be up to 1000 timers in each timer file,
numbered from 0 through 999. The timer address must be unique for this timer and may not be used
for any other timer.
TIME BASE:
The time base (which is always ex- pressed in seconds) may be either 1.0 s or 0.01 s. In the example
shown, the time base is 1.0 s.
ON-DELAY TIMER
3
an enable output coil (EN)
a done output coil (DN)
A timer ON-delay instruction energizes its done output (DN) after the timer block’s input
turns on and a specified delay has occurred.
This instruction is sometimes called a timer ON-delay energize instruction.
When the timer block’s input has logic continuity, the block’s enable output (EN) will turn on.
As a result, a 1 will be stored in bit 15 of the timer’s control word.
Once the timer is enabled, it will start to time. Thus, a 1 will be stored in bit 14, which is the
timer timing bit.
• As the timer times, the accumulated value increases until it equals the preset value. At that
point, the timer timing bit (TT) will become a 0, and the done bit (DN) will become a 1,
meaning that the done output (DN) will turn on.
• This done output (DN) is the timer’s delay action contact.
• The length of the time delay can be adjusted by changing the preset value.
Sequence of operation:
1. When the input I:0.0/0 is closed, it will cause the timer’s enable output (EN) to turn ON.
2. At the same time the timer starts counting and counts until the accumulated value equals the
preset value.
3. For example the preset time for this timer is 4 seconds.
4
M SCHEME_33072 COURSE MATERIAL 57
4. When the accumulated value reaches 4 seconds, the done bit (DN) goes from false to true
and timer timing bit (TT) goes from true to false and causing the output coil O:0/0 to turn
on.
5. When input I:0.0/0 goes false, the timer instruction goes false and also resets, at which time
the control bits are all reset and the accumulated value resets to 0.
Sequence of Operation:
1. The done output (DN) will be off when the program is first started and the timer’s input is off.
2. When the input logic turns on, both the block’s enable output (EN) and done output (DN) will
turn on. However, the timer will not start timing because it is waiting for an OFF signal instead
of an ON signal
3. When the block’s input turns off, the enable output will turn off and the timer will start timing.
The done output will stay on because it is waiting for the timer to time out before it will turn
off.
4. Once the accumulated value equals the preset value, the timer will stop timing and the done
output (DN) will turn off, implementing the OFF-delay de-energize function.
5
5. This done output (DN) is the timer’s delay action contact.
6. The length of the time delay can be adjusted by changing the preset value.
Retentive Timer Instruction:
Retentive Timer ON : (RTO)
A retentive timer instruction operates much like a timer ON-delay instruction. A retentive timer,
however, can stop timing and then start timing again without its accumulated value resetting to 0
When the input logic turns on, the enable output will turn on, and the timer will start timing.
If the input logic turns off, the enable output will turn off, and the timer will stop timing.
The accumulated value, however, will not reset to 0.
When the timer starts timing again, it will pick up where it left off.
When the accumulated value finally reaches the preset value, the done output will turn on.
Once a retentive timer has timed out, its done output will remain on even if its input logic and
enable output turn off.
A reset instruction must be used to turn the done output off and reset the timer’s
accumulated value.
The RES instruction has the same address as the timer it is to reset.
MECHANICAL COUNTER
Programmed counters can serve the same function as mechanical counters. Figure shows the
Construction of a simple mechanical counter. Every time the actuating lever is moved over, the counter
adds one number; the actuating lever then returns automatically to its original position.
Resetting to zero is done with a pushbutton located on the side of the unit.
6
COUNTER INSTRUCTION:
Counter instructions are output instructions.
Counter instructions are programming instructions that replace the need for electromechanical
counter.
A counter instruction has two values associated with it:
the preset value
the accumulated value
The preset value specifies the target number of counts, while the accumulated value indicates
the actual number of counts that have already occurred.
In a counter, the preset and accumulated values always increase or decrease in increments of
one.
Each Allen-Bradley PLC 5 and SLC 500 counter instruction occupies three memory word
locations in the C5 counter data file.
These three data words are the control word, preset word and accumulated word.
Control word:
Count-down Enable bit: The countdown enable bit is used with the countdown counter and is true
whenever the countdown instruction is true.
7
Done bit (DN) : The done bit is true whenever the accumulated value is equal to
or greater than the preset value of the counter.
Overflow bit (OV) : The overflow bit is true whenever the counter counts past its
maximum value which is 32,767.
Underflow bitt (UV) : The underflow bit will go true when the counter counts
below -32768.
Preset Value: (PRE)
The preset value specifies the value that the counter must count to before it
changes the state of the done bit. The preset value is the set point of the counter
and ranges from -32,768 to +32,768.
Accumulated value: (ACC)
It is the current count based on the number of times the rung goes from false to
true. It can also ranges from -32,768 to +32,768.
UP COUNTER:
Up-counters perform a counting function when the associated input element transitions from an OFF
to ON state. Up-counters begin at some preset value and increment upward. Up counters are
retentive and require an associated
reset element to clear the counted values.
8
The done output will remain on as long as the accumulated count is greater than or equal to the
preset count.
The only way to reset the accumulated value and turn off the done output is to use a reset
instruction.
9
DOWN COUNTER:
Down-counters perform a counting function when the associated input element transitions from an
OFF to ON state. Down-counters begin at some preset value and decrement downward. Down
counters are retentive and require an associated reset element to clear the counted values.
A count down instruction decreases its accumulated value by one every time the block’s
input makes an OFF-to-ON transition.
When the accumulated value becomes less than the preset value, the count down instruction
de-energizes its output.
When the counter’s accumulated value is greater than or equal to its preset value, the
counter’s output will be on.
A count down instruction also has two outputs:
a countdown output : which indicates that the counter is energized
a done output : which signals that the target count value has been reached.
Example:
In this circuit, the countdown block’s done output will already be on because the
accumulated value is greater than the preset value.
10
When the block’s input I0.0/0 is turns from OFF to ON, the accumulated value will decrease to
3.
When the block’s input makes this OFF-to-ON transition again, the accumulated value will
decrease to 2.
When the input makes one more OFF-to-ON transition, the accumulated value will drop to
less than the preset value and the done output will turn off, deenergizing the done output
C5:2/DN and output O:0/0.
The CTD instruction requires the RES instruction to reset its accumulated value and status
bits.
ADD instruction used with the SLC 500 controllers. The operation of the logic rung can be
summarized as follows:
• When input switch SW is closed the rung will be true.
11
• The value stored at the source A address, N7:0 (25), is added to the value stored at the source B
address, N7:1 (50).
• The answer (75) is stored at the destination address N7:2.
• Source A and source B can be either values or addresses that contain values, but A and B cannot
both be constants.
The program of Figure 11-4 illustrates how the ADD instruction can be used to add the accumulated
counts of two up-counters. This application requires a pilot light to come on when the sum of the
counts from the two counters is equal to or greater than 350. The operation of the program can be
summarized as follows:
• Source A of the ADD instruction is addressed to store the accumulated value of counter C5:0.
• Source B of the ADD instruction is addressed to store the accumulated value of counter C5:1.
• The value at source A is added to the value at source B, and the result (answer) is stored at
destination address N7:1.
• Source A of the GEQ (greater than or equal) instruction is addressed to store the value of the
destination address N7:1.
• Source B of the GEQ instruction contains the constant value of 350.
• The GEQ instruction and PL1 output will be true whenever the accumulated values in the two
counters are equal to or greater than the constant value 350.
• A reset button is provided to reset the accumulated count of both counters to zero.
When performing math functions, care must be taken to ensure that values remain in the range that
the data table or fi le can store; otherwise, the overflow bit will be set. The arithmetic status bits for
the SLC 500 controller are found in word 0, bits 0 to 3 of the processor status fi le S2 (Figure:11-5 ).
12
After an instruction is executed, the arithmetic status bits in the status fi le are updated. The
description of each bit can be summarized as follows:
0/0, is set to 1 when there is a carry in the ADD instruction or a borrow in the SUB instruction.
0/1is set to 1 when the result is too large to fi t in the destination register.
13
The count-up enable bit is used with the count-up counter and is true when- ever the count-up
counter instruction is true. If the count-up counter instruction is false, the CU bit is false.
Counter Number
This number must come from the counter ile. In the example shown, the counter number is C5:0,
which
represents counter file 5, counter 0 in that file. There may be up to 1000 counters, numbered from 0
through 999, in each counter file. The address for this counter should not be used for any other
count-up counter.
Preset Value
The preset value can range from -32,768 to +32,767. In the example shown, the preset value is 10.
Accumulated Value
The accumulated value can also range from-32,768 through +32,767. Typically, as in this example,
the value entered in the accumulated word is-0, Regardless of what value as entered, 2 the reset
instruction will reset the accumulated value to/0
ADVANCED INTRUCTIONS:
ADDITION INSTRUCTION:
14
The add instruction performs the addition of two values stored in the referenced memory locations.
How these values are accessed depends on the controller.
Allen-Bradley PLU-s and SLC500 controllers use a block-formatted ADD instruction for addition.
Figure 11-2 shows an example of the ADD instruction. In this example, when the rung is true, the
value stored at the source A address, N7:0 (25), is added to the value stored at the source B
addresss,N7:1(50),and the answer (75) is stored at the destination address,N7:2 source A and source
B can be either values or address that contain value uses; however, source a and source B cannot
both be constants.
15
the program of Figure 11-3 on page 306 shows how the ADD instruction can be used to add the
accumulated counts of two up-counters. This application requires a light to come on when the sum
of the counts from the two counters is equal to or greater than 350.Source A of the ADD instruction
is addressed to store the accumulated value of counter C5:0, and source B is addressed to store the
accumulated value of counter C5:1. The value at source A is added to the value at source B, and the
result (answer) is stored at destination address N7:1. Source A of the greater than or equal
instruction is addressed to store the value of the destination address N7, whereas source B contains
the constant value of 350.Therefore, the greater than or equal in Struction will be logic true
whenever the accumulated values in the two counters are equal to or greater than the constant
value 350 A reset button is provided to reset the
accumulated count of both counters to 9
When performing math functions, care must be taken to ensure that values remain in the range that
the data table or file can store; other- wise, the overflow bit will be set. For example, with the Allen-
Bradley PLC-5 controller, you cannot store a value larger than 32,767 at an integer address.
16
SUBTRACTION INSTRUCTION:
The subtract (SUB) instruction is an output Instruction that subtracts one value from another and
stores the result in the destination address. When rung conditions are true, the subtract instruction
subtracts source B from source A and stores the result in the destination.
Figure 11-4 on page 306, shows an example of the block-formatted SUB instruction used as part of
the Allen-Bradley PLC-5 and SLC-500 Controllers instruction set. In this example,
when the rung is true, the value stored at the source B address, N7:05 (322), is subtracted from the
value stored at the source A address, N7:10 (520), and the answer (198) is stored at the destination
address, N7:20, Source A and source B can be either values Or addresses that contain values;
however, source A and source B cannot both be constants.
17
The program of Figure 11-5 shows how the SUB function can be used to indicate a vessel overfill
condition. This application requires an alarm to sound when a supply system leaks 5 lb or more of
raw material into the vessel after a weight of 500 1b has been reached. When the start button is
pressed, the fill solenoid (rung 1) and filling indicating light (rung 2) are turned on and raw material is
allowed to flow into the vessel. The vessel has its weight monitored continuously by the PLC program
(rung 3) as it fills. When the weight reaches 500 1b, the fill solenoid is de- energized and the flow 1s
Cut off. At the same time, the filling pilot light indicator is turned off and the full pilot light indicator
(rung 3) is turned on. Should the fill solenoid leak 5 lb or more of raw material into the vessel, the
alarm (rung 5) will energize and stay energized until the overflow level is reduced be-low the 5-Ib
overflow limit.
MULTIPLICATION INSTRUCTION:
The multiply (MUL) instruction is an output instruction that multiplies two values and stores the
result in the destination address. Figure 11-6 on page 308 shows an example of the MUL instruction.
In this example, the data in source A (the constant 20) will be multiplied by the data in source B (the
accumulated value of counter C5:10), with the result being placed in the destination N7:2. Like in
previous math instructions, source A and B in multiplication instructions can be values (constants) or
addresses that contain values.
18
Figure 11-7 shows a simple MUL program. When input A is true, the value stored in source A, address
N7:1 (123), is multiplied by the value stored in source B, address N7:2[61), and the product (7503) 1s
placed into destination word N7:3. As a result, the equal instruction becomes true, turning output
PL1 on.
Figure 11-8 shows how the Allen-Bradley PLC-5 and SLC-500 MUL instruction is used as part of an
oven temperature control program.
In this program, the PLC calculates the and lower deadband, or off/on limits, about the set point. The
upper and lower limits set automatically at 17o regardless of the Sot point value. The set-point
temperature is adjusted by means of the thumbwheel switch. An analog thermocouple interface
module is used to monitor the current temperature of the oven. In this example, the set-point
temperature is 400°F. Therefore, the electric heaters will be turned on when the temperature of the
oven drops to less than 396°F and stay on until the temperature rises above 404 °F. If the set point is
changed to 100°F, the deadband remains at t (+-1) %, with the lower limit being 99°F and the upper
limit being 101°F. The number stored m Word N7:1 represents the upper temperature limit, and the
number stored in word N7:2 represents the lower limit.
DIVISION INSTRUCTION:
19
(The divide (DIV) instruction divides the value in source A by the value in source B and stores the
result in the destination and math register. If the remainder is 0.5 or greater, a roundup occurs in the
integer destination. The value stored in the math register Consists of the unrounded quotient (placed
in the most significant word) and the remainder (placed in the least significant word). Some larger
PLCs support the use of floating-decimal as well as integer values. As an example, 10 divided by 3
may be expressed as 3.333333 (floating-decimal notation) or 3 with a remainder of 1. Figure 11-9
shows an example of the DIV instruction. In this example, the data in source A (the accumulated
value of counter C5:10) will be divided by the data in source B (the constant 2), with the result being
placed in the destination N7:3.
20
(Figure 11-10 shows a simple DIV program. When input A is true, the value stored in source A,
address N7:0 (120), is divided by the value stored in source B, address N7:1 (4) and the answer, 30, is
placed in the destination address N7:5. As a result, the equal instruction will be true, and output PL1
will be switched on
Figure 11-11 shows how the DIV function is used as part of a program to convert Celsius temperature
to Fahrenheit. In this application, the thumbwheel switch connected to the input module indicates
Celsius temperature The program is designed to convert recorded Celsius temperature in the data
table to Fahrenheit values for display The data formula forms the basis for the program. In this
example, a current temperature reading of 60°C is assumed. The MUL instruction multiplies the
temperature (60°C) by 9 and stores the product (540) in address N7:0. Next, the DIV instruction
divides 5 into the 540 and stores the answer (108) in address N7:1. Finally, the ADD instruction adds
32 to the value of 108 and stores the sum (140 in address O:13 Thus 60°C = 140°F.
AND function:
An AND gate is a device with two or more inputs and one output.
The AND gate output is 1 only if all inputs are 1.
In Practical application, when push button PB1 and PB2 are operated, the alarm gives sound.
21
The AND gate operates like a series circuit that produces an output voltage when a voltage
OR function:
An OR gate can have any number of inputs but only one output.
The OR gate output is 1 if one or more inputs are 1.
In Practical application, when either PB1 or PB2 is operated, the alarm gives sound.
The OR gate is essentially a parallel circuit that produces an output voltage when a voltage
appears at any input.
22
NOT function:
23
Theory:
The Star Delta Starter is a very common type of starter and is used extensively as compared to the
other type of starting methods of the induction motor. A star delta is used for a cage motor designed
to run normally on the delta connected stator winding. The connection of a three-phase induction
motor with a star delta starter is shown in the figure.
When the switch is in the START position, the stator windings are connected in the star as shown
figure.When the motor picks up the speed, about 80 percent of its rated speed, the switch is
immediately put into the RUN position. As a result, a stator winding which was in star connection is
changed into DELTA connection. Firstly, the stator winding is connected in star and then in Delta so
that the starting line current of the motor is reduced to one-third as compared to the starting current
with the windings connected in delta. At the starting of an induction motor when the windings of the
stator are star connected, each stator phase gets a voltage VL/√3. Here VL is the line voltage. Since
the developed torque is proportional to the square of the voltage applied to an induction motor. Star
delta starter reduces the starting torque to one-third that is obtained by direct delta starting.
24
FULLY AUTOMATIC STAR DELTA STARTER LADDER DIAGRAM
25
CONTROL DIGRAM FOR FORWARD AND REVERSE OPERATION
26
CONTROL DIAGRAM FOR JOGGING AND INCHING
The common usage of the word ‘Jogging’ in our daily life is for slow running. ‘Jogging’ or ‘inching’ of a
motor also implies the same i.e., to have small movements of the driven machine. In jogging, starting
and stopping of a motor is under the direct control of the operator. The primary objective of jogging
is generally, to move tools, equipment or processed material into position very slowly. A simple
control circuit that provides for jogging in one direction only has been shown in Fig In the control
circuit, when JOG-push button is pressed, the contact A opens while contact B closes. Contactor M is
energized due to closing of contact B and makes the motor run with all the accelerating resistors in
the armature circuit (refer Fig.4.1). Due to presence of high resistance in the armature circuit the
motor runs at a slow speed. Accelerating relays and the contactor circuit are not energized during
this operation thus making the motor run at slow speed till such time the JOG-push button is held
pressed. When normal operation of motor is required the START-push button is pressed. The control
relay CR gets energized and is held through its own contact CR1. Contactor M also gets energized and
is held through contact CR2 . Accelerating relays and contactor circuit also gets energized through
closing contact CR3. Accelerating relays and contactors as discussed earlier will cut off the
accelerating resistances in the armature circuit step by step and the motor would attain its final
speed.
27
push button and normally closed (NC) contact F2. If the motor is to be brought to rest the STOP-bush
button has to be pressed.
Limit Test:
Tests whether one value is within the limit range of two other values.
28
(MEQ) Masked comparison for equal:
If the data at the source address match the data at the compare address bit-by-bit, the instruction is
true, otherwise it is logically false.
(EQU) Equal:
It is an input instruction that compares source A to source B. When source A is equal to source B, the
instruction is logically true; otherwise it is logically false.
(LES)Less than:
It is an input instruction that compares source A to source B. When source A is less than source B, the
instruction is logically true; otherwise it is logically false.
29
(GRT)Greater than:
It is an input instruction that compares source A to source B. When source A is greater than source B,
the instruction is logically true; otherwise it is logically false.
A human machine interface (HMI) can be connected to communicate with a PLC and to replace
pushbuttons, selector switches, pilot lights, thumbwheels, and other operator control panel devices
(Figure 2-49). Luminescent touch-screen keypads provide an operator interface that operates like
traditional hardwired control panels. Human machine interfaces give the ability to the operator and
to management to view the operation in real. This device consists of three modular parts: an HMI,
processor/power supply, and I/O modules.
30
The display/keypad can be used as an operator interface or can be linked to control operations to
provide real time feedback. It has the ability to show text, date and time, as well as custom messages
and bitmap graphics, allowing operators to acknowledge fault messages, enter values, and initiate
actions. Users can create both the control program and HMI functionality using a personal computer
with Pico-Soft Pro software installed or the controller’s on-board display buttons.
A human machine interface (HMI) can be connected to communicate with a PLC and to replace
pushbuttons, selector switches, pilot lights, thumbwheels, and other operator control panel devices
(Figure). Luminescent touch-screen keypads provide an operator interface that operates like
traditional hardwired control panels. Human machine interfaces give the ability to the operator and to
management to view the operation in real time. Through personal computer–based setup software,
you can confi gure display screens to:
• Replace hardwired pushbuttons and pilot lights with realistic-looking icons. The machine operator
need only touch the display panel to activate the pushbuttons.
31
The bit shift register shifts bits serially (from bit to bit)
through an array in an orderly fashion.
A shift register can be used to simulate the movement,
or track the fl ow, of parts and information. We use the
shift register whenever we need to store the status of an
event so that we can act on it at a later time. Shift registers
can shift either status or values through data fi les. Common
applications for shift registers include the following:
• Tracking of parts through an assembly line
• Controlling of machine or process operations
32
File —The address of the bit array you want to manipulate.
The address must start with the # sign and at bit
0 of the fi rst word or element. Any remaining bits in
the last word of the array cannot be used elsewhere in
the program because the instruction invalidates them.
Control —R data-table type. The address is unique to
the instruction and cannot be used to control any other
instruction. It is a three-word element that consists of
the status word, the length, and the position.
Bit address —Is the address of the source bit. The instruction
inserts the status of this bit in either the fi rst (lowest)
bit position (for the BSL instruction) or the last (highest)
bit position (for the BSR instruction) in the array.
Length —Indicates the number of bits to be shifted,
or the fi le length, in bits. The status bits of the control
word are the enable, done, error, and unload bits.
33
Their functions can be summarized as follows:
- E nable Bit (EN) —The enable bit follows the instructions
status and is set to 1 when the instruction is true.
- D one Bit (DN) —The done bit is set to 1 when the
instruction has shifted all bits in the fi le one position.
It resets to 0 when the instruction goes false.
- E rror Bit (ER) —The error bit is set to 1 when the
instruction has detected an error, which can happen
when a negative number is entered in the length.
- U nload Bit (UL) —The unload bit’s status is controlled
by shifting of the last bit of the fi le into the unload
bit when the instruction is executed. It is the bit
location into which the status from the last bit in the
fi le shifts when the instruction goes from false to true.
When the next shift occurs, these data are lost, unless
additional programming is done to retain the data.
BSR (Bit Shift Right) —Loads a bit of data into a bit
array, shifts the pattern of data through the array to the
right, and unloads the last bit of data in the array.
34
Logical Functions [And, Or, Compliment]
AND Instruction:
35
Figure 4-24 illustrates the operation of the AND instruction to perform a word-level AND operation
using
the bits in the two source addresses. This instruction tells the processor to perform an AND operation
on B3:5 and B3:7 and to store the result in destination B3:10 when input device A is true. The
destination bits are a result of the logical AND operation.
OR Instruction:
Figure 4-25 illustrates the operation of a word-level OR instruction, which ORs the data in Source A,
bit by
bit, with the data in Source B and stores the result at the destination address. The address of Source
A is B3:1,
the address of Source B is B3:2, and the destination address is B3:20. The instruction may be
programmed
conditionally, with input instruction(s) preceding it, or unconditionally, as shown, without any input
instructions
preceding it.
NOT Instruction:
36
Figure 4-27 illustrates the operation of a word-level NOT instruction. This instruction inverts the bits
from the
source word to the destination word. The bit pattern in B3:10 is the result of the instruction being true
and is the
inverse of the bit pattern in B3:9.
37
Unit-4
Data communication:
Network Definition –
A network is a group of computers that can communicate with each other to share information.
When computers communicate with each other, they can share resources. These resources can be
data, applications or hardware. We can connect two computers together with a cable, which results in
a simple network.
Network criteria:
The major criteria that a Data Communication Network must meet are:
a. Performance
b. Consistency
c. Reliability
d. Recovery
e. Security
Types of connections:
Peer to Peer Networks(Point-to-point connection):
A peer-to-peer network is a simple type of network. Peer to Peer Network is a direct link between
two devices. It uses dedicated link between the devices. The entire capacity of the link is
used for the transmission between those two devices (file sharing, peripheral sharing etc). Peer-
to-peer networks are used mainly for small and medium LANs
Advantages:
1. Economical – No dedicated server
2. Simple installation setup
Disadvantages:
1. No central backup for files
2. Poor security
Multipoint Connection:
A multipoint connection is a link between three or more devices. It is also known as Multi-
drop configuration. The networks having multipoint configuration are called Broadcast
Networks. In broadcast network, a message or a packet sent by any machine is received by
all other machines in a network. The packet contains address field that specifies the receiver.
Upon receiving a packet, every machine checks the address field of the packet. If the
transmitted packet is for that particular machine, it processes it; otherwise it just ignores the
packet.
Topologies:
The topology of a network is the geometric representation of the relationship of all the
links and linking devices (usually called nodes) to each other.
Bus topology:
The bus topology consists of computers connected by a single cable called a backbone
as in figure below. All the computers on the bus share in its capacity. This is the simplest
method for connecting computers. In a bus environment, 10Base2 or 10Base5 cable is used,
and because all devices share the same bandwidth, the more devices, the slower the network.
In fact, it is probably not feasible for use with more than 10 workstations.
Advantages:
1. Cabling is easy to work with and extend with less cost.
2. Less cabling because all computers are in one line.
3. Layout is simple.
Disadvantages:
1. Fault isolation is difficult because one break affects the entire network.
2. One break or bad termination brings down the entire network.
3. Heavy traffic can slow it down because all machines share same bandwidth.
Star topology:
In star topology, the computers are connected to a centralized hub by a cable segment
as in figure. They require more cabling than ring or bus topologies, but each computer is
connected to the hub by its own cable. Therefore if one computer connection goes down, it
does not affect the rest of the network. Because each workstation has its own connection, it is
much easier to move them around or connect them to other networks. 10BaseT-100BaseFX
can be used a star topology. A star topology can support up to 1024 workstations, but it may
not be feasible to connect them all to the same logical network.
Advantages:
1. The entire network is not disrupted
when adding or removing computers.
2. If one computer fails, it does not affect
the rest of the network.
3. It is easy to manage and monitor.
Disadvantages:
1. It requires more cabling because each
machine needs a separate connection
to the central hub.
2. If the central hub fails, it brings down
the entire network.
Ring topology:
In ring topology, each computer connects directly to the next one in line, forming a
circle as shown in figure below. Data travels in a clockwise direction and each computer
accepts the information intended for it and passes on the information for other computers. It
uses a token, which is actually a small packet, to send information. Every computer in the
ring is responsible for either passing the token or creating a new one. Token passing uses the
token, or series of bits, to grant devicepermission to transmit over the network. When a
computer has information to send, it modifies the token and passes it on. After the token
reaches its final destination, it lets the sender know it has arrived safely, the sender then
makes a new token, and the process starts over. Most ring networks use fiber or twisted pair
as the medium.
Advantages:
1. Network performance is consistent due to token passing.
2. The length of the cable required is short.
3. Equal access is granted to all computers.
Disadvantages :
1. Unidirectional traffic.
2. If one computer fails, it brings down
the entire network.
3. The entire network is disrupted when
adding or removing computers.
Mesh topology:
In a mesh topology, all devices are connected to each other more than once to create
fault tolerance as in figure below. A single device or cable failure will not affect the
performance because the devices are connected by more than one means. This is more
expensive as it requires more hardware and cabling. This type of topology can also be found
in enterprise–wide networks with routers connected to other routers for fault tolerance.
So, a mesh topology is usually implemented in a limited fashion, for example, as a
backbone connecting the main computers of a hybrid network that can include several other
topologies.
Advantages
1. The use of dedicated links guarantees
that each connection can carry its own
data load.
2. In mesh topology, if one link becomes
unusable, it does not affect the entire
system.
3. Another advantage is privacy or
security. When every message sent
travels along a dedicated line, only the
intended recipient sees it.
4. The point-to-point links make fault
identification and fault isolation easy.
Disadvantages:
1. Because, every device must be connected to every other device, installation and
reconfiguration are difficult.
2. The sheer bulk of the wiring can be greater than the available space.
3. The hardware required to connect each link can be prohibitively expensive.
Hybrid topology:
A network that combines several other topologies as subnet works linked together in a
large topology. For instance, in star bus topology, computers are connected to hubs in a star
formation and then the hubs are connected via bus topology. Refer figure below. Although it
is more expensive to implement, longer distances can be covered and networks can be
isolated more easily.
Advantages:
1. Fault detection and trouble shooting is easy.
2. It is easy to add new devices or network.
Disadvantages:
1. It is difficult to design.
2. The hubs used to connect two different networks are very expensive
NETWORK DEVICES
1. Switches– A switch is a multi-port bridge with a buffer and a design that can boost its
efficiency (large number of ports implies less traffic) and performance. Switch is data link
layer device. Switch can perform error checking before forwarding data that makes it very
efficient as it does not forward packets that have errors and forward good packets selectively
to correct port only. In other words, switch divides collision domain of hosts, but broadcast
domain remains same.
2. Hubs – A hub is basically a multiport repeater. A hub connects multiple wires coming
from different branches, for example, the connector in star topology which connects different
stations. Hubs cannot filter data, so data packets are sent to all connected devices. In other
words, collision domain of all hosts connected through Hub remains one. Also, they do not
have intelligence to find out best path for data packets which leads to inefficiencies and
wastage.
3. Bridges – A bridge operates at data link layer. A bridge is a repeater; with add on
functionality of filtering content by reading the MAC addresses of source and destination. It
is also used for interconnecting two LANs working on the same protocol. It has a single input
and single output port, thus making it a 2 port device.
4. Routers – A router is a device like a switch that routes data packets based on their IP
addresses. Router is mainly a Network Layer device. Routers normally connect LANs and
WANs together and have a dynamically updating routing table based on which they make
decisions on routing the data packets. Router divide broadcast domains of hosts connected
through it.
Networking models:
Protocol:
A protocol is a set of rules and guidelines for communicating data. Rules are defined for each
step and process during communication between two or more computers. Networks have to
follow these rules to successfully transmit data.
Standards:
A standard provides a model for development that makes it possible for a product to
work regardless of the individual manufacturer. Standards are essential in creating and
maintaining an open and competitive market for equipment manufacturers and in
guaranteeing national and international inter-operability of data and telecommunications
technology and processes. They provide guidelines to manufacturers, vendors, government
agencies and other service providers to ensure the kind of interconnectivity necessary in
today’s market place and in international communications.
Application layer:
The application layer enables the user, whether human or software to access the
network. It provides user interfaces and support for services such as electronic mail, remote
file access and transfer, shared database management, and other types of distributed
information services.
Specific responsibilities of the application layer include the following:
Network Virtual Terminal
File transfer, access and
management
Mail services
Directory services
Presentation layer:
The presentation layer is concerned with the syntax and semantics of the information
exchanged between two systems.
Specific responsibilities of the presentation layer include the following:
Translation
Encryption
Compression
Session layer:
The services provided by the first two layers are not sufficient for some processes.
The session layer is the network dialog controller. It establishes, maintains, and synchronizes
the interaction between communicating systems.
Specific responsibilities of the session layer include the following:
Dialog control
Synchronization
Transport layer:
The transport layer is responsible for source-to-destination delivery of the entire
message. The transport layer ensures that the whole message arrives intact and in order
overseeing both error control and flow control at the source-to-destination level.
For added security, the transport layer may create a connection between the two end
ports. A connection is a single logical path between the source and destination that is
associated with all packets in a message.
Specific responsibilities of the transport layer include the following:
Service-point addressing
Segmentation and reassembly
Connection control
Flow control
Error control
Network layer:
The network layer is responsible for the source-to-destination delivery of a packet
possibly across multiple networks (links). The network layer ensures that each packet gets
from its point of origin to its final destination.
If two systems are connected to the same link, there is usually no need for a network
layer. However, if the two systems are attached to different networks, there is often a need for
the network layer to accomplish source-to-destination delivery.
Specific responsibilities of the network layer include the following:
114
Logical addressing
Routing
Data link layer:
The data link layer transforms the physical layer, a raw transmission facility to a reliable
link and is responsible for node-to-node delivery. It makes the physical layer appear error
free to the upper layer (network layer). Specific responsibilities of the data link layer includes
the following:
Framing
Physical addressing
Flow control
Error control
Access control
Physical layer:
The physical layer coordinates the functions required to transmit a bit stream over a physical
medium. It deals with the mechanical and electrical specifications of the interface and
transmission medium. It also defines the procedures and functions that physical devices and
interfaces have to perform for transmission to occur. The physical layer is concerned with the
following:
Physical characteristics of interfaces and media
Representation of bits
Data rate
Synchronization of bits
Line configuration
Physical topology
Transmission mode
Summary of layer functions:
The functions of seven layers are summarized in figure below.
TCP/IP:
The Transmission Control Protocol/Internetworking Protocol is a set or protocols or a
protocol suite that defines how all transmissions are exchanged across the internet.
TCP/IP and OSI :
TCP/IP’s implementation of the OSI model makes functionality simpler by mapping
the same seven layers of the OSI model to a four layer model. Unlike the OSI reference
model, the TCP/IP model focuses more on delivering the internet connectivity than on
functional layers. It does this by acknowledging the importance of a structured hierarchical
sequence of functions, yet leaves the protocol designers with the flexibility for
implementation. The OSI reference model is much better at explaining the mechanics of
intercomputer communications, but because TCP/IP has become the internetworking model
of choice, this model is more commonly used.
The table below compares the OSI and TCP/IP models.
Comparison of OSI reference model and TCP/IP Networking model
Application Layer: Maps to Layer 5 (Session), Layer 6 (Presentation) and Layer 7
(Application) of the OSI model. This is how applications and certain services access
the network.
Transport Layer: Maps to Layer 4 (Transport) of the OSI model. It accepts data and
segments it for transport across the network, making sure that the data is delivered
error-free and in the proper sequence.
Internet Layer: Maps to Layer 3 (Network) of the OSI model. It manages the
routing of packets that are to be forwarded on to different networks, relying on
routable protocols for delivery.
Network Access Layer: Maps to Layer 1 (physical) and Layer 2 (Data Link) of the
OSI model. It is responsible for the delivery of datagrams by creating a frame for the
network type and then sending the data to the wire.
TCP/IP is a suite of protocols and applications that enable a computer to communicate
with other computers in a network. It doesn’t matter what operating system the computers are using
as long as each system supports TCP/IP. The computers then communicate and share
information.
Socket structure
The above figure shows a simplified socket structure. The fields are discussed below:
Family : This field is used for defining the protocol group such as IPv4 or IPv6, Unix
domain protocol etc.
Type : This field is used for defining the type of socket such as stream socket, packet
socket or raw socket.
Protocol : This field is usually set to zero for TCP and UDP.
Local socket address : It is used for defining the local socket address. This address is
a combination of local IP address and the port address of the local application
program.
Remote socket address : It is used for defining the remote socket address which is a
combination of remote IP address and the port address of the remote application
program.
Interior Gateway Protocols: (IGMP, ICMP, ARP, RARP Concept only).
In the Internet model or the TCP/IP suite, there are five network layer protocols :
ARP, RARP, IP, ICMP and IGMP.
The main protocol in this layer is IP, which is responsible for host-to-host delivery of
datagram from a source to a destination. However, IP needs the services of other protocols.
IP needs a protocol called ARP to find the MAC (physical) address of the next hop.
This address must be passed to the data link layer, with the IP datagram, to be inserted into
the encapsulating frame.
During datagram delivery, IP needs the services of ICMP to handle unusual situations
such as the occurrence of an error.
IP is designed for unicast delivery, one source to destination. Multimedia and other
new applications in the Internet need multicasting delivery, one source to many destinations.
For multicasting, IP uses the services of another protocol called IGMP.
IP address:
The hosts and routers are recognized at the network level by their IP addresses. An IP
address is an internetwork address.
MAC address:
At the physical network, the hosts and routers are recognized by their MAC
addresses. A MAC address is a local address. Its jurisdiction is a local network
The delivery of a packet to a host or a router requires two levels of addressing : IP
address and MAC address. Two protocols are used to find the other address if one type of
address is known.
They are
1. Address Resolution Protocol (ARP) and
2. Reverse Address Resolution Protocol (RARP)
The ARP maps an IP address to a MAC address, whereas the RARP maps a MAC address to
an IP address.
Address Resolution Protocol (ARP):
The Address Resolution Protocol associates an IP address with the MAC address. On
a typical physical network, such as a LAN, each device on a link is identified by a physical or
station address usually imprinted on the network interface card (NIC).
137
Anytime a host or a router needs to find the physical address of another host on the
network, it sends an ARP query packet. The packet includes the physical and IP address of
the sender and the IP address of the receiver. Because the sender does not know the physical
address of the receiver, the query is broadcast over the network. See figure below.
Every host or router on the network receives and processes the ARP packet, but only
the intended recipient recognizes its internet address and sends back an ARP response packet.
The response packet contains the recipient’s IP and physical addresses. The packet is unicast
directly to the inquirer using the physical address received in the query packet.
In the figure below, the system on the left (A) has a packet that need to be delivered to
another system (B) with IP address 141.23.56.23. System A needs to pass the packet to its
data link layer for the actual delivery, but it does not know the physical address of the
recipient. It uses the services of ARP to send an ARP request packet to ask for the physical
address of a system with an IP address of 141.23.56.23.
This packet is received by every system on the physical network, but only system B
will answer it as in figure. System B sends an ARP reply packet that includes its physical
address. Now system A can send all the packets to this destination using the physical address
it received.
Reverse Address Resolution Protocol (RARP):
The Reverse Address Resolution Protocol allows a host to discover its internet
address when it knows only its physical address. A host is supposed to have its internet
address stored on its hard disk. So, this will be in the case of diskless computer or computer is
being connected to the network for the first time or a new computer with old NIC.
RARP works much like ARP. The host wising to retrieve its internet address
broadcasts an RARP query packet that contains its physical address to every host on its
physical network. A server on the network recognizes the RARP packet and returns the
host’sinternet address.
Internet Control Message Protocol (ICMP):
The Internet Protocol (IP) provides unreliable and connectionless datagram delivery.
However, it has two deficiencies : lack of error control and lack of assistance mechanisms.
IP Addressing:
In addition to the physical addresses (contained on NICs) that identify individual
devices, an identifier used in the network layer of the Internet model to identify each device
connected to the Internet is called the Internet address or IP address. An IP address in the
current version of the protocol is a 32-bit binary address that uniquely and universally defines
the connection of a host or a router to the Internet.
ClassfulAddressing :
IP addresses, when started, used the concept of classes. This architecture is called
classful addressing. In the mid 1990s, a new architecture called classless addressing was
introduced which will eventually supersede the original architecture. However most of the
Internet is still using classful addressing and the migration is slow.
In classful addressing, the IP address space is divided into five classes :
1. Class A
2. Class B
3. Class C
4. Class D
5. Class E
Each class occupies some part of the whole address space. We can find the class of an
address when the address is given in binary notation or dotted decimal notation.
Finding the class in binary notation :
If the address is given in binary notation, the first few bits can immediately tell us the
class of the address as in figure below.
Subnetting:
Subnetting is the process of dividing a given network into smaller networks. The
IP addresses are divided into two parts, the network number and the host number. For a Class
B network, you can connect 216-2 hosts on a network. In this case, if you want a small
number of hosts in a network, you will have many IP addresses left unused resulting in
inefficient usage of the IP address space. Subnetting alleviates this problem by borrowing
additional bits from the host address and using that as part of the network address. For
example, for a Class B network, you could include 8 bits out of 16 bits of the host address to
create 28-2 or 254 subnets, each having 28-2 or 254 hosts.
Figure below shows Class B IP address before subnetting and after using 8 bits of the
host address for subnetting.
Any number of bits from the host fields can be used for subnetting.
Supernetting:
The size of a class C block with a maximum number of 256 addresses may not satisfy
the needs of an organization. Even, a mid size organization may need more addresses.
One solution is supernetting. In supernetting, an organization can combine several
class C blocks to create a larger range of addresses. In other words, several networks are
combined to create a supernetwork. By doing this, an organization can apply for a set of class
C blocks instead of just one. For example, an organization that needs 1000 addresses can be
granted four class C blocks. The organization can then use these addresses in one
supernetwork as in figure below.
VLSM technique-(IPv6):
Devices on the Internet are assigned a unique IP address for identification and location
definition. With the rapid growth of the Internet after commercialization in the 1990s, it
became evident that far more addresses would be needed to connect devices than the IPv4
address space had available. By 1998, the Internet Engineering Task Force (IETF) had
formalized the successor protocol. IPv6 uses a 128-bit address, theoretically allowing 2128, or
approximately 3.4×1038 addresses. The actual number is slightly smaller, as multiple ranges
are reserved for special use or completely excluded from use. The total number of possible
IPv6 addresses is more than 7.9×1028 times as many as IPv4, which uses 32-bit addresses and
provides approximately 4.3 billion addresses. The two protocols are not designed to
be interoperable, complicating the transition to IPv6. However, several IPv6 transition
mechanisms have been devised to permit communication between IPv4 and IPv6 hosts.
Application Layer Protocols:
File Transfer Protocol (FTP) :
File Transfer Protocol (FTP) is the standard mechanism provided by Internet for copying a file from
one host to another. Transferring files from one computer to another is
one of the most common tasks expected from a networking or internetworking environment.
Although transferring files from one system to another seems simple and straight
forward, some problems must be dealt with first. For example,
1. Two systems may use different file name conventions.
2. Two systems may have different ways to represent text and data.
3. Two systems may have different directory structures.
All these problems have been solved by FTP in a very simple and elegant approach.
FTP differs from other client-server applications in that it establishes two connections
between the hosts. One connection is used for data transfer, the other for control informations
(commands and responses). Separation of commands and data transfer makes FTP more
efficient. The control connection uses simple rules of communication. We need to transfer
only a line of command or a line of response at a time. The data connection on the other
hand, needs more complex rules due to the variety of data types transferred.
FTP uses two well known TCP ports :
Port 21 is used for the control connection and
Port 20 is used for the data connection.
The following figure shows the basic model of FTP.
Telnet:
There may be situations, where an user wants to be able to run different application
programs at a remote site and create results that can be transferred to their local site. Instead
of writing different client-server application programs for each desired service, a better
solution is to write a general purpose client-server program that lets a user to log on to a
remote computer, use the services available on to a remote computer and transfer the results
back to the local computer.
TELNET is a general purpose client-server application program provided by TCP/IP.
It is an abbreviation for TErminaLNETwork. TELNET enables the establishment of a
connection to a remote system in such a way that the local terminal appears to be a terminal
at the remote system.
Local login:
When a user logs into a local time-sharing system, it is called local login. As a user
types at a terminal or at a workstation running a terminal emulator, the keystrokes are
accepted by the terminal driver. The terminal driver passes the characters to the operating
system. The operating system in turn interprets the combination of characters and invokes the
desired application program or utility. See figure below.
Remote login:
When a user wants to access an application program or utility located on a remote
machine, the TELNET client and server programs come into use. The user sends the
keystrokes to the terminal driver where the local operating system accepts the characters and
sent to the TELNET client, which transforms the characters to a universal character set called
Network Virtual Terminal characters and delivers them to the local TCP/IP stack.
However the characters cannot be passed directly to the operating system because the
remote operating system is not designed to receive characters from a TELNET server. It is
designed to receive characters from a terminal driver. The solution is to add a piece of
software called pseudo terminal driver, which pretends that the characters are coming from a
terminal. The operating system then passes the characters to the appropriate application
program.
Simple Mail Transfer Protocol (SMTP):
One of the most popular network services is electronic mail (e-mail). Electronic mail
is used for sending a single message that includes text, voice, video or graphics to one or
more recipients. Simple Mail Transfer Protocol (SMTP) is the standard mechanism for
electronic mail in the Internet. SMTP provides mail exchange between users on the same or
different computers and supports
Sending a single message to one or more recipients
Sending messages that include text, voice, video or graphics.
Sending messages to users on networks outside the internet.
Sending Mail :
To send mail, the user creates mail that looks very similar to postal mail. It has an
envelope and a message.
Envelope :
The envelope usually contains the sender address, the receiver address and other
information.
Message :
The message usually contains the headers and the body. The headers of the message
define the sender, the receiver, the subject of the message and other information. The body of
the message contains the actual information to be read by the recipient.
Receiving Mail :
The email system periodically checks the mailboxes. If a user has mail, it informs the
user with a notice. If the user is ready to read the mail, a list is displayed in which each line
contains a summary of the information about a particular message in the mailbox. The
summary usually includes the sender mail address, the subject and the time the mail was sent
or received. The user can select any of the messages and display its contents on the screen.
Addresses :
To deliver mail, a mail handling system must use an addressing system with unique
addresses. The addressing system used by SMTP consists of two parts : a local part and a
domain name, separated by an @ sign.
See figure below.
Local Part :
The local part defines the name of a special file called user mailbox.
Domain Name :
The second part of the address is the domain name. An organization usually selects
one or more hosts to receive and send s-mail; they are sometimes called mail exchangers.
The domain name assigned to each mail exchanger either comes from the DNS database or is
a logical name (for example, the name of the organization).
User Agent :
The first component of an electronic mail system is the User Agent (UA). A user
agent sometimes is called a mail reader.
Services provided by a User Agent :
A user agent is a software package (program) that composes, reads, replies to, and
forwards the message. It also handles mailboxes. The following are the services of a typical
user agent.
1. Composing messages
2. Reading messages
3. Replying to messages
4. Forwarding messages
5. Handling mailboxes
Post Office Protocol, version 3 (POP3):
The POP3 is simple, but it is limited in functionality. The client - POP3 software is
installed on the recipient computer; the server - POP3 software is installed on the mail server.
Mail access starts with the client when the user needs to download email from the
mailbox on the mail server. The client (user agent) opens a connection with the server on
TCP port 110. It then sends its user name and password to access the mailbox. Ther user can
then list and retrieve the mail messages, one by one. The figure below shows an example of
downloading using POP3.
POP3 has two modes : the delete mode and the keep mode. In the delete mode, the
mail is deleted from the mailbox after each retrieval. In the keep mode, the mail remains in
the mailbox after retrieval.
Limitations of POP3 :
1. POP3 does not allow the user to organize mail on the server, the user cannot have
different folders on the server.
2. POP3 does not allow the user to partially check the contents of the e-mail before
downloading.
Hypertext Transfer Protocol (HTTP) :
The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on
the World Wide Web. The protocol transfers data in the form of plain text, hypertext, audio,
video and so on. It is called the Hypertext Transfer Protocol because it is used in an
environment where there are rapid jumps from one document to another.
Domain Name System (DNS) :
To identify an entity, TCP/IP protocols use the IP address which uniquely identifies
the connection of a host to the internet. However, people prefer to use names instead of
addresses. The naming scheme used in the Internet is called the Domain Name System
(DNS).
The domain name system does specify values for the most significant segment, which
is called the top-level of the DNS. Table below list the possible top-level domains.
Country domains :
The country domain section follows the same format as the generic domains but uses
two character country abbreviations (e.g. in for India). For example, universities in the
United Kingdom and in India register under the domains :
ac.uk
ac.in
whereac is an abbreviation for academic and uk and in are the official country codes for the
United Kingdom and India.
SMTP (Simple Mail Transfer Protocol):
The actual mail transfer is accomplished through mail transfer agents (MTA). To
send mail, a system must have a client MTA, and to receive mail, a system must have a
server MTA.
When distributing I/O around the plant floor, there are three choices available. First,
dedicated PLC can be placed at the location where the I/O is required. This PLC will have
its own program running in the processor to manage the I/O at that location. The
downside to this method is that there is no communication back to a main or supervisory
PLC or other PLCs in the plant.
A second option would be to purchase a PLC chassis or other form of I/O, such as Flex I/O,
and connect it to a communication module via a network connection in a PLC chassis. This
method will allow communication back to the supervisory PLC processor so that
information can be shared. If you want intelligence at the point of the remote I/O, a
processor could be installed at the site of the remote I/O and communication set up back
to a supervisory PLC.
Instead of having a communication module connected to the Flex I/O blocks as in the
second option, here we have a 32-bit ControlLogix processor running RSLogix 5000
software at the remote site using the same Flex I/O blocks.
DESKTOP OR INDUSTRIAL COMPUTER INTERFACE CARD
A circuit-board interface card needs to be installed in an expansion slot in your desktop or
industrial computer to provide an interface between your personal computer and the control Net
network.
Figure 11-9 is a KTCX15 interface card. Note the network access port. Channel A and Channel B
are BNC, for coax network connectivity and redundancy, if desired.
Figure 11-10 is an example of using the KTCX15 interface card to connect through
the BNC connectors to an SLC 500 1747-SCNR module on a redundant control Net network
If using a notebook personal computer, a PCMCIA-type card is used in place of expansion cards
such as the KTCX15. A 1784-PCC card is a PCMCIA credit-card sized interface card for insertion
into a notebook computer's PCMCIA slot to interface to the control Net network. Figure 11-11
shows control Net interface using a notebook computer, with the interface cable connected to a
1747-SCNR network comport (NAP). Note network redundancy, with Channel A and Channel B
taps connected to the network coax cable trunk line.
Figure 11-12 is a KTCX 15 interface card and a desktop personal computer connected to the
network access port of a PLC 5 control Net processor
Up to 48 nodes can be placed on any one segment. The total cable length for a network segment
with 48 nodes is 250 meters (820 feet). There is no minimum trunk line distance between taps, so
taps can be connected directly. The following cable calculation formula is used to determine the
total length of cable.
1.000 meters [16.3 meters X (the number of taps 2)]
As an example, a segment of standard RG-6 coax requires 15 nodes. To calculate the max
minimum segment length, use the formula:
1,000 -[16.3 X (15-2)]
1,000- [16.3 X (13)]
1,000- 211.9
788.1 meters is the maximum trunk line length for this network using standard or light
industrial R6-6 coax.
Repeaters
A repeater is required if additional nodes are needed after either the maximum number of
nodes or cable length has been reached. Two modules are required to build a repeater. A 1786-
RPA(repeater adaptor module) supplies power and coordinates communication fig11-16
illustrates a repeater adapter module. Notice the power connections, lower left, and LED status
indicators and BNC connector, lower right.
The other part required is the 1786-RPCD(dual copper repeater) module. These two modules
are connected together on DIN-rail to give us a repeater. Up to four 1786-RPCD modules can be
connected to a single repeater adapter module. The copper repeater module 1786- RPCD. in
conjunction with a repeater adapter, 1786-RPA, allows multiple 1000-meter sections to be
connected. See Figure 11-17 for a 1786-RPCD module and coax connection.
Fiber repeaters available as short, medium, long, and very long haul. Up to 18.5 miles ControlNet
network using proper fiber repeaters.
Scheduled
Time critical data would be classified as scheduled. Each node on the controlNet network
would be guaranteed an opportunity to transmit information for each rotation of the network.
Unscheduled
Non-time critical information would be unscheduled. Unscheduled information would transfer
when time became available within the bandwidth. The amount of time available within the
bandwidth is determined not only by how the network is set up, but, more important, by the
amount of scheduled traffic on the network. More scheduled traffic means less time for
unscheduled traffic.
Nodes transmit information from the lowest to the highest node address on a rotating basis.
When the unscheduled portion of the bandwidth is active, the current node whose turn it is to
transmit will transmit its data. If there is additional time in the unscheduled portion of the
bandwidth, then the next node in sequence will be allowed to transmit its unscheduled data. This
is continued until the unscheduled time expires. The amount of scheduled network traffic will
determine how much time is available for unscheduled service. Heavy scheduled network traffic
could leave little time for unscheduled service. ControlNet guarantees that one node will be given
the opportunity to transmit per rotation of the network. Examples of what would fall under
unscheduled service include:
Message instruction triggered from logic on a ladder rung
Uploads and downloads
I/O and communication modules connection establishment
Caution must be used when configuring a new network or adding nodes to an existing network. If
there is a node wanting to transfer scheduled data whose node address is above SMAX, its data
will not be transferred, as the node is above the maximum scheduled and is not permitted to
transfer data. Keep in mind that a node can transmit both Scheduled and unscheduled data.
INTRODUCTION TO THE DEVICENET NETWORK
DeviceNet is also an open network intended to link low-level devices such as sensors, push-
button stations, distributed 1/O blocks, intelligent motor starter overload devices, and variable
frequency drives to higher level devices such as PLCs. DeviceNet, similar to ControlNet, is
managed by an independent group called the Open DeviceNet Vendors Association, or ODVA.
Their Web address is http://www.odva.org. Because it is an open network, devices or nodes from
many different manufacturers can be nodes on it. DeviceNet network is made of the following
components
Trunk line
Drop lines
PLC scanner
Nodes
Minimum of one power supply
Two terminations resistors
A.) Thick round drop line cable
B.) KwikLink drop line cable.
C.) KwikLink flat trunk line cable insulation displacement connector. The insulation displacement
connector’s connection teeth bite through the flat cable insulation as it is clamped to the flat
cable. No tools other than a screwdrivers are required to install a drop line off the flat trunk
cable. See Figure L1-24 Note the round connector on the bottom of the insulation displacement
connector. A drop cable similar to B would be connected here.
D.)A DevicePortTM. Devices are passive four or eight point taps that are connected to the trunk
line using a drop cable.
E.)The T-Port is used to connect a drop line off the trunk line.As shown the trunk line connects to
the right and left sides of the T Port While the drop line cable (similar to A in this figure) is
screwed to the bottom connection. T-Ports arerated NEMA 6P.
F.)KwikLinkTM flat trunk line cable
G.) DeviceLinkTM is an adapter that will allow interfacing of standard non DeviceNet two or three
wire 24v sensors with open collector sourcing outputs, mechanical devices such limit switches, or
any device with relay contacts to the DeviceNet network. One DeviceLink is required for each
node.
Figure 11-25 illustrates the base components of simple DeviceNet network. Notice the trunk line.
Each end is required to have one 121-ohm, 1/4-watt terminating resistor. For this example we are
using the thick cable for the truck line and thin cable for the lines dropping from the trunk. These
are called drop lines. The circles represent nodes on the network and each node has a number
called a node address. Duplicate node numbers are not allowed. A DeviceNet network could have
up to 64 nodes.
The software used to configure a DeviceNet network is RSNetWorx for DeviceNet. This is not the
same software as RSNetWorx for ControlNet or RSNetWorx for Ethernet I/P. Each network has its
own specific software. A DeviceNet network can support up to 64 decimal nodes, depending on
the total amount of data transferred between the nodes. Keep in mind that the DeviceNet
network was intended for low-level devices that exchange small amounts of data, usually either
few bits or bytes. Devicenet was not intended to support operator interface such as a number of
PanelViews, each exchanging 100 words each. Hardware such as this should be placed on
Ethernet. If data needs to be shared between a DeviceNet node and the Ethernet operator
interface a pair of Ethernet and DeviceNet bridge modules can be used in ControlLogix chassis.
DeviceNet networks is popular, as connecting devices together on a network can save wiring
costs. All nodes attach to one cable called the trunk line. The cable has four wires, two for signal
and two for power.
Example One
• Left terminating resistor to node 1 is 12 feet.
• Drop line node 1 is 2 feet.
• Right terminating resistor to node 12 is also 12 feet.
• Node 12 drop line is 2 feet.
• From node 1 drop line to node 12 drop line is 800 feet.
• For this example, trunk line length is maximum length of cable between terminating
resistors.
Example Three
• Left terminating resistor to node 1 drop line is 20 feet.
• Node 1 drop line is 6 feet.
• Right terminating resistor to node 12 drop line is 2 feet.
• Node 12 drop line is 8 feet.
• Trunk line from node 12 drop to node 14 drop line is 3 feet.
• Node 14 drop line is 12 feet.
• Node 1 trunk line to node 14 is 300 feet.
• The longest cable distance is between the left terminating resistor and node 14.
• For this example, the distance between terminating resistors would not be the correct
calculation.
• 20 + 300 + 12 = 332 feet
• Trunk line length is over 328 feet so maximum baud rate for this network is either125 K or
250 k.
Figure below illustrate the same DeviceNet network we have been working with the drop line
length identified. To determine the cumulative length simply add all the lengths together. The
total is 131 feet. Nodes 10, 13, and 14 exceed the 20-foot maximum drop to any 1 node. Shorten
up cable by reducing 20 feet to 16feet. Now Cumulative drop line length is now 127 feet
DEVICENET INTERFACE
The type of personal computer will use to attach to the DeviceNet network will determine the
interface card and cable required for your particular application. As with other network
connections, either a circuit board, for installation into a desktop or industrial computer, or a
PCMCIA card, for installation into a notebook personal computer, are needed to communicate to
the network.
If using a notebook personal computer, the 1754-PCD, a PCMCIA-type card, could be installed in
the computer for interfacing to DeviceNet. There is also a grey plastic interface box lawn at a
1770-KFD that can be connected to a computer's serial port to interface to DeviceNet. In all cases
listed above, the appropriate RSLinx driver will need to be configured.
If using a Controller of PLC, most people would use Ethernet to upload, download, and do online
editing of the PLC project. When using DeviceNet, there would be a DeviceNet bridge module in
the ControlLogix chassis to access the DeviceNet network. Because of this, the easiest way to the
chassis, and simply bridging across the backplane to DeviceNet. Communicating in this manner
eliminates the need to purchase a Device Net interface card for your computer.
fig11.31
To interface to your PLC, a DeviceNet communication module in required in the chassis. Figure11-
31 illustrates a Device net daughter card for a FlexLogix.
Notice the top five-pin connector (A); this is the DeviceNet network cable connector connection
point. Directly below this is the switch for setting up the interface card’s baud rate (B). There is
some text just above the network cable connector that reads 0-125K, 1-250K, 2-500K, and PGM.
Set the switch to the network’s baud rate. PGM means the baud rate in software. Directly below
this switch are some status LEDs (C). Switches on the very bottom of the card (D) set up the card’s
address which currently appears to be 00. If communicating with a SLC 500, 177-SDN scanner
module is needed. A PLC 5 needs a 1771-SDN, whereas ControlLogix requires a 1756-DNB (Device
Net Bridge) module. Figure 11-32 is that of a ControlLogix DeviceNet bridge module. Notice the
network connection near the bottom of the module. There is a square window near the top left
of the module where information such as error codes and module Information will be displayed.
Directly below the window are three LEDs providing information on the module and network. The
window and LEDs are used to view the overall health of the network, and any error codes
currently on the network.
EVOLUTION OF SCADA
1890’s Remote Control and Remote Indication
1920’s Tele command and control
1930’s Check Before Operate (CEO)Systems Based on Electro Mechanical Technology
1960’s Supervisory Control Systems (Remote Control & Status Indication)
1960’s Data Acquisitions gaming Popularity (DAS) SCADA came into being.
1980’s Load Dispatch Centre and Control
1990’s Energy Control Centre
2000’s Energy Management Systems
3. Communication Equipment:
In the SCADA system network but there must be uninterrupted, bidirectional
communication between the MTU and the RTU for a Data Acquisition system to function
properly. Private wire lines, buried cable, telephone, telemetry hardware like wireless radios and
modems, microwave dishes, satellites, or other atmospheric means, DSL (Digital Subscriber
Line), Integrated Service Digital Network (ISDN), cable, fiber optics, WiFi, or other broadband
services.
4. SCADA Software:
A typical SCADA system provides a Human Machine Interface (HMI) allowing
the operator to visualize all the functions as the system is operating. The operator can also use
the HMI to change set points, view critical condition alerts and warnings, and analyze or present
data trends. Common HMI software packages include Cimplicity (GE-Fanuc), RSView (Rockwell
Automation)
OBJECTS IN SCADA
Tag:
The I/O s is linked in the SCADA through addresses of those in PLC. These PLC input-output
addresses are termed as Tags in SCADA. Each input and output that is designed in SCADA is given
a tag which resembles an address in PLC.
Screen:
Thus, whenever the data at the address changes, it changes the data in that Tag linked to that
address, in the SCADA screen.
Text:
The Text object allows the attribution of messages at intervals of tag values, called Zones. Several
zones can be defined, each one of them containing its own message. The Text Properties allow
the definition of colors and messages for each zone. It is also possible to define a Default Zone for
values not belonging to any specific interval. You can edit the properties of a text by double-
clicking it.
Display:
The Display object is used to show tag values in real time.
The properties of display allow the definition of the size, color, font, alignment, 3D effects, and
other characteristics. You can edit the display properties by double-clicking it.
Graph:
The Graph page of the Graphic Report appears when the Graph tab is selected on top of the
Graphic Report pages.
Setpoint:
The Setpoint object works as an editing box of Windows; thereby, it is just enough to type a value
and press [Enter] to attribute this value to the associated tag. The properties of setpoint allow
you to define the type of input value, the font, size and color of characters to be shown in the
object. You can edit the Setpoint properties by double-clicking it.
Alarm:
The Alarm object allows the verification of active or registered alarms (“logged”) in the alarm file.
Alarms can be triggered when values of associated tags are verified in four situations and
different priorities: LoLo (critically low), Low, High, HiHi (critically high). Outside these ranges, tag
values are considered as normal.
Drivers:
The Elipse SCADA allows the communication with data acquisition equipment, and with other
computers running the Elipse SCADA through I/O drivers or network drivers supplied by Elipse
Software. A document is supplied with each driver, containing important information relative to
its setting.
The conditions specified are expressions that can be assessed as true (different from zero) or
false (zero or empty string ""). If the condition is true, the block of instructions is executed up to
the EndIf command. When this command is executed, the condition of If (condition1) is first
assessed; if true, the block of instructions 1 is executed, and the command is finished with EndIf.
If condition1 is false, the condition of ElseIf (condition2) is assessed and the block of instructions
2 is executed in case it is true. If false, next ElseIf condition will be assessed, and so forth. If no
ElseIf condition is true, the block of instructions of Else will be executed. The program continues
its execution with the command after EndIf. Blocks of instructions ElseIf and Else are optional.
You can specify as many ElseIf clauses you want; nevertheless, they can never be after an Else
clause. Any block of instructions can contain nested If…EndIf commands.
For:
Repeats a block of instructions a given number of times. To this repetition, we give the name of
“Knot” or “Loop”.
Syntax:
While:
Runs a block of instructions while a given condition is true.
The condition specified is an expression that can be assessed as true (different from zero) or false
(zero or empty string ""). If the condition is true, the block of instructions is executed up to the
Wend instruction, when the condition is assessed again. The block of instructions will be
repeated until the condition becomes false, when the command after the Wend instruction will
be executed. While...Wend loops can be nested.
SCADA, on the other hand, is not hardware. It is a software (usually installed in a PC or laptop)
where we get to design the whole process in any industry by using the tools provided in the
software.
The above image is the pictorial representation of the process taking place in the field. It gives
the real time description of the process.The I/Os are not connected to SCADA directly.
SCADA controls the outputs through PLC. The programming part is saved in the PLC.
The PLC and SCADA are connected through various protocols (serial port, MPI, PPI, etc)
depending on the manufacturer.
SCADA IN INDUSTRIES
SCADA can be used to manage any kind of equipment. Typically, SCADA systems are used to
automate complex industrial processes where human control is difficult. For example in systems
where there are more control factors unable to be managed by operators in a control centre.
SCADA systems are widely used for control in the following domains
1. Electric power generation, transmission and distribution: Electric utilities use SCADA systems to
detect current flow and line voltage, to monitor the operation of circuit breakers, and to take
sections of the power grid online or offline.
2. Water and sewage: State and municipal water utilities use SCADA to monitor and regulate
water flow, reservoir levels, pipe pressure and other factors.
3. Buildings, facilities and environments: Facility managers use SCADA to control HVAC,
refrigeration units, lighting and entry systems.
4. Manufacturing: SCADA systems manage parts inventories for just-in-time manufacturing,
regulate industrial automation and robots, and monitor process and quality control.
5. Mass transit: Transit authorities use SCADA to regulate electricity to subways, trams and trolley
buses; to automate traffic signals for rail systems; to track and locate trains and buses; and to
control railroad crossing gates.
6. Traffic signals: SCADA regulates traffic lights, controls traffic flow and detects out-of-order
signals.