Sunteți pe pagina 1din 33

EPT 352 - INSTRUMENTATION & CONTROL SYSTEM

LAB1

LAB 1

Writing and Simulating a Basic Ladder Diagram & OR Logic, Latching and
Unlatching Output, One Shot Rising.

OBJECTIVES:
In this activity you will accomplish the following:
• Write and run a PLC program.
• Program with the input instruction XIC (eXamine If Closed).
• Program with the output instruction OTE (OutpuT Energize).
• Program with the input instruction XIO (eXamine If Open).
• Implement NOT logic in a ladder diagram.
• Implement AND logic in a ladder diagram.
• Load and modify an existing PLC program.
• Program a ladder diagram to control a Conveyor.
• Implement OR logic in a ladder diagram.
• Program with output instruction OTL (OutpuT Latch).
• Program with output instruction OTU (OutpuT Unlatch).
• Program with the OSR (One Shot Rising) input instruction.
• Program a ladder diagram to control a Gate.
• Program a ladder diagram to control a Ice Cream.

SKILLS
In this activity you will develop the following skills:
• Systems: understand systems.
• Resources: manage time.
• Information: acquire/evaluate information; uses computer to process information;
interprets/communicates information.
• Basic: reading.
• Thinking: knows how to learn.
• Personal: responsibility and self-management.

OVERVIEW - Writing and Simulating a Basic Ladder Diagram

PLC Scan
A PLC can be programmed using a variety of methods and programming
techniques. You will use the ladder diagram programming language to program
your PLC. This programming technique is so named since the instructions in
the program are presented as rungs of a ladder. The instruction in each rung
presents the logic condition for activating certain outputs.
The format described by each rung is: IF. (condition), THEN (result). In ladder

1
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

diagrams, the conditions (inputs) are placed at the left side of the ladder, and
the results (outputs) at the right side. This enables you to read the instructions
as you would read any other text - from left to right.

The PLC's function is to continuously update inputs and outputs, apply that
update to the ladder diagram and then apply the effects of the inputs. This is
known as the PLC scan.
The PLC applies the effects of the inputs, or "solves" the ladder diagram, from
top to bottom, rung to rung. Only once it has read the entire ladder diagram
will it then return to the beginning. As inputs' states change, so will their output
coils. It is important to note, however that the effects of internal coils whose
contacts are located on a rung higher than the coil's location will not be read
until the next scan.

eXamine If Closed (XIC)


The eXamine If Closed (XIC) input instruction appears in the ladder
diagram as

Next to the XIC instruction, the programmer must indicate a memory address.
The XIC instruction output will be true if the value of the address is true, and it
will be false if the value of the address is false.
When referring to an input device, the instruction will be true when the switch
in this device is closed and false when the switch is open.

OutpuT Energize (OTE)


The OutpuT Energize (OTE) output instruction appears in the ladder
diagram as:

Next to this instruction, the programmer must indicate a memory address. The
OTE instruction can be placed only on the right side of the ladder rungs and it
serves as the rung output.

The OTE instruction will be true if the conditions described on the rung are
met. The OTE instruction will be false if the conditions described on the rung
are not met. If the OTE instruction refers to an output address when the OTE is
true, the device will be activated.

eXamine If Open (XIO)


The Examine If Open (XIO) input instruction appears in the ladder
diagram as:

Next to the XIO instruction, the programmer must indicate a memory address.
The XIO instruction will be true if the value of the address is false, and it will
be false if the value of the address is true.

When referring to an input device, the instruction will be true when the switch

2
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

in this device is open and false when the switch is closed.


The function implemented by the XIO instruction is known as NOT logic.
When applied on a logic variable, the function inverts the logic value. For
example:
• The logic variable, "today is Tuesday", is true on Tuesday while on the other days
of the week it is false.
• The logic variable, "today is NOT Tuesday" has an inverted logic value. It is false
on Tuesday and true on every other day of the week.

AND Logic

Let say you need to control an elevator that automatically stop the motor when
the elevator is fully raised or lowered. The demands for the elevator control can
be summarized using the following logic variables.

1. IF the up switch is closed.


2. AND the elevator is not fully up.
3. THEN the motor continues to raise the elevator.

