[go: up one dir, main page]

0% found this document useful (0 votes)
83 views27 pages

PLC Excercises Using Ladder Diagram

The document describes a program for monitoring the speed of a production line using a PLC. Sensors detect pulses from a cam attached to the motor driving the line. The program calculates motor speed from pulse frequency, then uses this to calculate line speed. It displays the line speed and indicates if it is too high or low using indicators. Floating point instructions are needed as speed values contain decimals. A second example program performs floating point arithmetic operations to calculate 0.625 from given values.

Uploaded by

Toheeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views27 pages

PLC Excercises Using Ladder Diagram

The document describes a program for monitoring the speed of a production line using a PLC. Sensors detect pulses from a cam attached to the motor driving the line. The program calculates motor speed from pulse frequency, then uses this to calculate line speed. It displays the line speed and indicates if it is too high or low using indicators. Floating point instructions are needed as speed values contain decimals. A second example program performs floating point arithmetic operations to calculate 0.625 from given values.

Uploaded by

Toheeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

11.

Floating Point Operation Design Examples

11.1 Elementary Arithmetic for Integer and Floating Point

O O
F
F N X0
Start/Stop

Proximity switch
X1

Product under process

Motor

Control Purpose:

When the production line runs, the production control engineer needs to monitor its
real-time speed. The target speed is 1.8 m/s.

The motor and the multi-tooth cam rotate with the same axis. There are 10 teeth on the cam,
so the proximity switch will receive 10 pulse signals when the motor rotate once and the
production line will move forward for 0.325m. The equations are as follows:

Motor rotation speed (r/min) = the received pulses in 1 min/10

The speed of the production line = the rotation times of motor in 1s × 0.325 = (Motor rotation
speed/60) × 0.325.
Indicator status: Production line speed < 0.8 m/s, the Speed Low indicator will be ON. 0.8
m/s production line speed 1.8m/s, the Normal indicator will be on. Production line speed
>1.8m/s, the Speed High indicator will be on.
Display the production line speed for production control engineers to monitor.

Devices:

Device Function

X0 Pulse frequency detecting switch. X0 = ON when Start is switched on.


X1 Proximity switch. X1 creates a pulse when a tooth on cam is detected.
D0 Storing the detected pulse frequency
D50 Storing the present speed of the production line

DVP-PLC Application Examples 11-1


11. Floating Point Operation Design Examples

Control Program:

11-2 DVP-PLC Application Examples


11. Floating Point Operation Design Examples

Program Description:

Calculate the motor rotation speed (r/min) by using SPD instruction to detect the pulse
frequency (D0) from the proximity switch. Motor rotation speed = the receiving pulses in
1min/10 = (pulse frequency × 60)/10 = (D0×60)/10.
The following equation is for obtaining the production line speed through D0:
V: Production line speed
N D 0 60 10 D0 (unit: m/s)
v= 0.325 = 0.325 m/s= 0.325 m/s
60 60 10 N: Motor speed (unit: r/min)
D0: Pulse frequency
50
If the detected pulse frequency D0 = K50, the production line speed = 0.325 m/s
10
=1.625m/s by the above equation

The parameter of present production line speed contains decimal points during calculation,
therefore the binary floating point operation instruction is needed for performing the
calculation. .

DEZCP instruction is used to compare the present speed with the upper/lower speed limits
and the comparison results will be stored in M0~M2.
There are integers and floating points mixed in the operation. If the operational parameters
are not binary floating point values before calculating the production line speed, they have
to be converted by FLT instruction
For monitoring easily, the speed value is multiplied with 1000 to obtain the integer in the end
of this program

DVP-PLC Application Examples 11-3


11. Floating Point Operation Design Examples

11.2 Elementary Arithmetic for Floating Point

Control Purpose:

Perform the operation (1.236+1.324)×2.5÷10.24 by Delta’s binary floating point operation


instruction.

Devices:

Device Function

X0 Initialization switch
X1 Operation control switch

Control Program:

11-4 DVP-PLC Application Examples


11. Floating Point Operation Design Examples

DVP-PLC Application Examples 11-5


11. Floating Point Operation Design Examples

Program Description:

When X0 = ON, sent the values of decimal integers to D0~D7 to form 4 decimal floating
points.

When X1 = ON, elementary arithmetic operations for binary floating points will be executed.
The binary operational results are not intuitively understandable. Therefore, the binary
floating point value would generally be converted into decimal floating point value. In this
program, the binary values in (D105, D104) are converted into decimal values in (D107,
D106) D106 = K6250, D107 = K-4, so the decimal floating point value 6250×10-4 = 0.625.

11-6 DVP-PLC Application Examples


11. Floating Point Operation Design Examples

MEMO

DVP-PLC Application Examples 11-7


12 . Real Time Calendar Time Design Examples

12.1 TRD/TWR/TCMP - Office Bell Timing Control

Control Purpose:

There are 4 moments the office bell will ring: on-duty / off-duty time in the morning and
on-duty / off-duty time in the afternoon. When the time is reached, the bell will ring
immediately and last for 1 minute. Users can set the 4 moments and adjust the current time
at any time.

