Subroutines; Declaring A Subroutine - GE VersaMax PLC User Manual

Table of Contents

Advertisement

8.2 Subroutines

104
GFK-1503E
For public disclosure
The program can consist of one Main program that executes completely during each CPU
sweep.
Main
Program
Or a program can be divided into subroutines. The maximum size of a main program or
subroutine block is 64kB. The program can contain up to 255 subroutines.
Subroutines can simplify programming and reduce the overall amount of logic. Each
subroutine can be called as needed. The main program might serve primarily to sequence
the subroutine blocks.
Program
A subroutine block can be called many times as the program executes. Logic that should
be repeated can be placed in a subroutine block, reducing total program size.
Program
In addition to being called from the program, subroutine blocks can also be called by
other subroutine blocks. A subroutine block can even call itself.
Subroutine
Main
Program
Subroutine
The main program is level 1. The program can include up to eight additional nested call
levels.

8.2.1 Declaring a Subroutine

A subroutine must be declared through the block declaration editor of the programming
software.
Subroutine
2
Subroutine
3
Subroutine
4
Subroutine
2
2
Subroutine
4
3
VersaMax PLC User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents