Chapter 6: Instructions
147
Instruction
Mnemonic
Call Subroutine
Range
Bit
Word
CALL
SBR
RET
CALL: Call subroutine
SBR: Start subroutine
RET: End subroutine
Double words
Ladder
CALL: Call subroutine Sb (Sb = 0 to 63)
SBR: Start Subroutine
RET: Return from Subroutine
Description
1. The subroutine instructions are used when a block of instructions needs to be called more than
once, or called with different values, from the main program.
2. The subroutine to be called is specified by the Sb parameter in the CALL and SBR
instructions. The CALL instruction causes execution to jump to the specified SBR instruction.
After executing the instructions between SBR and RET, program execution is returned to the
instruction following the CALL instruction that called the subroutine.
3. The subroutine defined by the SBR and RET instructions must come after the associated
CALL instruction. All subroutines must be defined and programmed at the end of the control
program. A total of 64 subroutines are available (Sb = 0 to 63).
4. The same subroutine (SBR Sb) can be called by multiple CALL instructions. However, each
subroutine number may only be used once by an SBR instruction.
5. This operation will occur on every scan for which the input condition is true (On). To perform
the operation only on a change of input condition, use the rising/falling edge contact.
CALL
Sb =
SBR
Sb =
R
RET
Содержание D320 PLC
Страница 1: ...D320 PLC User s Manual...
Страница 18: ...6 D320 PLC User s Manual...
Страница 28: ...16 D320 PLC User s Manual...
Страница 34: ...22 D320 PLC User s Manual...
Страница 78: ...66 D320 PLC User s Manual...
Страница 176: ...164 D320 PLC User s Manual...
Страница 210: ...198 D320 PLC User s Manual...
Страница 258: ...246 D320 PLC User s Manual...