Set the ringing time and adjust the current time.

Devices:

Device Function

M0 Adjust current time


M1 Start the office bell
Y0 Ring the office bell
D0~D6 Store the read Real Time Clock (RTC) data
D200~D206 Store the RTC data to be written in PLC
D300~D311 Store the on-duty / off-duty time

Control Program:

DVP-PLC Application Examples 13-1


12 . Real Time Calendar Time Design Examples

13-2 DVP-PLC Application Examples


12 . Real Time Calendar Time Design Examples

Program Description:

The value in D200~D206 and D300~D311 can be set by WPLSoft or HMI.

To avoid the execution error of TWR instruction, the program uses [FMOV K1 D200 K4]
instruction at the beginning. This program operates only the data of Hour/Minute/Second in
D204~D206 but not the data of Year/Day/Month/Date in D200~D203. For TWR instruction,
the setting range: 00~99 for Year, 1~7 for Day(Mon ~Sun), 1~12 for Month and 1~31 for
Date. If the values in D200~D203 are out of the above range, the program will regard it as
an operation error and the instruction will not be executed and the Hour/Minute/Second data
can’t be written either. Therefore, the program sets the Year/Week/Month/Day to K1 to fit the
above range and makes sure TWR instruction can be executed for writing in
Hour/Minute/Second data.

D4, D5 and D6 store the Hour/Minute/Second of the current time read form RTC.

DVP-PLC Application Examples 13-3


12 . Real Time Calendar Time Design Examples

12.2 TRD/TZCP - Control of Warehouse Automatic Door


Y2/Y3

Open Close
X6 X0 X1
Open Close
X4
X2 X3

Y0/Y1

X7

Control Purpose:

The opening hours of the warehouse are from 7:30~22:30, so the door should open at 7:30
and close at 22:30 automatically.

There are 2 sets of control buttons(Open/Close) in the control room for opening or closing
the door manually for special situations.

Devices:

Device Function

X0 Manual open button for door 1 .


X1 Manual close button for door 1
X2 Manual open button for door 2
X3 Manual close button for door 2
X4 Upper sensor of door 1.
X5 Lower sensor of door 1.
X6 Upper sensor of door 2.
X7 Lower sensor of door 2.
Y0 Motor of door 1 run forward to open the door
Y1 Motor of door 1 run reverse to close the door
Y2 Motor of door 2 run forward to open the door
Y3 Motor of door 2 run reverse to close the door

Control Program:

13-4 DVP-PLC Application Examples


12 . Real Time Calendar Time Design Examples

DVP-PLC Application Examples 13-5


12 . Real Time Calendar Time Design Examples

Program Description:

The program performs control of warehouse automatic door by a RTC Time Zone Compare
instruction (TZCP). Through the Time Read instruction (TRD), the current time in RTC can
be read in D0~D6. D4, D5 and D6 store the Hour/Min/Sec data.

13-6 DVP-PLC Application Examples


12 . Real Time Calendar Time Design Examples

When Y0 = ON, the motor of door 1will run forward to execute opening action until upper
sensor is activated (X4 = ON).

When Y1 = ON, the motor of door 1 will run reverse to execute closing action until the lower
sensor in activated (X5 = ON).

The opening and closing actions of door 2 are the same with that of door 1.
For some special situations, the opening and closing actions of door 1 and door 2 can also
be performed by pressing manual open buttons (X0/X2) and manual close buttons (X1/X3)
in the control room.

DVP-PLC Application Examples 13-7


12 . Real Time Calendar Time Design Examples

12.3 HOUR - Control of Switching Motors after a Long Time Running

Control Purpose:

Controlling the automatic motor switching between main motor and auxiliary motor.

In some special applications, we use several motors running by turns to protect each motor and
extend their service life. In this program, there are 2 motors running by turns in the cycle: 2 days
(48 hours) for the main motor, then 1 day (24 hours) for the auxiliary motor.

Devices:

Device Function

X0 Start/Stop of the motor


Y0 Starting the main motor
Y1 Starting the auxiliary motor
M10 M10 = ON when set time of the main motor reached
M11 M11 = ON when set time of the auxiliary motor reached
D0~D1 Storing the current running time of the main motor
D2~D3 Storing the current running time of the auxiliary motor

Control Program:

13-8 DVP-PLC Application Examples


12 . Real Time Calendar Time Design Examples

Program Description:

When X0 = OFF, Y0 and Y1 = OFF, both main / auxiliary motor will not run.

When X0 = ON, the running status of Y0 (main motor) and Y1 (aux. motor) will be decided
by the ON/OFF status of M0 so as to control the two motors running in turns.

For main motor, D0 and D1 record the current time measured in hour and the current time
that is less than an hour (0~3599s). For auxiliary motor, D2 and D3 record the current time
measured in hour and the current time that is less than an hour (0~3599s).
16-bit instruction supports the set time up to 32,767 hours and 32-bit instruction supports
the set time up to 2,147,483,647 hours.
The timer will go on timing after the set time is reached. For restart timing, users need to
clear the current time stored in D0~D3 and reset flag M10 and M11.

