Beruflich Dokumente
Kultur Dokumente
PLC
PROGRAMMING
DEFINITION
The pairs of vertical lines along the branch line is called the
conditions. These conditions consist of two, namely:
i. Normally open condition (NO)
ii. Normally closed condition (NC)
instruction
00001
00001 00003
Explanation:
The Execution Conditions of the instruction on the right
will be ON when IR 00000 is ON.
Load Not (LD Not):
These instructions are use to start a line of the
program.
It is used in the first contacts in the normally
closed condition (NC).
Ladder Diagram
Mnemonic Code
address Instruction Operand/Data
00000 01000
output 00000 LD NOT 00000
Explanation
The Execution Conditions of the instruction on the right will
be ON when IR 00000 is OFF
b) And (AND):
These instructions are used in the second contact in a
normally open (NO) and a series with previous
contacts
Ladder Diagram Mnemonic
Code
Alamat Arahan Operand/Data
00000 00001
01000 output 00000 LD 00000
00001 AND 00001
00002 OUT 01000
Explanation
The Execution Conditions of the instruction on the right will
be ON when IR 00000 and IR 00001 are ON
And Not (AND NOT):
Explanation
The Execution Conditions of the instruction on the right will
be ON when IR 00000 ON and IR 00001 are OFF.
c) Or (OR):
These instructions are used in the second contact in a
normally open (NO) and in line (parallel) with
previous contacts.
Ladder Diagram Mnemonic
Code
00000 address instruction Operand/Data
01000
output
00000 LD 00000
00001 OR 00001
00001
00002 OUT 01000
Explanation
The Execution Conditions of the instruction on the right
will be ON when either IR 00000 or IR 00001 are ON.
Or Not (OR NOT):
These instructions are used in the second contact in a
normally closed (NC) and in line (parallel) with
previous contacts.
Ladder Diagram Mnemonic
Code
00000 01000 Address instruction Operand/Data
OUTPUT 00000 LD 00000
00001 OR NOT 00001
00001 00002 OUT 01000
Explanation
The Execution Conditions of the instruction on the right will be
ON when either IR 00000 is ON or IR 00001 is OFF or IR 00000
ON, IR 00001 OFF simultaneously
d) Out (OUT):
These instructions are used for the coil output.
00000 LD 00000
01001
END
Explanation
o Instruction LD 00 002 acts as S (Set)-and the LD 00 003 acts
as R (Reset).
o When the instruction LD 00 002 ON, the output instruction
OUT 10004 will be ON and will remain ON even if the
instruction LD 00 002 is OFF.
o When the instruction LD 00 003 ON, then the output OUT
10004 instruction OFF and will remain OFF even though the
instruction LD 00 002 in OFF or ON state.
Ladder Diagram shows KEEP Operation table
instruction
00002
00003
HR000
01004
Timing diagram
b) Set/Reset (SET/RESET):
SET and RESET instruction will change the status of bit
operations only when the implementation is ON.
In the OFF condition, the instructions will not change the bit
operation status.
Explanation
When the input instruction LD 00 000 is ON, SET instruction
command to ON and always ON regardless of whether the
input instruction LD 00 000 is ON or OFF.
• When the instruction JMP (04) is ON, no jump will occur and
the program will be implemented as written.
Explanation
o When the input instruction LD 00000 is ON, instruction JMP
(04) will be ON. Subsequent instructions will be
implemented as written.
00001
01000
Operation table
Timing diagram
o When the input instruction LD 00 000 is OFF, instruction JMP
(04) will be OFF. Next jumps to Instruction JME (05) will
occur.
o All instruction that is between JMP (04) and JME (05) will be
ignored.
0000
00001
1000 Timing
Ladder Diagram shows IL ( 02 )
T1 diagram
T2 T3 T4
dan ILC ( 03 )
Mnemonic Code
Explanation
01001
0000
01000
01001
0000
01000
• Ladder diagram:
• Mnemonic code:
Data
being
delet
e
• Ladder diagram:
• Mnemonic code:
h) Arithmetic Function:
SET CARRY – STC (40) – FUN(40):
• Symbol:
• Symbol:
• Ladder diagram:
• Mnemonic code: Compare Result:
Explanation:
• TR use to temporary store the status ON/OFF at the
instruction branch. Bit TR are from TR0 until TR 7.
• When instruction LD 00000 ON, instruction CMP ( 20 ) will
execute.
• Instruction COMPARE will compare the value in C1 with the
value in C2. Refer to the table above.
4.3.2 Build program using special sequential
instructions set
• EXAMPLE 1:
• A burglar alarm is activated by N.O push button, placed on a
door, D1 and window, W1.
• When the alarm is armed and a door or window is opened,
the alarm will trigger ON.
• The only way to turn OFF the alarm is by disable the power
supply or hit the reset button, S1.
• Draw the PLC ladder diagram and write the mnemonic code
to execute the control action.
4.4 TIMER & COUNTER INSTRUCTION
Operating Condition:
• When the input (LD 00000) is ON, the timer contact will be
activated after 5 seconds.
• Next, the output (OUT 10000) will be ON.
0000 5 sec
TIM000
Timing diagram
Example 2:
Operating Condition:
• When the input (LD 00000) ON, the timer (TIM 000) will be
activated after 5 seconds and the output (OUT 10000) will be
ON.
• While the output (OUT 10 001) will be ON as soon as the
supply is supplied and will be OFF after 5 seconds.
• Timer will continue to be active as long as the input 00000
state is ON.
Example 3:
Operating Condition:
• When the input (LD 00000) ON, the timer (TIM 000) will be activated
after 5 seconds. Next the output (OUT 10000) will be ON.
• After 3 seconds the output (OUT 10000) ON, the timer (TIM 001) will
be activated the next output (OUT 10000) will be OFF and the timer
(TIM 001) will be OFF.
• When the timer TM001 OFF, contact TIM 001 (NC) will be ON and the
output (OUT 10000) is ON state.
• Output (OUT 10000) will continue ON and OFF until the input (LD
00000) in the OFF state.
4.4.3 Counter Instruction Set
• Symbol:
Operating Condition
• Counter set to count 10. When the input (LD 00,000) is the
pulse of ten, a counter will be activated and thus the output
(OUT 10000) will be ON.
• When reset (LD 00,001) ON, a counter will be in original
condition
Timing Diagram:
0000
0001
CNT 001
1000
4.5 COMBINED LOGICAL FUNCTION
SEQUENCE
The Application Of Timer And Counter Instructions:
• The number of Counter cannot be the same number to the
number of timer because both share the same data in the
PLC memory.
• Ladder diagram: Operating Condition:
o Counter set to count 5. When the
input (LD 00,000) is the pulse of
0001 five, a counter will be activated and
thus the output (OUT 10000) will be
ON.
o When the output (OUT 10000)
ON, TIM 001 will be activated after
5 seconds and then the output (OUT
10 001) will be ON.
o Both the output (OUT 10000) and
(OUT 10 001) will always be ON
until reset (LD 00001) in the ON
state.
o Reset will return the counter to
Timing Diagram:
0000
0001
CNT 000
TIM001 5 SEC
5 SEC
1000
1001
5 SEC 5 SEC
EXAMPLE 1 (Timer And Counter Instructions)
• The carrier is moved by the forward/reverse motor. The initial position
of the carrier is the left position indicated by the limit switch S4. When
the start push button, S1 is pressed (then release), the carrier will be
loaded with 5 pieces of product, which is sense by photo sensor S3
before it moves to the right until it touches the right limit switch S5,
the automatic carrier will halt for 5 seconds before it reverse to the
left. Once it touches S4, the carrier stop until it is sufficiently loaded.
Then it starts conveying again. The stop button, S2 stops the motor
regardless of which direction it is turning.
Stop (S2)
A B
M1
M2
EXAMPLE 2:
• Design a program that will monitor & control the conveyor
system for material testing while adhering the following
criteria: