This PLC Programming Example is a Hydraulic Press, created at the request of a visitor to http://bin95.com This PLC program is in no way complete and to only be used for PLC training purposes. If you would like to learn more best-practices PLC programming, please seek our instructor based PLC training. Also please comment and share with others so the world can be a little better place. :>)
1. http://www.bin95.com PLC Programming Example
Program File List
Name Number Type Rungs Debug Bytes
[SYSTEM] 0 SYS 0 No 0
1 SYS 0 No 0
MAIN 2 LADDER 5 No 87
PRESS CNTR 3 LADDER 7 No 271
XREF 5 LADDER 16 No 250
DIAG 6 LADDER 1 No 3
SPARE 7 LADDER 1 No 3
(This program for training only)
2. http://www.bin95.com PLC Programming Example
LAD 2 - MAIN - Main subroutine (allways scanned) by BIN95.com --- Total Rungs in File = 5
BIN95.com Training Example - (Not for use in actual equipment)
This pogram is not to be placed in machine unless a qualified engineer has approved and in any case bin95.com and related initieis are not responsable for the use of
this training example. Feel free to share and link to this programming example. If you would like a copy of the actual .RSS file you can load in a PLC for training,
contact BIN95@BIN95.com and request it. Also see our website for more PLC programming examples.
START STOP E_STOP AUTO
B3:0 B3:0 B3:0 B3:0
0000
0 1 3 2
AUTO
B3:0
2
IF NOT in Auto, you must be in Manual.
AUTO MANUAL
B3:0 B3:0
0001
2 10
Jump to Real-World I/O cross reference subroutine. Having all Real-World I/O in a separate subroutine is a best-practices technique. To learn more best-practices
see BIN95.com instructor based training. If you are about to purchase a machine and it's program does not have an XREF Sub, you should question the quality of
it's programming.
Real world
io cross ref
JSR
0002 Jump To Subroutine
SBR File Number U:5
What does this rung do? Use comment area to answer and refer to rung number and program file number when doing so. Then read on to learn more!
Main Press
AUTO Control
B3:0 JSR
0003 Jump To Subroutine
2 SBR File Number U:3
0004 END
(This program for training only)
3. http://www.bin95.com PLC Programming Example
LAD 3 - PRESS CNTR - Simple Example Press Control by BIN95.com --- Total Rungs in File = 7
BIN95.com Training Example - (Not for use in actual equipment)
This program is not to be placed in machine unless a qualified engineer has approved and in any case bin95.com or related entities are not responsible for the use of
this training example. This program was to give the general public an idea how we teach proper PLC programming structure.
This first rung, # zero in subroutine 3 (also referred to as "ladder 3" or "program file 3" is a seal-in or latching rung. As there is an actual latch instruction, to limit
confusion bin95.com training refers to it as seal in rung. Proper PLC programming should be a sequence of events in order of sequence. So our first rung is Boolean
logic "IF LS1 (Press in home position at top) AND operator presses cycle start button AND in auto move press down at high speed as long as NOT in slow speed
mode.
Move Down Move Down
Top Limit Switch Slow speed High speed
LS1 CYCLE_START AUTO DWN_SLOW E_STOP DWN_FAST
B3:4 B3:0 B3:0 B3:0 B3:0 B3:0
0000
0 5 2 7 3 6
Move Down
High speed
DWN_FAST
B3:0
6
IF Jog down pushbutton is pressed AND in manual mode AND NOT bottom limit switch (LS3) is made OR LS3 timer is still timing, THEN move press down in
slow speed. OR IF moving down in fast mode (Auto) AND middle limit switch (LS2) is made AND NOT bottom LS3 made AND NOT Emergency Stop tripped,
THEN move press down in slow mode. OR IF machine is already in move down in slow mode AND in Auto, THEN continue to move down in slow mode
(Seal-in/latch branch).
Manual Jog Move Down
DOWN Bottom Limit Switch Slow speed
JOG_DWN MANUAL LS3 E_STOP DWN_SLOW
B3:0 B3:0 B3:4 B3:0 B3:0
0001
8 10 2 3 7
Move Down Middle Limit Switch Extra time press
High speed (Speed Control) down motion applied
DWN_FAST LS2 after bottom limit
B3:0 B3:4 switch (LS3) is
made.
6 1 EXT_DWN_PRESSURE/TT
T4:0
Move Down
Slow speed TT
DWN_SLOW AUTO
B3:0 B3:0
7 2
The above rung descriptions described the rungs more detail than you will typically see. As we move on, we will describe less and in a more typical fashion.
As long as LS3 is made then timer T4:0 starts timing, OR IF the timer is already timing, it continues to time (seal-in). When timer is done in ¼ second, it's "TT"
(timer timing) bit is no longer true and breaks seal-in. If the rung is not true, the timer resets to zero and would require LS3 to be made again. This rung allows press
to travel down ¼ second past the bottom LS.
Extra time press
down motion applied
after bottom limit
switch (LS3) is
Bottom Limit Switch made.
LS3 EXT_DWN_PRESSURE
B3:4 TON
0002 Timer On Delay EN
2 Timer T4:0
Time Base 0.01 DN
Extra time press Preset 25<
down motion applied Accum 0<
after bottom limit
switch (LS3) is
made.
EXT_DWN_PRESSURE/TT
T4:0
TT
(This program for training only)
4. http://www.bin95.com PLC Programming Example
LAD 3 - PRESS CNTR - Simple Example Press Control by BIN95.com --- Total Rungs in File = 7
IF Jog_Up OR Manual AND NOT LS1 AND NOT E_Stop THEN Up_Slow
Manual Jog Move Up
UP Top Limit Switch Slow speed
JOG_UP MANUAL LS1 E_STOP UP_SLOW
B3:0 B3:0 B3:4 B3:0 B3:0
0003
9 10 0 3 11
IF Ext_Dwn_Pressure timer is done OR Up_Fast AND Auto AND NOT LS1 AND NOT E_Stop THEN Up_Fast
Question: What is another name for this type of rung? (Use comment area to answer)
Extra time press
down motion applied
after bottom limit
switch (LS3) is Move Up
made. Top Limit Switch High speed
EXT_DWN_PRESSURE/DN AUTO LS1 E_STOP UP_FAST
T4:0 B3:0 B3:4 B3:0 B3:0
0004
DN 2 0 3 12
Move Up
High speed
UP_FAST
B3:0
12
This rung does nothing … or does it? There is a common practice by PLC programmer to actually place a rung in programs that does nothing, sometimes the bit is
described as a "Dummy" bit. I may be there just to place extra comments in the program like this one, or the bit replaces a bit that would be their if the end-user
ordered a certain option. We will use this rung for extra advice. First advice, if you do not know what AFI stands for and how it is used in a program, it is
absolutely critical you seek our bin95.com instructor based training. Second tip, just like an professor obtained his/her position by reading a lot of books, the more
PLC programs you study, the better a PLC programmer you will be.
AFI
B3:0
0005 U
13
0006 END
(This program for training only)
5. http://www.bin95.com PLC Programming Example
LAD 5 - XREF - Realworld I/O cross reference by BIN95.com --- Total Rungs in File = 16
BIN95.com Training Example - (Not for use in actual equipment)
This pogram is not to be placed in machine unless a qualified engineer has approved and in any case bin95.com or related initieis are not responsable for the use of
this training example.
Safety Gate Safety Photoeye E-Stop
Proximity Switch Curtain Auxiliary
I:1 I:1 B3:0
0000
3 4 4
1746-IV16 1746-IV16
E-Stop
Auxiliary E_STOP
B3:0 B3:0
0001
4 3
E-Stop
Activated
(Check safety light
curtain or safety
E_STOP gate)
B3:0 O:2
0002
3 0
1746-OW16
(This program for training only)
6. http://www.bin95.com PLC Programming Example
LAD 5 - XREF - Realworld I/O cross reference by BIN95.com --- Total Rungs in File = 16
Above was safety rungs. Safety first! Use page titles like this to organize rung
Top Limit Switch
for Hydraulic Press
(User refers to as Top Limit Switch
"C1") LS1
I:1 B3:4
0003
0 0
1746-IV16
Middle Limit Switch
for Hydraulic Press
-SPEED CONTROL- Middle Limit Switch
(User refers to as (Speed Control)
"C2") LS2
I:1 B3:4
0004
1 1
1746-IV16
Bottom Limit Switch
for Hydraulic Press
(User refers to as Bottom Limit Switch
"C3") LS3
I:1 B3:4
0005
2 2
1746-IV16
(This program for training only)
7. http://www.bin95.com PLC Programming Example
LAD 5 - XREF - Realworld I/O cross reference by BIN95.com --- Total Rungs in File = 16
^^^ Above Limit Switches ... Below Operator Push Buttons VVV
Manual Jog
Manual DOWN
Jog Down JOG_DWN
I:1 B3:0
0006
8 8
1746-IV16
Manual Jog
Manual UP
Jog Up JOG_UP
I:1 B3:0
0007
9 9
1746-IV16
START
Push Button START
I:1 B3:0
0008
6 0
1746-IV16
STOP
Push Button STOP
I:1 B3:0
0009
7 1
1746-IV16
Cycle Start
Push Button CYCLE_START
I:1 B3:0
0010
5 5
1746-IV16
(This program for training only)
8. http://www.bin95.com PLC Programming Example
LAD 5 - XREF - Realworld I/O cross reference by BIN95.com --- Total Rungs in File = 16
Below Outputs
Move Up Up
Slow speed Speed 1
UP_SLOW (Slow speed)
B3:0 O:2
0011
11 2
1746-OW16
Move Down Down
Slow speed Speed 1
DWN_SLOW (Slow speed)
B3:0 O:2
0012
7 3
1746-OW16
Move Down Down
High speed Speed 2
DWN_FAST (High speed)
B3:0 O:2
0013
6 1
1746-OW16
Move Up UP
High speed Speed 2
UP_FAST (High speed)
B3:0 O:2
0014
12 4
1746-OW16
0015 END
(This program for training only)