In logic terminology, this is known as AND logic. This AND function has two
inputs and a single output. The output will be true only if both inputs are true.
If one input (or both) are false, the output will be false.

Referring to the connected sentence as a single logic variable - if the up switch


is closed AND the elevator is not fully up, then the motor continues to raise the
elevator - its logic value is a function of the value of its ingredients. The
sentence will be true only if both the first part AND the second part is true.

The logic function AND is implemented in a ladder diagram by connecting a


group of contacts in a series, known as a series connection. Historically in
electrical circuits, a series connection implements the logic function AND as
shown in Figure 1-1.

Figure 1-1

3
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

In Figure 1-1, the lamp will turn on only when there is a continuity of
electrical conductors from one pole of electric power supply through the lamp
to the other pole. As shown in Figure 1-1, the continuity is disturbed in switch
1 and in switch 2.

The lamp activation is a function of the switches' position:


• IF switch 1 is activated,
• AND switch 2 is activated, THEN the lamp turns on.

Example using AND Logic:

You will need a ladder diagram with two rungs to control the elevator system
(Figure 1-2). The first rung will control the raising of the elevator, the second
the lowering.

Figure 1-2

The 1st rung must stipulate that:


• IF the up switch is closed,
• AND the elevator is not fully up,
• THEN the motor lifts the elevator.

This demand will be met by connecting an XIC instruction (referring to the up


switch address) in a series connection with an XIO instruction (referring to the
right sensor address). The rung output will be an OTE that starts the motor,
moving the nut to the right.

The 2nd rung must then stipulate that:


• IF the down switch is closed,
• AND the elevator is not fully down,
• THEN the motor lowers the elevator.

Here, you will program an XIC instruction (referred to as the down switch
address) in a series connection with an XIO instruction (referred to as the left
sensor address). The rung output will be an OTE that starts the motor, moving
the nut to the left.

4
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Figure 1-3

PROCEDURES

Task 1-1: Starting PLC Editor

In this task, you will run the PLC Editor module for the first time.

1. Turn on the computer.


2. From the Start menu on your desktop, select Programs |
PLCMotion HMI | PLC Editor

If a PLCMotion programs group has already been created on your desktop, click on
the PLC Editor icon.

You will use this module to program your first ladder diagram. You will then
simulate it using the PLC Simulator and HMI PLC Line modules.

3. After a moment, your screen will look like Figure 1-4.

5
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Figure 1-4

Task 1-2: Programming a Basic Ladder Diagram

1. Click on the Show Grid icon.


The grid will assist you in placing instructions on the rungs of the ladder.

2. Select Ladder | Add Rung or click on the Add Rung icon.

Ladder diagrams are composed of a series of rungs, which contain sets of


instructions. The ladder diagram is currently empty; the only rung shown is the end
rung, marking the end of the program. By clicking on the Add Rung icon, empty
rungs can be added to the ladder diagram.

3. Click on the end rung's Rung Activation button.

The rung activation button is the small button at the left side of the rung. While
the Add Rung icon is active, clicking on any rung activation button will insert a
new and empty rung before the selected rung. Since the ladder diagram in this
activity will include only one rung, no additional empty rungs are needed and you
are ready to start placing instructions on the rung.
In the program you are writing, you will stipulate the logic value of the upper

6
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

switch with the logic condition of the solenoid. Both the switch and the solenoid
are logic variables whose values are kept in the PLC memory at a designated
address.

4. Click on the Contact icon.


The submenu, shown in Figure 1-5, opens.

Figure 1-5
Click on the XIC (eXamine If Closed) instruction.

The XIC instruction is a normally open (NO) contact. An NO contact is open when
the input associated with it is off and closed when the input associated with it is on.

Click on rung 00's activation button.


The rung is bolded, indicating that rung 00 is in editing mode.
Click on the left side of rung 00 (note the cursor location in Figure 1-6).

Figure 1-6

The XIC instruction appears, and the Object Properties dialog box opens
(Figure 1-7).

Figure 1-7

7
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

5. Using the Object Properties dialog box, set a variable address and comment for this
input contact:

• In the Address field, click on the I:0/0 keys from the on-screen keypad or type it
from your keyboard.
• In the Comment field, type SW_1.

