PLC Programming Techniques - Part 1
PLC Programming Techniques - Part 1
PLC Programming
Techniques – Part 1
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 1
PLC Programming Techniques 1
Lesson Objectives
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 2
PLC Programming Techniques 1
PLC Texts
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 3
PLC Programming Techniques 1
Challenge
Example:
• Simple machine with a cylinder that must advance and
return.
• Could be some events that precede the cylinder motion
• A Process is started once the Cylinder is the Advanced
and held in Position.
• Solenoid type must be defined (see next slide).
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 4
PLC Programming Techniques 1
+ Vdc Auto PB Input Card
Cycle
Start PB For this example, addressing is not necessary
and will not be discussed
Cycle
Stop PB
N.O. = Normally Open
N.C. = Normally Closed
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 5
PLC Programming Techniques 1
Complication Factors not Addressed:
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 6
PLC Programming Techniques 1
+ Vdc
Input Card
Adv’d LS
• Outputs move a pneumatic cylinder
to an Advanced Position and then
Return it (Home) again.
Ret’d LS • Double sided, electrically held, spring return
to center.
• Center position vents all energy but could
also be blocked if necessary.
Supply Advance
Ret. Sol.
Exhaust
Return
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 7
PLC Programming Techniques 1
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
I/O Power Home Interlock Okay To Start Cycle
‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐‐
• A typical machine, system or process will have conditions that are required
for starting of the cycle.
• Permissions are particular to each machine, system or process with a few
suggestions noted here.
• The next few slides show some samples of simple machine programming.
• For these examples, Latches --- (L) --- will not be used. Seals, it can be
argued, are a better choice.
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 8
PLC Programming Techniques 1
Auto Mode Manual Hand / Auto * Cat 0 Auto
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Auto
Mode
‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Manual
Mode
‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
• Mode selection is best handled by Sealing Circuits and a Reset that
is required to switch Modes.
• There may be some additional conditions for Auto. Typically less
conditions for Manual Mode.
*Cat 0 Fault: See last slide
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 9
PLC Programming Techniques 1
Auto Cycle Permission Machine Cycle Cat 0 In
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
In End of Cycle
Cycle Request
‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐
End of Cycle In End of Cycle
Request P.B. Cycle Request
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
* Cat 2
Fault • Once in Auto Mode, a cycle can be initiated.
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐ • Stop at the End of a Complete Cycle.
End of Cycle -- OR --
Request • End of Cycle Request allows continuous
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐ operation or stop once current cycle is complete.
*Cat 2 Fault: See last slide
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 10
PLC Programming Techniques 1
Auto Return Advance
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Advance
Complete
‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐
Manual Advance Return
Mode Cyl P.B. Cyl P.B.
‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐
Advanced Stabilization Advance
Limit Sw. Timer Complete
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ TON ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
0.200s
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 11
PLC Programming Techniques 1
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Start
Process
‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐
• Advance Complete is not mode dependent so Auto Cycle is required for the
Process to Start.
• Start Process is used to seal around Advance Complete.
• Seal may not be required but if the Advance Proximity “flickers” due to the
Process (ie: Press moving the part slightly), the Operation will not be interrupted.
• Fault logic should hand abnormal conditions.
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 12
PLC Programming Techniques 1
Process Auto Return Return
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Return
Cylinder
‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐
Manual Return Advance
Mode Cyl P.B. Cyl P.B.
‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐
Returned Stabilization Return
Limit Sw. Timer Complete
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ TON ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
0.200s
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 13
PLC Programming Techniques 1
Stabilization
Returned Advanced Return
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Timer
Limit Sw. Limit Sw. Complete
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
TON
‐ 0.200s
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 14
PLC Programming Techniques 1
Returned Advanced Switch
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Switch Fault
Fault Reset
‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐
Advance Advanced Motion
Timeout
Cylinder Limit Sw. Fault
‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ TON ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Motion Fault 10.0s
Fault Reset
‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐
• Fault logic can be tricky without a clearly defined fault detection strategy.
For example, will the machine execute an Immediate or End of Cycle Stop?
• It is a good practice to hold Fault Bits on until Explicitly Reset to aid in
Diagnosing the Root Cause.
• Note that resetting may seem to clear a motion fault but then see a
reoccurrence at the next cycle.
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 15
PLC Programming Techniques 1
Switch General
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐‐
Motion
Fault
‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
General Acknowledge
Fault Oneshot or Silence Alarm
‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐[ / ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐( )‐‐‐‐‐‐‐
Alarm ‐‐‐‐‐‐‐‐‐‐‐‐‐‐
‐‐‐‐‐‐‐‐‐‐‐‐‐[ ]‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
• Some simple logic to trigger a Fault Bit and also an Alarm Bit for Annunciation.
• In this example, Alarms can be Acknowledged or Silenced; however, if a Fault
still exists when the Reset Button is Pressed, the Alarm Annunciation will be
re-triggered.
• Depending on the number of expected faults, this method might not be
optimal.
1Feb2020 PLC Programming Techniques 1 © 2020 Wayne Schaefer All rights reserved 17