PLC Lab Manual
PLC Lab Manual
PROGRAMMABLE LOGIC
CONTROLLER
Laboratory Manual
Name: .
Roll no: ...
Course: B. Tech. . Year Semester...
Branch: ...
CONTENTS
LIST OF EXPERIMENTS
Experiments on Millenium FBD Logic:
1.
2.
3.
4.
5.
6.
7.
Logic Gates
Latching and Unlatching
Interlocking
Sequential operation of ON/OFF of a set of lights
Counters
normally-on switch in parallel with a light bulb will light the bulb when the button's pushed;
otherwise, current will flow through the switch, leaving the bulb off.
Non-Momentary Contact
Non-momentary switches take one push to turn on, another to turn off. TVs and stereos use nonmomentary switches for their power buttons.
Ratings
For reliability and safety, switches are rated for current and voltage. This is necessary since
higher voltage or current requirements call for larger, more expensive parts, and switches, like
most parts, are only as large as necessary. Cell phones and portable radios have small
requirements; industrial machines have large requirements.
Each one of the above applications in push button technologies can be experimented on the PLC.
A set of four experiments are carried out as follows:
Push Button Functions
EXPERIMENT -2
Working Of Different Types Of Timers
Use Of ON Delay Timer and OFF Delay Timer For Process Control
Different types of timers are explored.
1.
2.
3.
4.
5.
AC Timer
BW Timer
Li/L Timer
B/H Timer
Totalizer function
HARDWARE REQUIREMENTS:
1.
EXERCISE:
1. Show application of all the different types of timers in hardware.
EXPERIMENT -3
Working Of Different Types Of Counters
Application Of Counters In Process Control.
Different types of counters are explored
1. Preset Counter
2. UpDown Counter
3. HighSpeed Counter
HARDWARE REQUIREMENTS:
1. 8 lights of 240V, 10W (4 green and 4 red)
2. An arrangement for lights as shown in figure
3. Set of single stranded wires
4. Relay card
Application Of Counters In Process Control
EXERCISE:
1. Implement on hardware all the different types of counters.
EXPERIMENT -4
Sequential Operation Of ON/OFF Of A Set Of Lights
Sequential Operation Of Lights (One After Another)
A set of 8 lights are made to operate sequentially one after another with a preset timer, controlled
with a single input.
HARDWARE REQUIREMENTS:
1. 8 lights of 230V, 10W
2. Set of single stranded wires
3. Relay card
Sequential Operation Of Devices (One After Another).
EXERCISE:
1. All the 8 lights should be ON for 5 sec and OFF for 5 sec , the process continues till a
stop button is pressed.
2. All the 8 lights should be ON and they should get automatically OFF from 8th to first
sequentially with a certain time delay.
10
11
EXPERIMENT -5
Latching and Unlatching of a Motor
When A Button Is Pressed Once The Motor Is Started And Another Button Is Pressed To
Stop The Motor.
There are two input push button controls, one start button and one stop button. If start button is
pressed, motor is ON and even if start button is OFF position the motor continues to run. To stop
the machine stop button is used.
The above technique is called latching and unlatching.
HARDWARE REQUIREMEMNTS:
1. 1 single phase induction motor
2. NO/NC contactor / relay
3. 2 push button switches for start and stop operations.
Motor Control using Push Button
EXERCISE:
1. Three motors: main motor, lubrication pump and a cooling fan are to be controlled in
following way - the main motor is ON for 10 sec, lubrication pump is ON/OFF
alternately for 3 sec three times and after the process is done the cooling fan runs for 10
sec and the whole process repeats till a stop button is pressed.
12
13
EXPERIMENT -6
Automatic Indication Of Water Tank Level
Tank Level Control With Automatic Level Indication By Analog Input
The full and empty levels of water in the tank are indicated using different lights. The levels are
sensed using a sensor.
HARDWARE REQUIREMENTS:
1. 2 lights of 240V, 10W (1 green and 1 red)
2. An arrangement for water tank
3. 2 sensors
4. Set of single stranded wires
5. Relay card
Tank Level Control With Automatic Level Indication By Analog Input
EXERCISE:
Implement the above experiment in hardware and also extend the same for an automatic control
of filling the tank when the empty indication is shown.
14
15
EXPERIMENT -7
Traffic Lights Indication
Automatic Traffic Lights Control
The green light in L1 and red lights in L2, L3, L4 are periodically
shifted with preset time delay.
HARDWARE REQUIREMENTS:
1. 8 lights of 240V, 10W (4 green and 4 red)
2. An arrangement for lights as shown in figure
3. Set of single stranded wires
4. Relay card
Traffic Lights Control
EXERCISE:
1. Implement the above experiment in hardware and extend the same logic with three lights
in each lane.
2. Implement the same logic using sensors instead of timers.
16
17
OR Logic:
NOT Gate:
EXERCISE:
1. Implement NAND and NOR logics.
18
19
EXPERIMENT -2
Latching and Unlatching
When A Button Is Pressed Once The Output Is ON And Another Button Is Pressed To
Stop The Output.
There are two input push button controls, one start button and one stop button. If start button is
pressed, output is ON and even if start button is OFF position the output is still ON. To make the
output OFF, stop button is used.
The above technique is called latching and unlatching.
Latching And Unlatching An Output:
EXERCISE:
1. Ladder logic for the following motor control specifications:
A motor must be started and stopped from any one of the start/stop pushbutton
stations.
Each start/stop station contains one NO start button and one NC stop button.
Motor OL contacts are to be hardwired.
20
21
EXPERIMENT -3
Interlocking
Interlocking is a kind of application when there are two devices and they are not required to
operate at the same time. If one is ON the other should be OFF and vice versa.
This method of control is called interlocking.
Interlocking Of Two Devices:
EXERCISE:
1. A pump is to be used to fill two storage tanks. The pump is manually started by the
operator from a START/STOP station. When the first tank is full, the control logic must
be able to automatically stop flow to the first tank and direct flow to the second tank
through the use of sensors and electric solenoid valves. When the second tank is full, the
pump must shut down automatically. Indicator lamps are to be indicated to signal when
each tank is full.
22
23
Experiment -4
Sequential Operation Of On/Off Of A Set Of Lights
Sequential Operation Of ON/OFF Of Lights Using Timers
Three lights are switched on and the lights are automatically off in a given sequential order with
a preset time delay using a timer.
Sequential Operation Of ON/OFF Of Lights Using Timers
EXERCISE:
1. Implement alternate ON/OFF of 8 lights with a certain time delay.
2. Automatic switch ON of 8 lights one by one with a certain time delay and switch off one
by one.
3. Decorative flickering of ON/OFF of lights continuously till a stop button is pressed.
24
25
EXPERIMENT -5
Counters
Counters are demonstrated using ladder logic. Different types of counters like upcounting,
downcounting, preset counting etc also can be explored.
Upcounting is shown in the following logic.
Upcounting Of Pulses To A Preset Value:
EXERCISE:
1. Make a program to increase the counter by one with each pulse from the pulse generator
(on rising edge), and decrease another counter by the same pulse.
2. Write a program that will increment a counters accumulated value 1 count for every 60s.
A second counters accumulated value will increment 1 count every time the first
counters accumulated value reaches 60. The first counter will reset when its accumulated
value reaches 60, and the second counter will reset when its accumulated value reaches
12.
3. Implement in hardware, speed measurement in rpm using a bicycle gear wheel by
counting the number of tooth using a proximity sensor.
26
27
OR: Parallel operation: the output is high when any one of the inputs is high or both are high.
28
NOT: Inverted operation: the output is high when input is low and vice versa.
EXERCISE:
1. Implement NAND and NOR logics.
2.
29
30
EXPERIMENT -2
Latching And Unlatching Of A Motor
When A Button Is Pressed Once The Motor Runs And Another Button Is Pressed To Stop
The Motor Stops.
There are two input push button controls, one start button and one stop button. If start button is
pressed, motor is ON and even if start button is OFF position the motor continues to run. To stop
the motor, stop button is used.
The above technique is called latching and unlatching.
EXERCISE:
Implement on hardware for latching and unlatching using pushbuttons for
(i)
Single phase induction motor
(ii)
Three phase induction motor
31
32
Experiment -3
Forward And Reverse Direction Control Of Motors
Two push buttons are used to control the direction of rotation of a motor. If two phases of a three
phase induction motor are interchanged, the direction of rotation of a motor is reversed. The
same principle is programmed using ladder logic.
The two switches named forward and reverse are used to switch the direction of rotation of
the motor.
EXERCISE:
1. Implement the same experiment on hardware.
33
34
35
output forcing) updates the simulation windows. You can simulate a power failure or
program timing, modify analog variables via the Milleniums virtual screen, or create a
time-based jump event without changing the time on the PC.
3. Monitoring Mode:
When in Monitoring mode the program is executed on the controller and the programming
workshop is connected to the controller (PC
view machine operation in near real time on your PC, modify parameters via the front panel,
or conduct progressive debugging and validate each part of the application.
In simulation and monitoring modes, it is possible to:
1. View the output states and function block parameters of the program corresponding to the
wiring sheet in the supervision window.
2. Force the inputs/outputs to test program behavior under specific conditions.
GETTING STARTED WITH THE MILLENIUM-3
The MILLENIUM 3 is programmed using the CLS M3 software workshop. It should
therefore be connected to your PC. You cannot create or modify a program from the
Millenium front panel.
PC Resources:
PC Pentium II 300 MHz (600 MHz recommended), 128 Mb of RAM memory (256 MB
recommended). Compatible with windows 2000, NT 4.0 SP5, XP, Vista and Windows 7.
Installing The Software Workshop:
If you have the M3 SOFT CD ROM (Part Number 88 970 111) insert it into your PC and
follow the instructions.
The programming software is also available for download from www.crouzet.com.
Once downloaded extract the files and run the Setup.exe file. This will start the installation
process.
Multiple installations are possible with the different available languages: English,
French, German, Italian, and Spanish.
Connection To The pc
The connection with your PC can be made with any of the following options:
1. Via the USB cable, P/N
88 970 109.
36
M3 Software Environment:
Accessing Help:
The CLS 3 software workshop Help is accessible from the menu bar by clicking on ? then Help,
or by clicking on the ? icon on the Standard Toolbar.
Help is also available for each function block. Just double click on the function block and then
click on the ? button.
37
Toolbars
The toolbars contain shortcuts to elements in the menu.
The Controller Toolbar
This toolbar is used to manage actions on the Millenium and also to select the application
mode (Editing, Supervision, Monitoring). Passing the cursor over the button icon displays
the action associated with the button.
The Controller Toolbar
This toolbar is used to manage actions on the Millenium and also to select the application
mode (Editing, Supervision, Monitoring). Passing the cursor over the button icon displays
the action associated with the button.
FUNCTIONS
Note: The following descriptions are illustrated in some cases with working examples. Doubleclick on the file icon to open the application, then select Simulation mode.
38
1.
Inputs/Outputs:
DI
The type of Discrete input can be selected from the Parameters window. This is displayed in the
edit and supervision windows. These include: Discrete input, Contact, Limit switch, Proximity
sensor, Presence sensor, Illuminated pushbutton, Selector switch, Pushbutton, and Normally
open relay.
DI.pm3
AI (Analog Input): Analog inputs are only available on DC powered controllers. This
type of input can accept an input voltage of 0 to 10 VDC, or 0 to Controller Supply
Voltage (Potentiometer), corresponding to an internal value of 0 to 1023.
AI.pm3
DI_1.pm3
interference.
39
DO.pm3
PWM (Pulse Width Modulation) output: PWM outputs are available on controllers
with solid state (transistor) outputs. The value on this type of outputs can vary between 0 and
255.
The frequency for the PWM outputs on the base controller is set during programming by clicking
on the
button at the top of the wiring sheet and then going to the Configuration tab. This basic
frequency can be selected from 14 Hz to 1806 Hz
PWM.pm3
40
2. Control Functions:
Timers: You can select between 5 different types of timer functions.
After you place a timer block on the wiring sheet you can check the External setpoint box, if
required: in this case the time delay setpoints will be integer-type inputs rather than being
internal configurable parameters.
Timer A-C: Applies an ON delay, an OFF delay, or both delays to the output
signal in relation to the input signal.
41
Timer B/H: Generates a pulse (the time can be configured) on a rising edge of the
input.
Totalizer function: It allows to count for how long the input has been held
active (or inactive, depending on the mode selected). If the input is in the rest
condition then the timing progress is held.
Several types of totalizer modes can be selected from the Parameters window:
At, Ht, T, and Tt.
Trigger: The output changes state if the input is lower than Schmitt the
minimum value, and the output changes state again if the input is higher
than the maximum value. If the input is between the two, the output remains
unchanged
Bistable: Provides the functionality of an impulse relay. An initial impulse sets the
output to 1 then a second impulse is required to change the output back to 0.
42
Set-Reset:Element consisting of two inputs: R for Reset and S for Set. To activate the
output, simply generate a pulse on S; to deactivate it, generate a pulse on R. The priority
defines the output state when both inputs are at 1.
Comparison of two values: Compares two analog values using the >, , =, , ,
and < operators. The output is discrete and its activated if the comparison is true.
Zone comparison: Compares a value between two setpoints (the min and max
values delimit the zone).
43
Time Prog (Daily, Weekly and Yearly Programmer): Activates or deactivates the
output at a precise moment in the day, week or year. This block works on the event
principle. To create an event, go into the Parameter tab, enter an active event number.
Choose the time when this event occurs, then define the state of the output at this instant.
You can select the frequency of this event. You can use the calendar at the right of the
screen.
44
Preset Hour Counter: Measures the duration of the input state at 1. After a preset
duration, the output changes state. This block can, for example, be used as an alert on a
machine for maintenance purposes.
3. HMI/Communication Functions:
Display on the LCD Screen: Displays text or an integer on the LCD screen on the
controller front panel. For example, you can display a decimal derived from an integer.
For more details, please refer to the example.
The Display function is used to display text, variables, and the time and date on the Millenium
display.
You can have up to 8 Display blocks active. They are placed on the screen based on the
numbering. If you have more than 8 Display blocks active at the same time only the first 8 blocks
will be displayed.
The function window is used for displaying the variable with decimal places and f o r editing the
text.
45
TEXT function: Displays text and/or numerical values on the LCD screen on the
controllers front panel. You can connect up to 4 numerical values to the same block
and locate them, along with text, on the screen. You can also display the date and time
and the calibration value for the clock drift.
This function doesnt allow for any special formatting on the numerical values. If that is
required then the Display block has to be used.
You can only have one Text block active at the same time, since it covers the entire screen.
If you have more than one active only the block with the highest number will be displayed.
46
SL In, SL Out: Used for transmitting and receiving data via a serial link
through the programming port of the controller. You have 24 input
addresses and 24 output addresses. The SL In Protected block is used when
you want to protect the data in case of a power failure.
4. Programming Functions:
Constants: You can use constants to set values on certain function
blocks. There are both numerical and discrete constants
YES, YES NUM: These function blocks are very useful on macros. They allow
for an input to be connected to several blocks inside a macro. The YES block is
for discrete signals and the YES NUM block is for numerical signals.
47
Memory function: Used for saving a numerical value. When the Archive
input changes from 0 to 1 the value at the output is replaced by the value on
the input. You can select whether you want to keep this value or not in case of
a power failure.
Gain: Allows the use of a scale factor and is applicable to all analog data.
Example: This is a program which uses a counter, a comparator, a gain and the counter readout display. An alarm is activated after the sensor has been passed 20 times.
In this example, the chosen display is 1/100C and therefore all the parameters of the Schmitt
Trigger function and the Gain function should be multiplied by 100 with the exception of the
1023 denominator constant.
48
GAIN_1.pm3
49
4 inputs and 1 output and another version with 6 inputs and 2 outputs.
Only the inputs connected are taken into account.
BOOLEAN.pm3
SFC functions are similar to Grafcet language. The principle is simple, since it involves
sequential programming, with steps succeeding one another surrounded by transitions. When a
step is active, wait for the next transition to become active in order to go to the next step.
STARTING AN APPLICATION
1. The Edit window
Select New File and click the of Millenium that you have chosen. Select the part number
corresponding to the controller.
50
The edit window opens with a blank wiring sheet and you are ready to build your application.
The part number of the selected Millenium controller then appears at the top of the wiring sheet.
Blocks are positioned by clicking on the block, holding down and dragging it onto the
programming page. Links between blocks are created directly by selecting block inputs and
outputs. In the wiring mode tool, you can choose wire as the wiring type, and you will see the
links between the various elements. If you choose text mode, the links will be marked but they
will no longer be visible.
To change this parameter, right-click on a link and select the wiring type: wire or text.
51
element and click on the icon associated with the desired action in the toolbar.
2. Editing your program: Edit mode
At the top of the wiring page you can see these three buttons.
1. By clicking title Author, you can write in the project name, date and author.
2. By clicking Program, you can select the application cycle duration (10ms by
default).
3. Then you can choose the date format.
4. If you are using PWM outputs, you can select the frequency of all the PWM
outputs (by default 1806.37 Hz).
To build your application:
Select the input blocks and place them on the input terminals, select the output blocks and
place them on the output terminals.
Select the function blocks, create the wiring between the various points. Double-click on the
functions in order to set the parameters.
Each function block is numbered in the order of placing the blocks on the programming page.
Deleting blocks results in a break in the numbering. To renumber, select the blocks then Tools,
Renumber functions.
In text mode wiring, each link is numbered in the order of placing the wiring on the wiring
page. Deleting links results in a break in the numbering. To renumber, select the links then
Tools, Renumber links.
By selecting a number of blocks, you can align them according to the icon on the Draw bar. Align
left, right, center, etc.
Supervision:
Select window then Supervision. Simply drag the inputs/outputs and function blocks of your
choice from the wiring page to the supervision window. You can illustrate your application
using the draw tools. You can also choose a .BMP background image by right-clicking in the
supervision window; Modify background, Bitmap.
52
This window explicitly displays the elements you have dragged from the wiring page in
their own environment. When you change to simulation or monitoring mode, the inputs and
the outputs are updated; it is also possible to force an input in the same way as with the edit
window. Here is an example of using supervision mode:
SUPERV.pm3
Import
You have the option of recovering all or part of the programming page of an existing file. To import a
wiring scheme, you should already have opened a file. First select File, then Import. Next choose the
file to be imported. When importing a wiring scheme, you will see that the previously opened file
stays open. You can therefore drag a selection from the edit window of the imported wiring scheme to
the edit window of the previous wiring scheme.
3. Testing your program: Simulation mode
Our software also lets you fully test your program before implementing it. Simply select S or
simulation mode. Simulation on discrete or analog inputs can be temporary or permanent.
Force the input or output by clicking on the link or on the input or output pin. It is not
necessary for the controller to be connected to the PC to perform simulation.
Front Panel Display
In simulation mode, click on Window then on Front Panel. The keys illustrated on the front
panel are activated by clicking and holding down.
Simulation Mode Parameters
The monitoring/simulation bar is used to change the number of cycles executed at each
simulation stage, and is similar to a time multiplier. Moreover, the refresh period is the
frequency at which the output and parameter values are updated in the application window.
53
To write data to the controller, it must be in STOP mode. After the program has been stopped go
into the Controller menu, click on Write to the controller.
This option will open the Compilation Results window. If the compilation is successful then
following windows appears:
54
55
56
57
STEP 4: Use The PLC Tags In The Tag Table For Addressing The Instructions
58
59
60
61
62
STEP 8: Create A Network Connection Between The CPU And HMI Device
63
64