The comment is not stored in the PLC memory and has no effect on the program.
The comment is used only as a reminder to the programmer for future use. The
PLC regards the variable only as I:0/0.

• Click OK to close the dialog box.

An XIC (eXamine If Closed) instruction referring to the designated


address/switch status is added to the ladder diagram (see Figure 1-8).

Figure 1-8

6. Click on the Coil icon.


The submenu shown in Figure 1-9 opens, showing several output coils available in
PLCMotion.

Figure 1-9
7. Then click on the OTE (OutpuT Energize) instruction.

An output coil, the OTE must be placed on the right side of the ladder diagram.

8. Click on the right side of rung 00 (note the cursor location in Figure 1-10).

8
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Figure 1-10

The Object Properties dialog box opens again. Do the following from the
dialog box:

• In the Address field, click on the 0:0/0 keys from the on-screen keypad or type it
from the keyboard.
• In the Comment field, type Red_Lamp.
• Click OK to close the dialog box.

An OTE (output energize) instruction linked with the address O:0/0 is added to
the ladder diagram.
Your ladder diagram should look like Figure 1-11.

Figure 1-11

Task 1-3: Saving and Compiling a Program

Prior to running the program you have just completed, the ladder diagram must be
saved, and then compiled and debugged (if necessary).

1. Select File | Save As or click on the Save icon.


The Save Project dialog box opens (see Figure 1-12).

9
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Figure 1-12
2. Save the file as LAB1, (where LAB1 is replaced by characters that identify either the
individual student or team; e.g., JFOX2, BLUE2).

Do not use a file name extension. PLCMotion adds the extension LAD
automatically to the file.

All files will be saved to the default directory \\PLCMotion\Ab_work. If a file of


the same name already exists in that directory, consult with your instructor about
whether to overwrite the previous file or save it under a different name.

Then click OK.

3. Click on the Compile icon.

The Compile option checks for syntax errors in the ladder diagram.

The compiling action checks only whether you have made a syntax
error. If your ladder diagram is wrong but the ISM syntax is correct, an
error will not be detected until simulation or running of the program.

If a check appears over the boxed "C", compiling was successful. If an

"X" appears, read the explanatory message at the bottom of the screen.

The erroneous position on the ladder diagram will be marked with a red
circle.

If an error is detected, use the cut or object properties options, or

simply overwrite the erroneous instruction .When debugging is


complete, save and then re-click on the Compile icon.

10
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

4. Exit PLC Editor by selecting File | Exit or by clicking on the Exit button in the upper-
right hand corner of the screen.

A dialog box opens asking whether you are sure you want to exit the application.

Click Yes.

Task 1-4: Debugging and Editing Tools

Note: Skip this task if you did not find errors when compiling your program in
Task 4-4.

1. To remove an object:

• Select Edit | Cut or click on the Cut icon.


• Click on the rung (if needed) and then click on the instruction.

2. To remove a whole rung:


• Click on the rung activation button
• Select Edit | Cut or click on the Cut icon.
• Then click on the rung until it is removed.
Note the following:
• The Cut icon is active only for a single deletion action.

• In case of an error in deletion, click on the Undo icon to


recover the last deletion.

3. To change the properties of an instruction:

• Click on the Object Properties icon.


• Select the rung containing the instruction and then click onthe instruction; a
dialog box opens, resembling the one openedwhen the instruction was initially
placed in the ladder diagram.
Change the items you want to revise.

Note the following:


• If you change an instruction comment, the comment attached to all of the same
addresses will be updated throughout the ladder diagram.
• You cannot change the instruction type using this tool, only the object's
properties.

4. To place a new instruction "over" an erroneous instruction:


• Click on the new instruction.

11
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

• Click on the rung containing the erroneous instruction and click on the
instruction.
• In the open dialog box, add the instruction address and comment.

Task 1-5: Running a Program

You will now open PLC Simulator and the HMI PLC Line to run and
simulate the program. Theoretically, you can keep PLC Editor open as
well, but it will put a great strain on your computer's memory.

Figure 1-13

