PLC Advanced Commands
PLC Advanced Commands
nfi
Copyright@NFI
3.1
nfi
Control Purpose:
z
Enabling the indicator to be ON immediately and OFF after a 5 sec delay by the switch
5s
X1
T0
Y1
Devices:
Device
Function
X1
T1
Y1
Output indicator
Control Program:
X1
T1
Y1
Y1
X1
TMR
T1
K50
Program Description:
z
X1 = ON when the switch is turned on. The NC (Normally Closed) contact X1 will be
activated, and TMR instruction will not be executed. Coil T1 will be OFF and so will the NC
contact T1. Because X1 = ON, the indicator Y1 will be ON and latched.
X1 = OFF when the switch is turned off. The NC contact X1 will not be activated, which
makes TMR instruction executed. Indicator Y1 will remain ON by the latched circuit until T1
reaches its set value.
When timer T1 reaches its set value of 5 seconds, coil T1 will be ON. The NC contact T1 will
be activated, which makes the indicator Y1 OFF.
Delay OFF function can also be performed by using API 65 STMR instruction.
nfi
DVP-PLC Application Examples
3-1
nfi
Delay ON Program
Control Purpose:
z
Enabling the indicator to be ON after a 3 sec delay and OFF immediately by the switch
X1
3s
T0
Y1
Devices:
Device
Function
X1
T1
Y1
Output indicator
Control Program:
X1
TMR
T1
K30
T1
Y1
Program Description:
z
When X1 = ON, TMR instruction will be executed. Timer T1 will be ON and start counting for
3 sec. When T1 reaches its set value, the NO (Normally Open) contact T1 will be activated
and indicator YI will be ON.
When X1 = OFF, TMR instruction will not be executed. Timer T1 will be OFF and so will NO
contact T1. Therefore, the indicator Y1 will be OFF.
nfi
3-2
3.3
nfi
Control Purpose:
z
Enabling the indicator to be ON after a 5 sec delay and OFF after a 3 sec delay by the
switch
3s
X1
Y1
5s
Devices:
Device
Function
X1
T0
T1
Y1
Output indicator
Control Program:
X1
X1
T0
TMR
T0
K50
TMR
T1
K30
T1
Y1
Y1
Program Description:
z
When X1 = ON, T0 will start counting for 5 sec. When T0 reaches its set value, the NO
contact T0 will be ON while NC contact T1 will remain OFF, which makes the indicator Y1 to
be ON and latched.
When X1 = OFF, T1 will start counting for 3 sec. When T1 reaches its set value, the NC
contact T1 will be activated while the NO contact T0 will remain OFF, which makes the
indicator Y1 to be OFF.
nfi
DVP-PLC Application Examples
3-3
nfi
START X0
Main motor
Y1
Auxiliary Motor
Y2
STOP X1
Control Purpose:
z
Starting the oil pump motor immediately when START is pressed. The main motor will be
started after a 10 sec delay and then the auxiliary motor after a 5 sec delay. In addition,
stopping all motors immediately when STOP is pressed.
X0
X1
Y0
10s
Y1
5s
Y2
Devices:
Device
Function
X0
X1
T0
T1
Y0
Y1
Y2
nfi
3-4
nfi
Control Program:
X0
X1
Y1
TMR
T0
K100
Y0
Y0
T0
X1
Y2
TMR
K50
Y1
T1
Y1
Y2
X1
Y2
Program Description:
z
When START is pressed, the NO contact X0 will be activated, which makes Y0 to be ON and
latched. The oil pump motor will start the lube system. At the same time, [TMR T0 K100]
instruction will be executed. When T0 reaches its set value of 10 sec, the NO contact T0 will
be ON.
When the NO contact T0 is ON, Y1 will be ON and latched, which starts the main motor and
stops timer T0. At the same time, [TMR T1 K50] is executed, and the NO contact T1 will be
ON when timer T1 reaches its set value.
When the NO contact T1 is ON, Y2 will be ON and latched, which starts the auxiliary motor
and stops T1.
When STOP is pressed, the NC contact X1 will be activated, which makes Y0, Y1 and Y2
OFF. The oil pump motor, main motor and auxiliary motor will stop working.
nfi
DVP-PLC Application Examples
3-5
nfi
Pulse-Width Modulation
Control Purpose:
z
Performing Pulse Width Modulation function by changing the set value of the timer in the
program. The oscillating pulse is as below: (Y0 = ON for 1 sec. The cycle = 2 sec)
X0
1000ms
Y0
2000ms
Devices:
Device
Function
X0
T0
T1
Y0
Control Program:
X0
TMR
T0
K10
TMR
T1
K20
T0
T1
T0
Y0
T1
ZRST
Program Description:
z
When X0 = ON, timer T0/T1 will be activated. Y0 will be ON until timer T0 reaches its set
value. When timer T1 reaches its set value, T0/T1 will be reset. Therefore, Y0 will output the
above oscillating pulse continuously. When X0 = OFF, the output Y0 will be OFF as well.
Pulse Width Modulation function can be modified by changing the set value of the timer in
the program.
Pulse Width Modulation function can also be performed by using API 144 GPWM
instruction.
X0
GPWM
3-6
K1000
K2000
Y0
nfi
DVP-PLC Application Examples
nfi
Y0
Y3
Y4
X2
X1
Y1
X0
X4
RESET
Y2
Control Purpose:
z
Feeding or draining water automatically when the water level of artificial fishpond is not at
the normal level. In addition to feeding / draining water, enabling the alarm and alarm lamp
when the water is above or below the alarm level.
500ms
Alarm
Alarm Lamp
Y3/Y4
500ms
Devices:
Device
Function
X0
X1
X2
X3
X4
T1
T2
Y0
1# drainage pump
Y1
Feeding pump
Y2
2# drainage pump
Y3
Alarm lamp
Y4
Alarm
nfi
DVP-PLC Application Examples
3-7
nfi
Control Program:
X3
Y0
X1
Y1
X2
X0
Y2
T2
TMR
T1
K5
TMR
T2
K5
X3
T1
X0
T1
X3
Flashing Circuit
X4
RESET
Y3
Alarm Lamp
Y4
Alarm
Program Description:
z
When the water is at normal level: X0 = ON, X1 = ON, X2 = OFF and X3 = OFF. Therefore,
Y0 and Y2 will be OFF. Both the drainage pump and the feeding pump will not work.
When the water is lower than the normal level, X0 = ON, X1 = OFF, X2 = OFF and X3 = OFF.
Because X1 = OFF, Y1 will be ON. The feeding pump will start working.
When the water is below the lowest of alarm level, X0 = OFF, X1= OFF, X2 = OFF and X3 =
OFF. Because X1 = OFF, Y1 will be ON. The feeding pump will start working. In addition,
because X0 = OFF, the flashing circuit will be activated, which makes Y3 = ON and Y4 = ON,
The alarm lamp will flash and the alarm will ring.
When the water is above the normal level, X0 = ON, X1 = ON, X2 = ON, X3 = OFF. Because
X2 = ON, Y2 will be ON. 2# drainage pump will drain water from the fishpond.
When the water is above the highest of alarm level, X0 = ON, X1 = ON, X2 = ON, X3 = ON.
Because X2 = ON, Y2 will be ON. 2# drainage pump will work. In addition, because X3 = ON,
Y0 will be ON. 2# drainage pump will work. Besides, the alarm circuit will be executed,
which makes Y3 = ON and Y4 = ON. The alarm lamp will flash and the alarm will ring.
When Reset is pressed, the NC contact X4 will be activated. Y3 = OFF and Y4 = OFF. Both
the alarm and the alarm lamp will stop working.
nfi
3-8
3.7
nfi
X0
Y0
Control Purpose:
z
Warning the operator to take out PLC from the burn-in room by the test completed indicator
after 2.5 hours burn-in process.
X0
3000 s
T0
3000 s
T1
3000 s
T2
Y0
(3000+3000+3000)s
Devices:
Device
Function
X0
T0
T1
T2
Y0
nfi
3-9
nfi
Control Program:
X0
TMR
T0
K30000
TMR
T1
K30000
TMR
T
T2
K30000
T0
T1
T2
Y0
Program Description:
z
The upper bound value for a 16-bit timer is 100ms 32767 = 3276.7s, so it needs several
timers to work together for a timing extension application which is more than 1 hour (3600
sec.) The total time is the sum of each timers set value.
When the burn in test is started, X0 = ON. The timer T0 will start to count for 100ms 30000
= 3000sec. When T0 reaches its set value, the NO contact T0 will be ON and T1 will start to
count for another 100ms 30000 = 3000sec. When T1 reaches its set value, T2 will count
one more 3000 sec and turn on the NO contact T2. Finally, the burn-in test completed
indicator Y0 will be ON. The total time of the test is 3000s + 3000s + 3000s = 9000s =
150min = 2.5h.
The timing extension function can also be performed by using API 169 HOUR instruction.
nfi
3-10
3.8
nfi
KM1
KM0
KM2
24V
KM0
Y0
24G
SS
X0
X1
Y1
KM2
Y2
COM
Control Purpose:
z
Usually the starting current of the three-phase AC asynchronous motor is 5 ~7 times larger
than the rated current. To reduce the effect of the starting current on the electrified wire
fence, a star-delta reduced voltage starter should be applied.
Devices:
Device
Function
X0
X1
T1
T2
Y0
Y1
Y2
nfi
3-11
nfi
Control Program:
X0
X1
Y0
Y0
TMR
Y0
T0
T0
K100
T1
K10
Y2
Y1
Y1
T0
TMR
T1
Y1
X1
Y2
Y2
Program Description:
z
X0 = ON when START is pressed. Y0 will be ON and latched. The motor starting contactor
KM0 will be ON and the timer T0 will start to count for 10 sec. At the same time, because Y0
= ON, T0 = OFF and Y2 = OFF, Y1 will be ON. The Star Reduced Voltage Starter contactor
KM1 will be activated.
When timer T0 reaches its set value, T0 will be ON and Y1 will be OFF. Timer T1 will start to
count for 1 sec. After 1 sec, T1 = ON and Y2 = ON. Delta Reduced Voltage Starter
contactor KM2 will be activated.
X1 = ON when STOP is pressed. Y0, Y1 and Y2 will be OFF and the motor will stop running
no matter it is in starting mode or running mode.
nfi
3-12
3.9
nfi
X0(Infrared Sensor.
Control Purpose:
z
When someone enters the infrared sensing field, opening motor starts working to open the
door automatically till the door touches the opening limit switch
If the door touches the opening limit switch for 7 sec and nobody enters the sensing field,
the closing motor starts working to close the door automatically till the closing limit switch
touched together.
Stop the closing action immediately if someone enters the sensing field during the door
closing process.
Devices:
Device
Function
X0
X1
X2
T0
Y0
Opening motor
Y1
Closing motor
nfi
DVP-PLC Application Examples
3-13
nfi
Control Program:
X0
X2
Y1
Y0
Y0
X2
X0
TMR
T0
X0
X1
T0
K70
Y0
Y1
Y1
Program Description:
z
X0 = ON if someone enters the sensing field of the infrared sensor. Y0 will be ON and
latched, and the door will be opened as long as the opening limit switches X2 = OFF.
When the door touches the opening limit switches, X2 = ON. The timer T0 will start to count
for 7 sec if no one enters the sensing field (X0 = OFF). After 7 sec., Y1 will be ON and
latched and the door will be closed.
During the closing process, X0 = ON if someone enters the sensing field. The NC contact
X0 will be activated to turn Y1 off. Because X0 = ON, X2 = OFF and Y1 = OFF, Y0 will be
ON and the door will be opened once again.
nfi
3-14
3.10
nfi
Y0 ( Liquid A Inlet
X2
X0
START
X1
STOP
X10
EMERGENCY STOP
Y1(Liquid B Inlet )
Y3
X1
Y2(Mixture Outlet
Control Purpose:
z
Automatically infusing the container with liquids A and B in order when START is pressed.
When it reaches the set level, mix the two liquids evenly then open the valve to let out the
mixture.
Devices:
Device
Function
X0
X1
Low level float sensor. X1 = ON when the liquid level reaches X1.
X2
High level float sensor. X2 = ON when the liquid level reaches X2.
X10
T0
T1
Y0
Liquid A inlet
Y1
Liquid B inlet
Y2
Mixture outlet
Y3
Agitator
nfi
DVP-PLC Application Examples
3-15
nfi
Control Program:
X0
X1
X10
Y0
Y0
X1
X2
X10
Y1
Y1
X2
T0
X10
Y3
TMR
T0
T1
T0
K600
T1
K1200
X10
Y2
Y2
Y2
TMR
Program Description:
z
X0 = ON when START is pressed. Y0 will be ON and latched, and the valve will be opened
for infusing liquid A until the level reaches the low-level float sensor.
X1 = ON when the level reaches the low-level float sensor. Y1 will be ON and latched, and
the valve will be opened for infusing liquid B until the level reaches the high-level float
sensor.
X2 = ON when the level reaches the high-level float sensor. Y3 will be ON and activates the
agitator. Also, timer T0 will start to count for 60 sec. After 60 sec, T0 will be ON, and the
agitator motor Y3 will stop working. Y2 will be ON and latched, and the mixture will drain out
of the container.
When Y2 = ON, timer T1 will start to count for 120 sec. After 120 sec, T1 will be ON and Y2
will be OFF. The draining process will be stopped.
When an error occurs, press EMERGENCY STOP button X10. The NC contact X10 will be
ON to disable all the outputs. The system will then stop running.
nfi
3-16
3.11
nfi
Hot
Water
Coffee
Y1
X0
Coin Detector
Y0
Paper Cup Outlet
Y2
Mixing Container
X1
X2
X1
Y3
Y4
Control Purpose:
z
Making the paper cup come out of the outlet when a coin is inserted. At the same time, the
coffee pours in the mixing container. After 2 sec, the hot water pours in. 60 sec later, the
ready-made coffee will be pouring out from the coffee outlet.
Devices:
Device
Function
X0
T0
T1
Y0
Y1
Coffee outlet
Y2
Y3
Agitator
Y4
X1
Control Program:
X0
Y0
Y1
SET
Y0
SET
Y1
TMR
T0
nfi
T0
K20
3-17
nfi
T0
SET
Y2
RST
Y0
RST
Y1
RST
Y2
SET
Y3
TMR
T1
SET
Y4
RST
Y3
RST
Y4
X1
T1
K600
T1
X1
Program Description:
z
X1 = ON when a coin is inserted. Y0 and Y1 will be ON and latched. A paper cup will be sent
out, and a certain amount of coffee will be poured into the container at the same time.
Y0 and Y1 will be ON for 2 sec which is the set value of timer T0. When NO contact T0 is
ON, Y2 will be activated and the hot water will be poured in the container. At the same time,
the outlets of both paper cup and coffee will be closed.
When the liquid in the container reaches a certain amount of pressure, X1 = ON. Therefore,
the hot water outlet Y2 will be reset, and the agitator Y3 will be ON for 60 sec. After 60 sec,
NO contact T1 will be ON. Y4 will be ON and latched, and Y3 will be reset at the same time.
The agitator will stop working, and the ready-made coffee will be pouring out from the outlet.
When the coffee is poured into the paper cup completely, X1 will be OFF and Y4 will be
reset. The ready-made coffee outlet will be closed.
nfi
3-18
3.12
nfi
Control Purpose:
z
If a user stands in front of the urinal for more than 3 sec, the flushing control device will flush
the urinal for 3 sec (the first flushing). When the user leaves the urinal, flush for another 4
sec then stop automatically (the second flushing).
X0
Y0
3s
3s
Standing time
The first flushing
4s
Stopping the first flushing and starting the second flushing if the first user leaves the urinal
during the first flushing process.
X0
3s
Y0
3s
Standing time
4s
If the second user comes before the finishing of the 4 sec flushing, the flusher will finish the
4 sec flushing process and skip the first 3 sec flushing process. When the second user
leaves the urinal, the flusher will perform another 4 sec flushing.
The first user
X0
Y0
3s
Standing time
3s
The first flushing
4s
4s
The second flushing
Devices:
Device
X0
M0 ~ M2
Function
Infrared sensor. X0 = ON when a user is detected.
Internal auxiliary relay
T0
T1
T2
Y0
Flushing valve
nfi
3-19
nfi
Control Program:
X0
X0
TMR
T0
K30
SET
M2
SET
M0
TMR
T1
K30
TMR
T2
K40
ZRST
M0
M1
Y0
T0
M0
X0
M2
M0
M1
M1
T2
M0
T1
M2
Y0
X0
M0
T2
M1
X0
RST
M2
Program Description:
z
When a user is detected, infrared sensor X0 will be ON. In this case, T0 will be ON and start
to count for 3 sec. If the user leaves in 3 sec, X0 = OFF, and T0 will be OFF. No action will be
performed. If the user stands for more than 3 sec, the NO contact T0 will be activated, which
turns on M0. The first flushing will start (Y0 = ON).
M1 is latched in this program. If the user leaves after 3 sec, which means the NO contact M0
= ON and the NC contact X0 is OFF, M1 will be ON and latched. The second flushing will
then be started. After 4 sec, both the NO contact and the NC contact of T2 will be activated.
Therefore, Y0 will be OFF, and the flushing will be stopped. M0 and M1 will be reset.
Because M1 is latched, the second flushing process will certainly be executed whether X0
changes its state or not.
nfi
3-20
3.13
nfi
X0
Y0
X1
Car Washer
GO
Control Purpose:
z
Ensuring that the customers wash their cars for entire 5 minutes no matter how many times
the sprayer valve stops. .
Devices:
Device
Function
X0
X1
M1
T1
D10
Y0
Sprayer valve
Control Program:
X0
PLS
M1
MOV
D10
T1
TMR
T1
K3000
MOV
T1
D10
K0
D10
M1
T1
Y0
X1
MOV
nfi
3-21
nfi
Program Description:
z
When customers insert coins in the slot, X1 = ON. The time value of D10 will be cleared.
When customers compress the sprayer handle, X0 = ON. PLS instruction will be executed.
M1 will be ON for one program scan cycle, which starts T1 to count from 0 to 5 min (T1 =
K3000). In this case, Y0 = ON, and the sprayer valve is open.
If the sprayer handle is released, the timer will stop counting. The present value in the timer
will be saved and the water spraying will be interrupted.
When customers compress the sprayer handle again, the timer will start to count from the
value saved in D10. Because the present value of T1 is sent to D10 and saved when T1 is
working, the saved value will be sent to T1 as its present value when T1 is activated again.
Therefore, even if there are some interruptions of the sprayer valve in the washing process,
the program assures customers of entire 5 minutes car washing service.
nfi
3-22
3.14
nfi
X2
X0
X3
Teach
X1
Start
Manual Auto
Control Purpose:
z
In Manual mode, the engineers should adjust stamping time according to their experience.
The stamping time depends on the time of pressing Teach.
In Auto mode, if Start is pressed, the machine will perform stamping process once according
to the time value saved by Teach process.
Devices:
Device
Function
X0
X1
X2
Manual mode
X3
Auto mode
M1
T0
T1
D0
Y0
Y1
nfi
DVP-PLC Application Examples
3-23
nfi
Control Program:
X0
X2
X3
TMR
T0
K32767
TMR
T0
D0
Y0
X1
M1
X2
SET
M1
TMR
T1
X3
D0
T1
Y1
T1
RST
M1
Program Description:
z
X2 = ON when the switch is turned to Manual mode. X0 = ON when Teach is pressed. In this
case, coil Y0 will be ON and start the stamping process. At the same time, T0 will be
executed and its present value will be sent to D0. Release the button Teach when the
stamping process is completed. Y0 will be OFF, and the stamping process will be stopped.
X3 = ON when the switch is turned to Auto mode. Each time when X1 is pressed, Y1 will be
ON and the stamping process will be executed. At the same time, T1 will be activated to
count until it achieves the target value (the saved value in T0). When the stamping time is
achieved, the NC contact T1 and the rising edge trigger T1 will be activated and enable both
M1 and Y1 to be OFF. The stamping process will thus be stopped. When the button Start is
pressed again, M1 will be ON and repeats the same stamping process.
The timer teaching function can also be performed by using API 64 TTMR instruction.
nfi
3-24
3.15
nfi
Production Line 1
Production Line 2
Y0
Y1
Control Purpose:
z
Devices:
Device
Function
T0
M0
M1
Y0
Y1
Control Program:
T0
TMR
T0
K300
T0
M0
M0
Trigger Circuit
M1
M1
M0
M1
M1
Y0
M1
Y1
nfi
3-25
nfi
Program Description:
z
This program uses the NC contact T0 as the executing condition of the timer T0. When T0
reaches its set value, 30 sec, it will be activated. The trigger circuit will be executed to
change the state of M1. Production line 1 will then start working.
After 30 sec counting, T0 turns ON. The NC contact T0 will be activated. At the same time,
timer T0 will thus be OFF, which makes the NC contact T0 to be OFF again. In the next scan
period, because the NC contact T0 is OFF, timer T0 will start counting. After 30 sec counting,
T0 will be activated and so will the trigger circuit. In this case, M1 changes its state again.
Production line 1 will be stopped and production line 2 will start working.
By using the trigger circuit to activate Y0 and Y1 alternatively, the program makes the two
production lines to convey products alternatively.
nfi
3-26
3.16
nfi
Interesting Fountain
Y0
X0
Control Purpose:
z
z
Keeping the Running indicator in ON state when the Start button is pressed.
Enabling the following devices to start in order after Running indicator is ON for 2 sec:
middle sprayer light > middle sprayer valve > surrounding lights > surrounding sprayer
valves. Each of them will be ON for 2 sec.
Devices:
Device
Function
X0
T0
T1
T2
T3
T4
Y0
Y1
Y2
Y3
Surrounding lights
Y4
Control Program:
X0
Y0
X0
Y0
Y1
Y2
Y3
ZRST
Y1
Y4
TMR
T0
K20
SET
Y1
Y4
T0
T4
nfi
3-27
Y2
T2
Y3
T3
Y4
T4
nfi
Y2
Y3
Y3
Y4
TMR
T1
SET
Y2
RST
Y1
TMR
T2
SET
Y3
RST
Y4
TMR
T3
SET
Y4
RST
Y3
TMR
T4
RST
Y4
K20
Y4
K20
Y4
K20
K20
Program Description:
z
X0 = ON when the button Start is pressed. Coil Y0 will be ON to activate the Running
indicator. Y0 = ON is used as the executing condition for the timer T0. After 2 sec counting
down, T0 goes from OFF to ON and executes [SET Y1] instruction. The middle sprayer light
Y1 will be ON. The Running indicator Y0 will be kept in ON state through the whole working
process.
Likewise, Y1 = ON is used as the executing condition for the timer T1, and so does Y2 = ON
for the timer T2 as well as Y3 = ON for the timer T3. The executions will be assured in the
following order: Y1, Y2, Y3, and Y4.
The middle sprayer light, middle sprayer valve, surrounding lights, and surrounding sprayer
valves need to be started in order. Therefore, when T1, T2 and T3 go from OFF to ON and
set the next execution, they also reset the present execution. In addition, the NC contacts of
Y1, Y2, Y3 and Y4 are used for turning off timers T0, T1, T2 and T3.
After the completion of the last execution, the rising edge switch T4 will reset Y4 and set Y1.
The second round of fountain display will then be started again.
When X0 = OFF, coil Y0 will be OFF to turn off the Running indicator. In addition, ZRST
instruction will be executed at the same time. Y1, Y2, Y3 and Y4 will be reset and all the
valves and lights in the fountain will be stopped immediately.
3-28
nfi
DVP-PLC Application Examples
3.17
nfi
North-South Direction
East-West Direction
Control Purpose:
z
z
Enabling the traffic lights to work by Start button X0 and to stop by Stop button X1.
Setting the time of red light in East-West direction as 60 sec and North-South direction with
a heavier traffic as 30 sec.
The time of red light in East-West direction equals to the time of green light + green light
flashing + yellow light in North-south direction, and vice versa.
When yellow light is ON, cars and pedestrians should not cross the road, and yellow light
will last for 5 sec for the crossing cars and pedestrians to pass safely.
60 s
20 s
Green (Y1)
5s
5s
Yellow (Y2)
Red (Y10)
Green (Y11)
Yellow (Y12)
30 s
60 s
5s
5s
nfi
3-29
nfi
Device
Function
X0
Start button
X1
T0
Stop button
60 sec timer. Time base: 100ms
T1
T2
T10
T11
T12
T13
S0
Initial step
S10 ~ S13
S20 ~ S23
Y0
Y1
Y2
Y10
Y11
Y12
Control Program:
X0
PLS
M0
SET
S0
PLS
M1
ZRST
S0
SET
S10
SET
S20
X1
S0
S
S127
S10
S
Y0
TMR
T0
SET
S11
T0
3-30
K600
nfi
nfi
S11
S
Y1
TMR
T1
SET
S12
TMR
T2
K200
T1
S12
S
K50
M1013
Y1
T2
SET
S13
S
Y2
S20
S
Y11
S13
TMR
T10
SET
S21
TMR
T11
K500
T10
S21
S
K50
M1013
Y11
T11
SET
S22
S
S22
Y12
TMR
T12
SET
S23
K50
T12
S23
S
Y10
TMR
S13
S
S23
S
T13
K300
T13
S0
RET
Program Description:
z
When Start is pressed, X0 = ON. PLS instruction will be executed, and M0 will create a
rising-edge pulse to set T0. The program will enter the step ladder process.
nfi
When Stop is pressed, X1 = ON. PLS instruction will be executed, and M1 will create a
rising-edge pulse to execute [ZRST S0 S127] instruction. All steps will be reset and all traffic
DVP-PLC Application Examples
3-31
nfi
This example is designed by the application of the simultaneous divergence sequence. The
two sequences running simultaneously are East-West direction and North-South direction.
When the red light of East-West direction is ON, the corresponding state of North-South
direction will be the sequence of Green ON, Green Flashing and Yellow ON.
When the East-West direction sequence is finished (the yellow light is OFF), the
North-South direction sequence will be finished as well (the red light is OFF). The program
will return to the initial step S0.
When a step is transferred from one sequence to another sequence, the former sequence
will be reset including the step and output point Y.
The time of yellow light in East-West direction (Y2) is not controlled by a timer because
when the red light in North-South direction is OFF, the yellow light in North-South direction
will be reset at the same time. In this case, T13 is ON to redirect the program to initial step
S0, and the outputs (Y2 and Y10) corresponding to S13 and S23 will thus be reset.
nfi
3-32
nfi
1) What does PLC Stands for? What does scan time mean in PLC?
PLC stands for Programmable Logic Controller. Scan time is the time taken by PLC Processor to scan
the status of Input Terminals; save it in the memory; solving the PLC Logic & updating the results to
the output terminals. The scan time increases with the length of the program or if number of Input/
Output terminals increases.
2) Write a program code to blink an output for 10 sec .On time = .4 sec; off time =.6 sec.
3) Draw a wiring diagram to show connection b/w 3 PNP inductive sensor , 2 limit switches , 1 push
and 1 toggle switch at PLC I/p terminal
nfi
nfi
Proximity Switch
Limit Switch
L1
P1
P2
L2
P3
1-1IC1
P1
P2
P3
L1
L2
PB
TB
IN0
IN1
IN2
IN3
IN4
IN5
IN6
IN7
COM
4) How will you run Ac Induction motor with PLC? draw wiring diagram and write the code such
that When XO is ON, motor is latched and when XI is on motor is unlatched.
Case 1: When X0 is pressed once: Motor Starts & GREEN Light is ON
(Schematic Diagram Attached*)
nfi
nfi
5) How will you change the direction of DC motor using PLC? Make the wiring diagram and write
the code such that;
XO Fwd direction
X1Rew direction
X2Motor stops.
To Change Direction of DC Motor - Schematic Diagram
nfi
nfi
nfi
nfi
are created in a shield (Section 20-7 explains how to identify a ground loop). Leave the
other end cut back and unconnected, unless otherwise specified.
Repeat the wiring procedure for each wire in the bundle until the module wiring is
complete.
After all of the wires are terminated, check for good terminations by gently pulling on each
wire
7) How will you connect 1 NPN and 1pnp sensor to PLC input terminals? Make diagram.
To connect NPN & PNP Sensor to PLC Input Terminal: Schematic Diagram Attached*
NPN
PNP
PNP
1-1IC1
IN0
Relay
NPN
Relay
IN1
IN2
IN3
IN4
IN5
IN6
IN7
COM
8) What are the indicator lights on a PLC used for?
Indicator lights on PLC are used to monitor the status of Inputs & outputs of PLC ladder Logics. This
is widely used for troubleshooting PLC.
.
9) What will happen if the scan time for a PLC is greater than the time for an input pulse? Why?
If scan time is greater than input pulse time, then the input pulse will not be detected by PLC
correctly. Some of them may get missed by PLC
10) Difference B/w PLC and Desktop computer?
PLC is Industrial computer which can operate in Temperature ranges of 0 ~ 60 degree Celsius & has
dedicated real time processor which solves the logic & update the status at the output in specified
nfi
nfi
scan cycle. Whereas PC are used for computation task but not to control the outputs because it is
not real time operational.
11) Repeating a normal O/P in ladder logic should not be done normally. Discuss why?
If we repeat the normal output coil in ladder logic it may conflict the logic as shown under:
Now if X0 is ON in first ladder, Y0 gets ON but in second ladder Y0 should be OFF. So there
comes conflicting situation where PLC does not know which ladder to follow. Hence output coil
should only be taken once in the ladder diagram. Although you can make as many SET/RESET
commands for output coil.
12) Conveyor Problem :
A conveyor is run by switching on or off a motor. We are positioning parts on the conveyor with
optical detector. When optical sensor goes on, we want to wait 1.5 secs and then stop the
conveyor. After a delay of 2 secs the conveyor will start again. We need to use a start and stop
button a light should be on when conveyor is running and red light should be on when conveyor is
stopped.
Ladder Logic for Conveyor : Ladder Logic Code Attached*
nfi
nfi
13) What does edge triggered means? What is difference b/w positive and negative edge triggered?
Edge triggered means when a bit is energized it will output only a Pulse only, even if the
condition is TRUE for the time larger than pulse.
Positive edge triggered contact will gives the pulse when condition goes from FALSE to TRUE &
Negative edge triggered contact gives the pulse when condition goes from TRUE to FALSE.
14) Are reset instruction is necessary for all timers and counters?
No, general timers get RESET automatically when their conditions go from TRUE to FALSE
or on Power Reset. Where for retentive timers, RESET instruction is necessary. General counters
get reset by using RESET commands or by Power Reset but retentive counters retain their counts
on power reset, they need RESET instruction to get RESET
nfi
nfi
Practical Questions:
15) Derive a program where 3 conveyors are carrying different bottles A, B and C. 3 sensors are
employed to count the bottles. Calculate the total production for an hour, 8hour shift and whole day.
Take a button to reset the production
Ladder Logic for 3 Conveyor System Code Attached*
nfi
nfi
16) Do the calculation with ladders logic ;D7= - (5-D2/D4) {assume/move} D2= k4; D4= k2
nfi
nfi
17) Count the no. of buttons travelling on conveyor. When no. of buttons reaches 10, a green
light should on and motor/conveyor should stop. After delay of 5 seconds cycle should
repeat
nfi