- •9.7.2 More Timers And Counters
- •9.7.3 Deadman Switch
- •9.7.4 Conveyor
- •9.7.5 Accept/Reject Sorting
- •9.7.6 Shear Press
- •9.8 SUMMARY
- •9.9 PRACTICE PROBLEMS
- •9.10 PRACTICE PROBLEM SOLUTIONS
- •9.11 ASSIGNMENT PROBLEMS
- •10. STRUCTURED LOGIC DESIGN
- •10.1 INTRODUCTION
- •10.2 PROCESS SEQUENCE BITS
- •10.3 TIMING DIAGRAMS
- •10.4 DESIGN CASES
- •10.5 SUMMARY
- •10.6 PRACTICE PROBLEMS
- •10.7 PRACTICE PROBLEM SOLUTIONS
- •10.8 ASSIGNMENT PROBLEMS
- •11. FLOWCHART BASED DESIGN
- •11.1 INTRODUCTION
- •11.2 BLOCK LOGIC
- •11.3 SEQUENCE BITS
- •11.4 SUMMARY
- •11.5 PRACTICE PROBLEMS
- •11.6 PRACTICE PROBLEM SOLUTIONS
- •11.7 ASSIGNMENT PROBLEMS
- •12. STATE BASED DESIGN
- •12.1 INTRODUCTION
- •12.1.1 State Diagram Example
- •12.1.2 Conversion to Ladder Logic
- •12.1.2.1 - Block Logic Conversion
- •12.1.2.2 - State Equations
- •12.1.2.3 - State-Transition Equations
- •12.2 SUMMARY
- •12.3 PRACTICE PROBLEMS
- •12.4 PRACTICE PROBLEM SOLUTIONS
- •12.5 ASSIGNMENT PROBLEMS
- •13. NUMBERS AND DATA
- •13.1 INTRODUCTION
- •13.2 NUMERICAL VALUES
- •13.2.1 Binary
- •13.2.1.1 - Boolean Operations
- •13.2.1.2 - Binary Mathematics
- •13.2.2 Other Base Number Systems
- •13.2.3 BCD (Binary Coded Decimal)
- •13.3 DATA CHARACTERIZATION
- •13.3.1 ASCII (American Standard Code for Information Interchange)
- •13.3.2 Parity
- •13.3.3 Checksums
- •13.3.4 Gray Code
- •13.4 SUMMARY
- •13.5 PRACTICE PROBLEMS
- •13.6 PRACTICE PROBLEM SOLUTIONS
- •13.7 ASSIGNMENT PROBLEMS
- •14. PLC MEMORY
- •14.1 INTRODUCTION
- •14.2 MEMORY ADDRESSES
- •14.3 PROGRAM FILES
- •14.4 DATA FILES
- •14.4.1 User Bit Memory
- •14.4.2 Timer Counter Memory
- •14.4.3 PLC Status Bits (for PLC-5s and Micrologix)
- •14.4.4 User Function Control Memory
- •14.4.5 Integer Memory
- •14.4.6 Floating Point Memory
- •14.5 SUMMARY
- •14.6 PRACTICE PROBLEMS
- •14.7 PRACTICE PROBLEM SOLUTIONS
- •14.8 ASSIGNMENT PROBLEMS
- •15. LADDER LOGIC FUNCTIONS
- •15.1 INTRODUCTION
- •15.2 DATA HANDLING
- •15.2.1 Move Functions
- •15.2.2 Mathematical Functions
- •15.2.3 Conversions
- •15.2.4 Array Data Functions
- •15.2.4.1 - Statistics
- •15.2.4.2 - Block Operations
- •15.3 LOGICAL FUNCTIONS
- •15.3.1 Comparison of Values
- •15.3.2 Boolean Functions
- •15.4 DESIGN CASES
- •15.4.1 Simple Calculation
- •15.4.2 For-Next
- •15.4.3 Series Calculation
- •15.4.4 Flashing Lights
- •15.5 SUMMARY
- •15.6 PRACTICE PROBLEMS
- •15.7 PRACTICE PROBLEM SOLUTIONS
- •15.8 ASSIGNMENT PROBLEMS
plc states - 12.29
|
T5 |
T4 |
|
STA |
STC |
||
B |
|||
|
D |
|
A |
C |
||||||||||
|
T2 |
T3 |
||||||||||
|
STB |
|||||||||||
|
|
T1 |
||||||||||
|
|
first scan (FS) |
||||||||||
T1 = FS |
STA = ( STA + T2) |
|
|
|
|
|
|
|
|
|||
T5 |
||||||||||||
T2 |
= STB A |
|
|
|
|
|
|
|
|
|
|
|
STB = ( STB + T5 + T4 + T1) T2 T3 |
||||||||||||
|
|
|||||||||||
T3 |
= STB C |
|
|
|
|
|
|
|
|
|
|
|
STC = ( STC + T3 T2) T4 |
||||||||||||
|
|
|||||||||||
T4 |
= STC D |
|
|
|
|
|
|
|
|
|
|
|
T5 |
= STA B |
|
|
|
|
|
|
|
|
|
|
Figure 12.31 Prioritization for State Transition Equations
12.2SUMMARY
•State diagrams are suited to processes with a single flow of execution.
•State diagrams are suited to problems that has clearly defines modes of execution.
•Controller diagrams can be converted to ladder logic using MCR blocks
•State diagrams can also be converted to ladder logic using equations
•The sequence of operations is important when converting state diagrams to ladder logic.
12.3PRACTICE PROBLEMS
1. Draw a state diagram for a microwave oven.
plc states - 12.30
2. Convert the following state diagram to equations.
Inputs |
|
Outputs |
A( C + |
D |
) |
|
|
|
FS |
|||
A |
|
P |
|
|
|
|
|
|
|
|
|
|
B |
|
Q |
|
|
|
|
|
|
|
|
|
|
C |
|
R |
|
|
|
|
|
|
S1 |
|||
D |
|
|
|
|
|
|
|
|
||||
E |
|
|
|
|
|
|
|
|
|
|
|
|
F |
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
F + E |
|
|
|
|
|||
|
|
|
|
|
S0 |
|
|
|
||||
state |
|
P |
Q |
R |
|
|
|
|
|
BA |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
S0 |
|
0 |
1 |
1 |
E( C + D + F) |
|
|
|
||||
S1 |
|
1 |
0 |
1 |
|
|
|
|
|
|
|
|
S2 |
|
1 |
1 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
S2 |
3. Implement the following state diagram with equations.
|
|
ST3 |
|
|
|
|
|
C |
FS |
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
D |
|
|
|
ST2 |
B |
E |
ST4 |
||
|
|
|
|
|
|
|
A |
|
F |
||
|
|
|
|||
|
|
ST1 |
|
|
|
plc states - 12.31
4. Given the following state diagram, use equations to implement ladder logic.
state 1 |
A |
state 3 |
|
C * B |
|
|
|
B
state 2 |
C + B |
5. Convert the following state diagram to logic using equations.
|
A |
state 1 |
state 2 |
|
B |
C
E
D
F
state 3
6.You have been asked to program a PLC-5 that is controlling a handicapped access door opener. The client has provided the electrical wiring diagram below to show how the PLC inputs and outputs have been wired. Button A is located inside and button B is located outside. When either button is pushed the motor will be turned on to open the door. The motor is to be kept on for a total of 15 seconds to allow the person to enter. After the motor is turned off the door will fall closed. In the event that somebody gets caught in the door the thermal relay will go off, and the motor should be turned off. After 20,000 cycles the door should stop working and the light
plc states - 12.32
should go on to indicate that maintenance is required.
24 V DC |
|
Output Card |
|
00 |
|
01 |
Relay |
|
|
02 |
|
03 |
|
04 |
|
05 |
24 V lamp |
|
|
06 |
|
07 |
|
COM |
|
rack 00 |
|
slot 0 |
|
120 V AC
Power
Supply
COM.
Motor |
+24 V DC
Power
Supply
GND
plc states - 12.33
|
|
PLC Input Card |
|
|
|
24V AC |
|
|
|
00 |
|
24 V AC |
button A |
01 |
|
|
|||
Power |
button B |
||
02 |
|||
Supply |
|
||
|
|
03 |
|
|
thermal relay |
04 |
|
|
|
||
|
|
05 |
|
|
|
06 |
|
|
|
07 |
|
|
|
COM |
|
|
|
rack 00 |
|
|
|
slot 1 |
a)Develop a state diagram for the control of the door.
b)Convert the state diagram to ladder logic. (list the input and the output addresses first)
c)Convert the state diagram to Boolean equations.
7.Design a garage door controller using a) block logic, and b) state-transition equations. The behavior of the garage door controller is as follows,
- there is a single button in the garage, and a single button remote control. - when the button is pushed the door will move up or down.
- if the button is pushed once while moving, the door will stop, a second push will start motion again in the opposite direction.
- there are top/bottom limit switches to stop the motion of the door.
- there is a light beam across the bottom of the door. If the beam is cut while the door is closing the door will stop and reverse.
- there is a garage light that will be on for 5 minutes after the door opens or closes.