Chapter 8: PLC Programming Language - Basic Instructions
Chapter 8: PLC Programming Language - Basic Instructions
Basic Instructions
Basic Instructions
2
Basic Instructions
3
Basic Instructions
Connection instructions
4
Basic Instructions
Output instructions
5
Basic Instructions
6
Basic Instructions
7
Basic Instructions
8
Basic Instructions
9
Example
ON (1)
X0
OFF (0)
ON (1)
X1
OFF (0)
t
10
Caution: Double outputs (double coils)
Double outputs
11
Countermeasures against Double outputs
12
SET and RESET instructions
13
14
Relay schematic vs. Ladder logic program
15
Relay schematic vs. Ladder logic program
16
Relay schematic vs. Ladder logic program
17
Quiz
a) Y0 = 𝐴𝐴 + 𝐵𝐵 𝐶𝐶𝐶𝐶
b) � + 𝐷𝐷
Y0 = 𝐴𝐴𝐵𝐵𝐶𝐶 � + 𝐸𝐸
c) Y0 = [ 𝐴𝐴̅ + 𝐵𝐵� 𝐶𝐶] + 𝐷𝐷 𝐸𝐸�
d) ̅ 𝐶𝐶̅ + (𝐷𝐷𝐸𝐸𝐹𝐹)
Y0 = 𝐴𝐴𝐵𝐵 �
18
Exercises
19
Exercises
20
Timer – PLC Mitsubishi (FX Family)
Mnemonic of Timer is Ti
Calculate the time delay with the following equation:
Time delay = n × clock pulse
With n is constant in the program memory (Kn)
This is ON – Delay Timer.
21
Timer – PLC Mitsubishi (FX Family)
22
Timer – PLC Mitsubishi (FX Family)
23
Timer – PLC Mitsubishi (FX Family)
24
OFF-Delay Timer
25
Quiz
When a light switch (X1) is ON, a fan (Y0) is also ON. However,
the latching function ensures that the fan also remains ON
after the light has been switched OFF.
Draw a diagram of signal sequence X1, T0 and Y0.
Rewrite the program using SET/RST instructions.
26
Clock Signal Generators
The PLC has the 4 types of internal clock M8011, M8012, M8013,
M8014 with 10ms, 100ms, 1s, 1min clock pulse, respectively.
Caution: Even while the PLC is in the STOP mode, these clocks are
always oscillating.
27
Clock Signal Generators (ON- and OFF-Delay)
28
Clock Signal Generators
X1
T1=2s
T1
T2=3s
T2
1s
Y0
29
Exercises
Exercise 3
31
Counter – PLC Mitsubishi (FX Family)
32
Counter – PLC Mitsubishi (FX Family)
General type and latched type 16-bit up counters
33
Counter – PLC Mitsubishi (FX Family)
34
Quiz
35
Exercises
Exercise 6: A continuous
filling operation.
This process requires that
boxes moving on a conveyor
be automatically positioned
and filled.
Exercises
When the PB1 is pressed, MV1 opens and the water begins
to fill the tank. At the same time, the stirring motor M
starts.
When the water level passes TLB2 and reaches TLB1, MV1
closes and the stirring motor stops.
Next, MV2 opens and starts draining the water. When the
water level drops below TLB2, MV2 closes.
When the cycle of operation has repeated four times, the
operation END indicator illuminates, and the filling and
draining operation will not restart even if PB1 is pressed.
Only after pressing the PB3, the filling and draining
operation can run when PB1 is pressed.
Exercises
Input Output
Water supply valve
Start button (PB1)
(MV1)
Stop button (PB2) Drain valve (MV2)
Reset button (PB3) Stirring motor (M)
Upper level switch
End indicator
(TLB1)
Lower level switch
Buzzer
(TLB2)
Exercises
Start Count the car coming in/out of parking lot If the parking lot is full
(>=100), turn on the red light. If not full, turn on the green light.
Stop Reset system.
Exercises
Input Output
Sensor at gate in
Sensor 1
When Start button is pressed Conveyor 1 moves Conveyor
Sensor 2
1 stops, Conveyor 2 moves (supply apples) Count 10 apples
Input Output
Start Conveyor 1
Stop Conveyor 2
Apple counting
Box detection
Exercises
• Once the reactor tank reaches an initial temperature of 100°C, the controller
will add ingredient A by opening solenoid valve 1 (SOL1) until 100 gallons of
ingredient A have been poured into the tank. LLS1, which is normally open,
detects the quantity of ingredient A in the tank. This switch closes when
ingredient A reaches the proper level.
• At this point, the controller will add ingredient B by opening SOL2. LLS2
detects the quantity of ingredient B, which should be 400 gallons. The
temperature should be at 100°C ± 10% during the Add Ingredients step. If the
temperature drops, the PLC will turn ON the heater automatically while the
process continues.
• When the reactor tank contains both ingredients, the controller will raise the
temperature to 300°C ± 10% and turn ON the mixer for 5 minutes. The PLC
will control the temperature automatically at predefined set points during the
process.
• SOL3 will activate the drain valve when the mixing is completed. This
operation will reset the process until another finished product tank is placed in
position, and the cycle starts again. The system should incorporate pilot light
indicators to alert the operator to the status
57
of the batching process.