1. From your desktop or Start menu, select HMI PLC Line to run PLC Simulator and the
HMI PLC Line modules.
2. Open the file LAB2, which you just wrote and saved in PLC Editor.
Maximize the ladder diagram window.
3. Make sure all three switches on the panel are off.

4. Click on the On-Line icon.


5. Click on the Start/Stop Simulation icon.
6. Switch on the upper switch.
7. Switch off the upper switch.
Note: Once you switch ON the upper switch you will ON the Red Lamp.
8. You may change the Input / Output address to switch On the Yellow and Green
Lamps.

12
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Task 1-6: Programming with NOT Logic

1. Start PLC Editor.


2. Open the file LAB2, which you saved in the previous activity.
3. Click on the Show Grid icon, which makes programming

easier.

4. Click on the Add Rung icon and then click on the end rung's rung activation
button to add an empty rung to the ladder diagram.
An empty rung is inserted above the selected rung.
5. To program rung 01, do the following:
• Click on the Contact icon and then click on the XIO instruction.

The XIO instruction is a normally closed (NC) contact. An NC contact is


closed when the input associated with it is off and open when the input
associated with it is on.

• Click on rung 01 's rung activation button.


• Click on the leftmost side of rung 01.

The Object Properties dialog box opens.

Select I:0/0 SW_1 from the I/O List.

This list is found at the lower right-hand side of the dialog box. Selecting an
item from this list will cause the address and the attached comment to appear
automatically in the fields.

Figure 1-14

The I/O List contains all variables defined during programming thus far. The
I/O List enables you to program faster and to reduce incidents of human error.
Click OK to close the dialog box.

13
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

An XIO (eXamine If Open) instruction, stipulated to the designated switch


status, is added to the ladder diagram. The instruction will examine if the
switch is open (and then it will be true), and if the switch is not open it will be
false.
• Click on the Coil icon and then click on the OTE instruction which you
used in the previous activity.
• Click on the right side of rung 01. The OTE instruction appears and the dialog
box opens enabling you to set the instruction to a memory address and add a
comment.
• Set the instruction to the address 0:0/1 and the comment as Yel_Lamp.
Then click OK to close the dialog box.

Your ladder diagram should look like Figure 1-15.

Figure 1-15
6. Save the file as LAB1-2, (where LAB1-2 is replaced by characters that identify either
the individual student or team; e.g., JFOX2, BLUE2).

Do not use a file name extension. PLCMotion adds the extension LAD
automatically to the file.

All files will be saved to the default directory \\PLCMotion\Ab_work.


If a file of the same name already exists in that directory, consult with
your instructor about whether to overwrite the previous file or save it
under a different name.
Then click OK.

7. Click on the Compile icon.


8. Debug the program if needed.
Then save and compile it again.

9. Exit PLC Editor.

Task 1-7: Running the New Program

1. Run the PLC Simulator and HMI PLC Line.


2. Open the file LAB1-2, which you saved in the previous task.

Maximize the ladder diagram window.

14
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

3. Make sure all three switches on the panel are off.


4. Start the simulation. You will work only with the HMI in this task.

The object I:0/0 appears twice in the ladder diagram.

• In rung 00, the object background is white. In this case, the XIC
(examine if closed) instruction examines whether the switch is closed.
The switch is open; therefore the rung output is false.
• In rung 01, the object background is green. Here, the XIO
(examine if open) instruction checks whether the switch is open.
It is; thus the rung output is true.
5. Click on the I:0/0 contact on rung 00.
You can activate HMI switches by clicking on their corresponding
memory address in the ladder diagram.
6. Click repeatedly on the I:0/0 contact.
Note: Changes in the background of O:0/1 and O:0/1 the state of the
HMI Red and Green Lamp.
7. Switch ON/OFF Switch 1.
8. Switch ON/OFF Switch 2.

Task 1-8: Programming with AND Logic

1. Turn on the computer.


2. Start PLC Editor.
3. Clear the PLC memory by selecting File | New or clicking on the
New icon.

4. Click on the Show Grid icon.


5. Add two empty rungs to the ladder diagram.
6. To program the first rung, do the following:
• Click on the Contact icon and then click on the XIC instruction.
• Click on rung 00's rung activation button to put the rung in editing mode.
• Place the contact on the left-hand side of rung 00. Set its address to I:0/0 and add
the comment SW_1.
• Click on the Contact icon and then click on the XIO instruction.
• Place the contact next to the one just placed (see cursor in Figure 1-16).

