beautypg.com

Rockwell Automation 1761 MicroLogix 1000 Programmable Controllers User Manual

Page 184

background image

Preface

MicroLogix 1000 Programmable Controllers User Manual

10–6

Using SBR

The target subroutine is identified by the file number that you entered in the JSR
instruction. This instruction serves as a label or identifier for a program file as a
regular subroutine file.

This instruction has no control bits. It is always evaluated as true. The instruction
must be programmed as the first instruction of the first rung of a subroutine. Use of
this instruction is optional; however, we recommend using it for clarity.

Using RET

This output instruction marks the end of subroutine execution or the end of the
subroutine file. It causes the controller to resume execution at the instruction
following the JSR instruction.

The rung containing the RET instruction may be conditional if this rung precedes
the end of the subroutine. In this way, the controller omits the balance of a
subroutine only if its rung condition is true.

Without an RET instruction, the END instruction (always present in the subroutine)
automatically returns program execution to the instruction following the JSR
instruction in your calling ladder file.