Subroutine Instructions; Subroutine Enter - Sbs(91) - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Subroutine Instructions

5-27 Subroutine Instructions

5-27-1 SUBROUTINE ENTER – SBS(91)
Description
Subroutines break large control tasks into smaller ones and enable you to
reuse a given set of instructions. When the main program calls a subroutine,
control is transferred to the subroutine and the subroutine instructions are
executed. The instructions within a subroutine are written in the same way as
main program code. When all the subroutine instructions have been executed,
control returns to the main program to the point just after the point from which
the subroutine was entered (unless otherwise specified in the subroutine).
Ladder Symbol
SBS(91) N
A subroutine can be executed by placing SBS(91) in the main program at the
point where the subroutine is desired. The subroutine number used in
SBS(91) indicates the desired subroutine. When SBS(91) is executed (i.e.,
when the execution condition for it is ON), the instructions between the
SBN(92) with the same subroutine number and the first RET(93) after it are
executed before execution returns to the instruction following the SBS(91) that
made the call.
SBS(91) may be used as many times as desired in the program, i.e., the same
subroutine may be called from different places in the program).
Definer Data Areas
N: Subroutine number
000 to 255
Main program
SBS(91)
00
Main program
SBN(92)
00
Subroutine
RET(93)
END(01)
Section 5-27
377

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CQM1H - PROGRAM and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents

Save PDF