Figure 1-16
Set its address to I:0/3 and the comment to SW_3.
• Click on the Coil icon and then click on the OTE instruction.
• Place the contact on the right-hand side of rung 00.

15
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

7. Set its address to O:0/0 and add the comment Red_Lamp.

Continue creating your Ladder Diagram until your screen look like Figure
1-17 below.

Figure 1-17

8. Save the file as LAB1-3.


9. Compile the program; debug and resave if necessary.

Then exit PLC Editor.

Task 1-9: Running the Program


1. Run PLCLine.
2. From PLC Simulator, open LAB1-3, the file you just saved.
3. Make sure that all three switches on the panel are off.
4. Switch ON/OFF Switch 1.
5. Switch ON/OFF Switch 2.
6. Switch ON/OFF Switch 3.
7. Stop the simulation.
8. Cancel on-line communication.
Note:
1. Observe the effect on the Red / Yellow / Green Lamps between the Switches that you
turned ON/OFF.
2. Observe also the effect on the Ladder Diagram that you have created.

16
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

LAB REPORT FOR PROCESS CONTROL


NAME: _____________________________ Student No: ___________________

EXERCISE A:

1. Write a PLC program for the HMI Conveyor below. Print the Ladder Diagram and
attach it together with Lab Report. (5 marks)

Figure 1-18
Hints:
1. The conveyor system above has 2 inputs.
a) I:0/0 is a switch to activate the conveyor motor O:0/0.
b) I:0/1 is a sensor that detects a reject product on the conveyor.

2. The conveyor system has 2 outputs.


a) O:0/0 is a conveyor motor.
b) O:0/3 is a solenoid cylinder.

3. The solenoid cylinder will energize when sensor I:0/1 detect a reject product.

17
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

QUESTIONS:
1. Name 4 PLC brand available in the market world wide. (4 marks)
a) __________________________
b) __________________________
c) __________________________
d) __________________________

2. List down 2 (two) advantages and 2 (two) disadvantages of using PLC in controlling
a machine? (4 marks)
Advantage
a) __________________________________________________________________
__________________________________________________________________
b) __________________________________________________________________
__________________________________________________________________
Disadvantage
a) __________________________________________________________________
__________________________________________________________________
b) __________________________________________________________________
__________________________________________________________________

3. Is it possible to have a single Input (switch) to Switch ON several Outputs? How?


(2 marks)
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________

TOTAL MARKS : ______ / 20

18
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

OVERVIEW - OR Logic, Latching and Unlatching Output, One Shot Rising.

OR Logic
You will use HMI PLC LINE to conduct this activity. In this activity you will turn
ON the Green Lamp using either Switch 1 OR Switch 2.

The demand is therefore:


• IF the switch 1 is on,
• OR the switch 2 is on,
• THEN, activate the Green Lamp.

In other words "IF either of the switches is on, then the Green Lamp is activated. This
is known as OR logic.

The logic function OR is achieved by connecting the contacts representing the logic
variables in a, Parallel connection. The Green Lamp will illuminate only if there is a
continuity of electric conductors from one pole of the electric power supply through
the lamp to the other pole. In Figure 1, continuity is achieved by closing either switch
1 or switch 2 (or closing both).

Figure 2-1: OR Circuit

Lamp activation is a function of the switch position. Therefore:


• IF switch 1 is activated,
• OR switch 2 is activated,
• THEN the lamp turns ON.

19
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

PROCEDURES:

Task 1-1: Programming with OR Logic

1. Turn on the computer.


2. Start PLC Editor.
3. Click on the Show Grid icon.
4. Create a ladder diagram based on Figure 3-1.

Figure 2-2: PLC Editor

5. Select Ladder | Line or click on the Line icon.


6. Click on the vertical side of the square after Relay (I:0/0) (Figure 2-3).

20
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Figure 2-3: Adding Line

7. You will notice that the Rung 00 is expanding to Rung 000.

8. Click on the Horizontal Line at the Rung 000 and another Relay of (I:0/1) at the
bottom of Relay (I:0/0) (Figure 2-4).

