03 - CH3, Programming of PLC
03 - CH3, Programming of PLC
M 1
PROGRAMMING OF PLC
Types of PLC Programming Language
a. Structured text programming (ST) - A high level language that has some
similarities to Pascal. Statements can be used to assign values to variables.
b. Logic diagram (LD) – A graphical language, and most widely used. Use Boolean
mnemonics to represent the process, before converting into logic diagram.
d. Instruction List (IL) - A low level programming language, much like assembly
language programming.
• Mnemonic codes are used, each code corresponding to an operator/ladder element. The
codes used differ to some extent from manufacturer to manufacturer
Basuwaqi, A. M 3
PROGRAMMING OF PLC
IL Language Instruction code mnemonics
Basuwaqi, A. M 4
PROGRAMMING OF PLC
Instruction lists (IL)
instructions
Operands
Comments
Basuwaqi, A. M 5
PROGRAMMING OF PLC
Instruction lists (IL)
with there being the instruction earlier in the program to jump to PUMP_OK if a particular
condition is realized.
an N after it is used to negate its value. Thus the ANDN operator inverts the value of ladder
contacts and ANDs the result
Basuwaqi, A. M 6
PROGRAMMING OF PLC
Ladder programs and instruction lists
1. whenever a rung is started, it must use a ‘start a rung code’. This might be LD, or perhaps
A or L, to indicate the rung is starting with open contacts.
3. All rungs must end with an output or store result code. This might be
OUT or = or ST
Basuwaqi, A. M 7
PROGRAMMING OF PLC
Ladder programs and instruction lists
MITSUBISHI SIEMENS
Basuwaqi, A. M 8
PROGRAMMING OF PLC
Ladder programs and instruction lists
Basuwaqi, A. M 9
PROGRAMMING OF PLC
Ladder programs and instruction lists
Basuwaqi, A. M 10
PROGRAMMING OF PLC
Ladder programs and instruction lists
Basuwaqi, A. M 11
PROGRAMMING OF PLC
Ladder programs and instruction lists
Branch codes
Basuwaqi, A. M 13
PROGRAMMING OF PLC
Ladder programs and instruction lists
Basuwaqi, A. M 14
PROGRAMMING OF PLC
Ladder programs and instruction lists
Example 1:
A B C
Basuwaqi, A. M 15
PROGRAMMING OF PLC
Ladder programs and instruction lists
Answer Example1
A B C
Basuwaqi, A. M 16
PROGRAMMING OF PLC
Sequential function charts (SFC)
Basuwaqi, A. M 18
PROGRAMMING OF PLC
Structured text
• Assignment statements are used to indicate how the value of a variable it to be changed,
Light := SwitchA;
Consider:
Basuwaqi, A. M 19
PROGRAMMING OF PLC
Structured text
Conditional statements
IF ... THEN ... ELSE is used when selected statements are to be executed when certain
conditions occur. For example:
Basuwaqi, A. M 20
PROGRAMMING OF PLC
Structured text
Examples:
Programs have first to define the data types required to represent data
Basuwaqi, A. M 21
PROGRAMMING OF PLC
Structured text
Basuwaqi, A. M 22
PLC WIRING DIAGRAMS
Electromagnetic Control Relays
Basuwaqi, A. M 23
PLC WIRING DIAGRAMS
Electromagnetic Control Relays Operation
Basuwaqi, A. M 24
PLC WIRING DIAGRAMS
Contactors
Three-pole
magnetic contactor
Basuwaqi, A. M 25
PLC WIRING DIAGRAMS
Contactors
Basuwaqi, A. M 26
PLC WIRING DIAGRAMS
Motor Starters
A motor starter is designed to provide power to motors.
The motor starter is made up of a contactor with an
overload relay attached physically and electrically to it.
Basuwaqi, A. M 28
PLC WIRING DIAGRAMS
Motor Starters
Basuwaqi, A. M 29
PLC WIRING DIAGRAMS
Manually Operated Switches
Manually operated switches are controlled by hand. These include toggle switches,
pushbutton switches, knife switches, and selector switches.
Pushbutton switches are the most common form of manual control
Basuwaqi, A. M 30
PLC WIRING DIAGRAMS
Manually Operated Switches
Basuwaqi, A. M 31
PLC WIRING DIAGRAMS
Mechanically Operated Switches
Basuwaqi, A. M 32
PLC WIRING DIAGRAMS
Mechanically Operated Switches
Temperature switch
Basuwaqi, A. M Pressure switch 33
PLC WIRING DIAGRAMS
Sensors
• Sensors are used for detecting, and often measuring, the magnitude of something.
• They convert mechanical, magnetic, thermal, optical, and chemical variations into electric
voltages and currents
Proximity sensor: that detect the presence of an object (usually called the target) without
physical contact
Basuwaqi, A. M 34
PLC WIRING DIAGRAMS
Sensors
Basuwaqi, A. M 35
PLC WIRING DIAGRAMS
Sensors: Light Sensors
Through-beam scan
Basuwaqi, A. M 36
PLC WIRING DIAGRAMS
Sensors: Ultrasonic Sensors
Basuwaqi, A. M 37
PLC WIRING DIAGRAMS
Output Device Control
Solenoid
Basuwaqi, A. M 38
Basuwaqi, A. M 39