From the course: PLC Program Flow and Control Instructions
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Introduction to subroutines - Ladder Logic Tutorial
From the course: PLC Program Flow and Control Instructions
Introduction to subroutines
- When you have a Long Ladder Logic Program, depending on the application, oftentimes, it's better to kind of chop the program into smaller pieces when applicable. The smaller pieces are called subroutines. A subroutine is a short program that is used by the main program to perform a specific function. The subroutines are called and executed from the main program, as you can see in the illustration here. Each subroutine must have a unique file number. This is how it works. When a subroutine is called from the main ladder logic program, the program is able to scape and go to a subroutine to perform certain functions and then, return to the main program. The main program is called the Main Routine. Sometimes a portion of the Ladder Logic Program must be repeated several times, during, for example, one machine cycle. The subroutine can save a great deal of duplicate programming. The sequence of rungs could be…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
Intro to program control instructions42s
-
(Locked)
Jump (JMP) to label (LBL) instructions1m 53s
-
(Locked)
Master control rest (MCR) instruction2m 22s
-
(Locked)
Difference between JMP and MCR1m 7s
-
(Locked)
Introduction to subroutines2m 13s
-
(Locked)
Jump to subroutine (JSR) instruction35s
-
(Locked)
Subroutine (SBR) instruction38s
-
(Locked)
Return from subroutine (RET)43s
-
(Locked)
Nested subroutines38s
-
-