Figure 2-4: Parallel Connection

9. Save and compile your files as LAB2_1.LAD


10. Open the PLC Simulator and load your saved files.
11. On-line the simulation.
12. Switch ON/OFF Switch 1.
13. Switch ON/OFF Switch 2.
14. Observe the effect of Switch 1 and Switch 2 on the Green Lamp.
15. Stop the simulation.

21
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Task 1-2: Programming with OR Logic (Holding Relay)

1. Start PLC Editor.


2. Open the LAB2_1.LAD file.
3. Modify the ladder diagram based on Figure 2-5.

Figure 2-5: Holding Relay

Note:
• Replace the OR Relay (previously I:0/1) with the Output Address (O:0/2).
• Add Normally Close (I:0/1) at Rung 00. It will act as STOP Switch.

4. Save and compile your files as LAB2_2.LAD


5. Open the PLC Simulator and load your saved files.
6. On-line the simulation.
7. Switch ON/OFF Switch 1.
8. Observe the effect of Green Lamp while switching OFF Switch 1.
9. Switch ON Switch 2.
10. Observe the effect of Green Lamp.
11. Stop the simulation.

22
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Latching and Unlatching Outputs

OutpuT Latch (OTL)

The Output Latch (OTL) instruction appears in the ladder diagram as:
Next to this instruction the programmer must indicate a memory address.
When the logic conditions that precede the OTL instruction are true, the memory
address is latched. The output address will stay true even if the logic conditions that
precede the OTL instruction are false.

OutpuT Unlatch (OTU)

The Output Latch (OTL) instruction appears in the ladder diagram as:
Next to this instruction the programmer must indicate a memory address.
When the logic conditions that precede the OTU instruction are true, the memory
address is unlatched (it turns, false). The address will stay false even if the logic
condition that precedes the OTU instruction turn false.

The OTL and OTU instructions always come in pairs as both refer to the same address
in the PLC memory. The address controlled by the OTL and OTU instructions is
called the retentive address since it retains the last instruction issued to it.
When this pair of instructions is used in an industrial controller (that is usually backed
up by a long-life battery), the address value will be retained even in the case of a
power failure or prolonged stoppages.

Analogy
Consider an Automatic Gate (Figure 2-6)

gate is opened and closed by an electric motor that drives one of the gate's wheels.
The electric motor is controlled by two push button (PB) switches installed in the
gatekeeper's booth: Open and Close

23
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Figure 2-6: HMI Gate

Assuming the gate is initially closed, the gate is opened as follows:


1. Pressing the open PB starts the motor, and the gate opens.
2. The gate continues to open even if the open PB is released.
3. When the gate is fully open, a sensor is activated and the motor stops.
The gate-closing procedure starts when the close PB is activated and the motor turns
in the opposite direction. The gate continues to close even if the PB is released, and is
stopped when the sensor detects that the gate is fully closed. The control demand of
the gate requires a slightly different programming approach than those used in
previous projects:

1. The motor is started when a logic condition is met (the PB is activated).


2. The motor keeps on turning even if this starting condition ceases to exist (the PB is
deactivated).
3. The motor is stopped only when a different logic condition is met (when a sensor is
activated).

The input/output relationship in this system differs from previous systems in two ways:
1. The output is activated when a defining logic condition is met, but it stays energized
even if this condition ceases to exist.
2. The output is activated when another logic condition is met.

To implement this control demand you will obviously need a new type of instruction.
The instruction should latch the motor address in energized position when the PB is
activated. This will guarantee that the output (motor) will stay on (latched) even when
the input (PB) is no longer activated. The latched address should then be unlatched by
the activation of the sensor.

24
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

PROCEDURES

Task 1-3: Programming with OTL and OTU Instructions


1. Turn on the computer.
2. Start PLC Editor.
3. Click on the Show Grid icon.
4. Create a ladder diagram based on Figure 2-7.

Figure 2-7: PLC Gate


Note:
• At Rung 00 add Relay (I:0/0) and OTL (O:0/1).
• At Rung 01 add Relay (I:0/1) and OTU (O:0/1).
• At Rung 02 add Relay (I:0/1) and OTL (O:0/2).
• At Rung 03 add Relay (I:0/2) and OTU (O:0/2).