DVP-PLC Application Examples 13-9


13. Handy Instruction Design Examples

13.1. ALT - Auto Blackboard Cleaner

(Left side limit switch) X1 (Right side limit switch) X2

Y0 Y1
Move Left Move right

X0(Clean)

Control Purpose:

Controlling the auto cleaner to move left / move right when Clean is pressed.

When the auto cleaner touches the limit switches of left side or right side, the cleaner will
stop. Next time when Clean is pressed again, the cleaner will move to the opposite direction.

Devices:

Device Function

X0 X0 = ON when Clean is pressed.


X1 X1 = ON when left side limit switch is touched.
X2 X2 = ON when right side limit switch is touched.
Y0 Move left
Y1 Move right

DVP-PLC Application Examples 15-1


13. Handy Instruction Design Examples

Control Program:

Program Description:

When Clean is pressed, X0 will be activated one time to execute ALT instruction. M0 will be
ON, the cleaner will move left until it touches the left side limit switch. X1 = ON, and Y0 will
be OFF. The cleaner will stop working.
When Clean is pressed again, X0 will be activated again to switch the ON status of M0 to be
OFF. Therefore, Y1 will be ON and the cleaner will move right until it touches the right side
limit switch. X2 = ON, and Y1 will be OFF. The cleaner will stop at the current position.
Wherever the location of the cleaner is, the cleaner will move to the opposite direction every
time when Clean is pressed.

15-2 DVP-PLC Application Examples


13. Handy Instruction Design Examples

13.2. INCD - Traffic Lights Control (Incremental Drum Sequencer)

Vertical direction

Horizontal direction

Control Purpose:

Performing traffic lights sequence control at the intersection. In both vertical and horizontal
directions, the traffic lights are set as the following sequence: Red lights ON for 60s , Yellow
lights ON for 3s and green lights ON for 52s and green lights flashing for 5s.

The timing diagrams are as follows:

60s

Red

3s
Yellow

Green
52s 5s

Red 60s

3s

Yellow

Green
52s 5s

DVP-PLC Application Examples 15-3


13. Handy Instruction Design Examples

Devices:

Device Function

X1 Switch of the traffic lights control program


Y0 Red light (vertical)
Y1 Yellow light (vertical)
Y2 Green light (vertical)
Y5 Red light (horizontal)
Y6 Yellow light (horizontal)
Y7 Green light (horizontal)

Control Program:

15-4 DVP-PLC Application Examples


13. Handy Instruction Design Examples

DVP-PLC Application Examples 15-5


13. Handy Instruction Design Examples

Program Description:

“Incremental Drum Sequencer” is a concept performing repetitive step-by-step process. In


this program, when present value in counter C0 reaches the set value in D 500~D505, the
corresponding output devices M100~M105 will be ON and counter C0 will be reset for
executing next step.

In order to simplify the program, INCD (Incremental Drum Sequencer) instruction is used
here to control the traffic lights.

Before the execution of INCD instruction, use MOV instruction to write all the set values into
D500 ~ D505 in advance.

Set value Output device Set value Output device

D500 = 52 M100 D503 = 52 M103

15-6 DVP-PLC Application Examples


13. Handy Instruction Design Examples

D501 = 5 M101 D504 = 5 M104


D502 = 3 M102 D505 = 3 M105

DVP-PLC Application Examples 15-7


13. Handy Instruction Design Examples

13.3. ABSD - Adding Materials in Different Intervals (Absolute Drum Sequencer)

Control Purpose:

Adding A, B, C materials for production during specified intervals within 60 sec.

Adding material A in the intervals of 10s~20s, 30s~40s and 50~55s, material B in the interval
of 0~10s, 20s~25s and 40s~50s, and material C in the interval of 20s~25s, 30s~35s and
40s~45s.

Devices:

Device Function

X0 Switch of material adding control program


Y0 Adding material A
Y1 Adding material B
Y2 Adding material C

Control Program:

15-8 DVP-PLC Application Examples


13. Handy Instruction Design Examples

DVP-PLC Application Examples 15-9


13. Handy Instruction Design Examples

15-10 DVP-PLC Application Examples


13. Handy Instruction Design Examples

Program Description:

“Absolute Drum Sequencer” is a concept performing repetitive process consists of multiple


steps which could be executed in the same interval. In this program, when present value in
counter C0 reaches the set value in D 500~D517, the corresponding output devices
M100~M108 will be ON to execute specified actions within single interval.

Before the execution of ABSD instruction, use MOV instruction to write all the set values into
D500 ~ D517 in advance.

Set value Output device Set value Output device

D500 = 10 M100 D509 = 25 M104


D501 = 20 M100 D510 = 40 M105
D502 = 30 M101 D511 = 50 M105
D503 = 40 M101 D512 = 20 M106
D504 = 50 M102 D513 = 25 M106
D505 = 55 M102 D514 = 30 M107
D506 = 0 M103 D515 = 35 M107
D507 = 10 M103 D516 = 40 M108
D508 = 20 M104 D517 = 45 M108

DVP-PLC Application Examples 15-11

You might also like