Professional Documents
Culture Documents
Lab2 SET-RESET
Lab2 SET-RESET
Lab2 SET-RESET
I. OBJECTIVES
Continue working with ladder logic diagram
Differentiate the meanings of contact, coils, and FBD
Understand and apply with LAD and FBD: P/N edge detections, Set/Reset
III. INTRODUCTION
3.1. Positive edge and negative edge detections
LAD:
Contact:
P contact (LAD): The state is TRUE when there is a positive transition (from OFF to ON)
occurring at the bit “IN” assigned. Bit logic of this contact together with other signals will
determine the output bit logic.
N contact (LAD): The state is TRUE when there is a negative transition (from ON to OFF)
occurring at the bit “IN” assigned. Bit logic of this contact together with other signals will
determine the output bit logic.
Coil:
P coil (LAD): bit of “OUT” is assigned with TRUE where there is a positive transition
(OFF to ON) detected from the signal passing through the coil.
N coil (LAD): bit of “OUT” is assigned with TRUE where there is a negative transition
(OFF to ON) detected from the signal passing through the coil.
FBD:
At the begin of a branch of a network:
P box (FBD): bit logic at the output of the box is TRUE when there is a positive transition.
N box (FBD): bit logic at the output of the box is TRUE when there is a negative transition.
P=box (FBD): bit logic of “OUT” is “TRUE” when there is a positive transition detected at
the input of the box. If this box is placed at the start of a branch of a network, the “OUT”
bit logic is based on the input bit assigned.
N=box (FBD): bit logic of “OUT” is “TRUE” when there is a positive transition detected at
the input of the box. If this box is placed at the start of a branch of a network, the “OUT”
bit logic is based on the input bit assigned.
3.2. SR (Set/Reset)
Set and Reset for 1 bit and multi-bits
LAD:
E.g.#MyArray[3]
RESET_BF OUT n:Constant When RESET_BF is activated, a data
whose equivalent value is 1 is assigned
Elements of Boolean to “n” bit at the address of output OUT.
When RESET_BF is not activated, value
of OUT does not change.
E.g.#MyArray[3]
FBD:
SR and RS:
Set/Reset block (SR): is used to set or reset the bit of the specified operand, depending on
the signal state of the inputs S and R1. If the signal state is "1" at input S and "0" at input
R1, the specified operand is set to "1". If the signal state is "0" at input S and "1" at input
R1, the specified operand will be reset to "0". Input R1 takes priority over input S. When
the signal state is "1" on both inputs S and R1, the signal state of the specified operand is
reset to "0".
Reset/Set block (RS): is used to reset or set the bit of a specified operand based on the
signal state of the inputs R and S1. If the signal state is "1" at input R and "0" at input S1,
the specified operand will be reset to "0". If the signal state is "0" at input R and "1" at
input S1, the specified operand is set to "1". Input S1 takes priority over input R. When the
signal state is "1" at both inputs R and S1, the signal state of the specified operand is set to
"1". The instruction is not executed if the signal state at the two inputs R and S1 is "0". The
signal state of the operand then remains unchanged. The current signal state of the operand
is transferred to output Q and can be queried there.
Input and Output Data type Description
RS R Bool _Set takes priority. If
set signal (S1) and
reset signal (R) are
S1 Bool both true, value at
Q Bool OUT=1
SR S Bool _ReSet takes priority. If
R1 Bool set signal (S) and reset
signal (R1) are both
Q Bool true, value at OUT=0
Truth tables
RS SR
S1 R OUT S R1 OUT
0 0 Previous state 0 0 Previous state
0 1 0 0 1 0
1 0 1 1 0 1
1 1 1 1 1 0
Build the given circuit and Observe the operation. Under what conditions that the output
LIGHT is set/reset?
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
Exercise 2. RS flip-flop.
Build the following circuit
Observe the operation. Under what conditions that the output LIGHT is set/reset?
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
V. EXPERIMENTS
Experiment 1. Use SET/RESET LAD contacts and coils
Write a LAD program to describe the following event:
1. Press START button to set the Outputs Q0.0, Q0.5, Q0.6, Q0.7 to 1. These outputs do
not change the values even the button is released
2. Press RESTART to reset the Outputs Q0.0, Q0.5, Q0.6, Q0.7 and these outputs do not
change the values even the button is released
Experiment 3. Use P edge and N edge, SET/ RESET LAD contacts and coils
Write a LAD program to describe the following event:
1. When press and release Button 1, Output 1 works
2. When press Button 2, Output 2 works.
3. When press STOP, both Outputs 1 and 2 are off
Verify the results using LEDs.
Figure 1
Table of Symbol
S1 START button- Normally Open (NO)
S2 STOP button- Normally Close (NC)
K1 The contactor as output
Tasks:
1. Describe the operation of the circuit with contactor.
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
2. Use ladder logic diagram with appropriate Set/Reset FBD to perform the operation of the
above circuit. Verify the work using kit or LEDs in the lab. Show the result to the
instructor.
Figure 2.
Table of Symbol
S1 START button- Normally Open (NO)
S2 STOP button- Normally Close (NC)
K1 The contactor as output
Tasks:
1. Describe the operation of the circuit with contactor.
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
……………………………………………………………………………………………………
2. Use ladder logic diagram with appropriate Set/Reset FBD to perform the operation of the
above circuit. Verify the work using kit or LEDs in the lab. Show the result to the
instructor.
Known that
Write an algorithm using Ladder logic to describe the direction of the conveyor belt.
Experiment 9. Write an algorithm based on ladder logic to describe the following operations
a) 1st case:
When START button is pressed, motor will run and a LED indicating the running
motor will be ON simultaneously.
When STOP button is pressed, motor will be stopped and a LED indicating the
stopping motor will be ON simultaneously.
b) 2nd case:
When proximity sensor is triggered, the fan will run and a LED indicating the running
motor will be ON simultaneously.
When proximity sensor is left undetected, the fan will stop and a LED indicating the
stopping fan will be ON simultaneously.