Program Block Example

You can use the Program block as a master program to develop flexible, generic subprograms. By connecting a master Program block with subroutines in other Program blocks, you can use the blocks in many different applications.

CALL commands are very useful for setting up this type of batch process. For example, you could have a master program with the following CALL commands:

00 CALL STARTUP
01 CALL PROCESS
02 CALL SHUTDOWN

In this example, STARTUP, PROCESS, and SHUTDOWN are other Program blocks that perform specific functions. PB01 executes each subprogram sequentially. For example, PROCESS cannot start until STARTUP has executed.

Another master Program block for a second process could use the same startup and shutdown subprograms, but replace PROCESS with PROCESS1.