5. Save and compile your files as LAB2_3.LAD


6. Open the PLC Simulator and load your saved files.
7. On-line the simulation.
8. Switch ON/OFF Switch 1.
• Yellow Lamp will stay ON even if the Switch 1 is turned OFF.
9. Switch ON/OFF Switch 2.
• Yellow Lamp is turned OFF when the Switch 2 is ON.
• Green Lamp will stay ON even if the Switch 2 is turned OFF
10. Switch ON/OFF Switch 3.
• Green Lamp is turned OFF when the Switch 3 is ON.
11. Observe the effect of Latch and Unlatch command between Yellow and Green
Lamps.
12. Stop the simulation.

25
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

One Shot Rising (OSR)

The One Shot Rising (OSR) input instruction appears in the ladder diagram as:

Next to the OSR instruction, the programmer must indicate an internal memory address.
The OSR instruction cannot be the first (furthest to the left) instruction in a ladder
diagram.
• When the logic conditions that precede the OSR instruction turn from false to
true, the OSR output becomes true for a single PLC scan.
• In following scans, the OSR output turns false (even if the logic conditions that
precede it are still true).
• The OSR output will be true again (for a single PLC scan) only if the logic
conditions that precede it turn from false to true (thus it must first turn back from
true to false).

To understand the OSR instruction, you must first review the PLC working method.
When a PLC is running a program, the PLC scans successively (starting from rung 00)
the logic condition of every rung. After checking all the rungs, the PLC updates (if
necessary) the address indicated by the rung output. When the scanning and updating
process is completed, another cycle of scanning and updating is started. As you may
remember, this is known as the PLC scan.

The duration of each scanning and updating process is very short (a few
milliseconds). Cycle duration is dependent on the program size and controller type.

To better understand the function of the OSR instruction, you will first program the
ladder diagram without the OSR instruction. You will then add an OSR to clearly see
how it affects the stapling operation.

Analogy

Controlling an Automatic Stapler (Figure 2-8)

Your next job is to program a ladder diagram to control the operation of


an automatic stapler. The stapler is activated by a solenoid, which is
controlled by the PLC according to the status of a manual switch and
limit switch (type of contact sensor).

26
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Figure 2-8: Stapler

Stapling will work as follows:


1. The worker places the papers in the stapler and activates the upper switch.
2. The solenoid is energized, activating the stapler. The staple pierces the papers and its
edges are bent at the back (thus fastening the papers together).
3. When stapling is completed, the limit switch is activated, the solenoid is de-energized
and the stapler retracts.

To ensure quality stapling, the stapler and solenoid must retract immediately upon
the bending of the staple. If the solenoid retracts too early, the staple edges will
not be fully bent and the papers will not be securely attached to one another. If the
solenoid retracts too late, the staple edges will be crooked making the holes in the
paper to be less aesthetic.

By focusing on the stapler solenoid operation, you can see that:


1. The solenoid is energized when the upper switch is activated.
2. The solenoid stays energized until the limit switch is activated.
3. Upon activation of the limit switch, the stapler is deactivated - even if the upper
switch is still activated.

The output in this control system is energized when a defined logic condition is
met. It stays energized until another logic condition is met, even if the initial
activating condition is still true.

To meet this requirement, the upper switch will latch the solenoid using an OTL
instruction; the limit switch sensor will unlatch it. You must still define how to
ensure that the logic condition that preceded the OTL instruction will turn false
before the limit switch is activated.

The problem will be solved using a new instruction named OSR - One Shot
Rising. OSR generates a short pulse upon activation of the instruction.

PROCEDURES

Task 1-4: Programming without OSR Instructions

1. Start PLC Editor

27
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

2. Click on Show Grid


3. Add two rungs to the ladder diagram.
4. Program the ladder diagram by yourself.
5. Your ladder diagram should resemble Figure 2-9.

Figure 2-9: Programming without OSR

• In rung 00, the upper switch (I:0/0) latches the solenoid.


• In rung 01, the limit switch (I:0/4) unlatches the solenoid.

6. Save the file Lab2_4.LAD


7. Compile the program.
8. Do not exit the PLC Editor

Running the Program


1. Open the file you just saved.
2. Make sure that all three switches on the panel are off.
3. Start simulation.
4. Switch on the upper switch and then immediately switch it off.
5. Observe the solenoid reaction.
6. Switch on the upper switch and leave it on.
7. Observe the solenoid reaction.
8. Switch off the switch.
9. Note the behavior.

Revising Program by Adding an OSR Instruction


1. The ladder diagram should look like Figure 2-10 below.
2. Toggle back to PLC Editor.
3. Click the OSR instruction.
4. Place the instruction as shown in Figure 2-10.

Figure 2-10: OSR

28
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

Set the address to B3:0/0.

1. The OSR instruction requires an internal coil address. B3:0/0, which is an internal
memory bit, will serve as a "dummy" address. It won't play any role in the current
program.
2. Save this program under Lab2_5.LAD.
3. Compile the program.

Running the Modified Program


1. Open the modified file.
2. Make sure all three switches on the panel are off.
3. Start the simulation.
4. Switch on the upper switch and then immediately switch it off.
Observe the solenoid reaction
5. Then switch on the upper switch and leave it on.
Observe the solenoid reaction
6. Switch off the upper switch.
7. Stop the simulation

29
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

LAB REPORT FOR PROCESS CONTROL


NAME: ____________________________ Student No: __________________

EXERCISE B:

1. Write a PLC program for the HMI Gate below. Print the Ladder Diagram and attach it
together with this Lab Report. (5 marks)

The Gate HMI enables users to simulate ladder diagrams that control an entrance gate,
which is opened and closed by an electric motor that drives one of the gate's wheels.
The electric motor is controlled by two push button (PB) switches installed in the
gatekeeper's booth: OPEN PB and CLOSE PB.

Assuming the gate is initially closed, the gate is opened as follows:


• Pressing the OPEN PB starts the motor, and the gate opens.
• The gate continues to open, even if the OPEN PB is released.
• Once the gate is fully open, a sensor is activated and the motor stops.

The gate-closing procedure is as follows:


• Pressing the CLOSE PB starts the motor in the opposite direction and the gate
begins to close.
• The gate continues to close, even if the CLOSE PB is released.
• The motor stops once the sensor detects that the gate is fully closed.

30
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

2. Write a PLC program for the HMI Ice Cream below. Print the Ladder Diagram and
attach it together with this Lab Report. (5 marks)

The Ice Cream Filling Station HMI simulates the control of an ice cream filling
process.

The station includes the following components:


• A filling valve.
• A cup (to be filled with ice cream).
• A PB switch that activates the system.
• Two sensors:
Sensor A indicates when a cup is under the valve outlet.
Sensor B indicates when the cup is full.

The simulated control system works as follows:


1. When an empty cup is placed under the valve outlet (indicated by Sensor A) AND the
PB is pressed, the ice cream valve is opened.
2. When the cup is full (indicated by Sensor B), the filling valve closes.

31
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

DISCUSSION:

1. What is the function of the Holding Relay command? (1 mark)


_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

2. Why you must add a STOP switch in the Holding Relay Rung? (1 mark)
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

3. What is the advantage using the Latch and Unlatch command instead of Holding
Relay command? (1 mark)
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

4. Why the Latch and Unlatch must be in Pairs? Can the Unlatch command be several
Rungs below the Latch Rung? (2 marks)
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

5. What happen to the PLC programming if the Latch command does not has it pairs?
(1 mark)
_____________________________________________________________________
_____________________________________________________________________
____________________________________________________________________

6. What do you understand with OSR? (1 marks)


_____________________________________________________________________
_____________________________________________________________________
____________________________________________________________________

7. Give one example of application that utilizing the OSR command? (1 marks)
_____________________________________________________________________
_____________________________________________________________________
____________________________________________________________________

8. What is the different between OR command and AND command? (1 marks)


_____________________________________________________________________
_____________________________________________________________________
____________________________________________________________________

32
EPT 352 - INSTRUMENTATION & CONTROL SYSTEM
LAB1

9. Give one example of application that utilizing the OR command? (1 marks)


_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________

TOTAL MARKS : ______ / 20

33

S-ar putea să vă placă și