Subroutine Block (End)
Instruction Parameters
Supported PLC Series
| XPnA/1R | XPnB | XPnE | XPnF | CP3A/B/P/U CP4A~D/U | CPnE | CPnF | BP | PLC-S |
|---|---|---|---|---|---|---|---|---|
| - | ✓ | ✓ | ✓ | - | ✓ | ✓ | - | ✓ |
Supported Data Registers
| M | X | Y | K | L | F | T | C | S | Z | R | Q | D | @D | Constant | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| n | - | - | - | - | - | - | - | - | - | - | - | - | - | - | ✓ |
Supported Flags
| Flag | Bit | Support |
|---|---|---|
| Error | F11.0 | ✓ |
| Zero | F11.1 | - |
| Carry | F11.2 | - |
Number of Steps
| Steps |
|---|
| 2 |
Operands
| Operand | Description |
|---|---|
| n | The only operand. Entries are only constants. This is the subroutine ID. The value range is 0 ~ 127. |
Notice
Subroutine Usage
The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.
The error flag, F11.0, turns ON when the instruction is processed with a CPU type such as the BP, XPnA/1R, CP3A/B/P/U, and CP4A~D/U.
Errors will occur when the following conditions are met:
- Subroutine ID, n, exceeds the range 0 ~ 127.
- The CALL n or CALLP n instruction exists, but a corresponding SBRT n instruction does NOT exist.
- The SBRT and RET instructions are not used as a matching set.
- More than one SBRT n instruction with the same subroutine ID number, n, are used in the same program.
Instruction Behavior
Block vs. Program
This section covers information about the RET instruction, where a subroutine block is used.
For more information about using a subroutine program, refer to the subroutine program section and the ECALL or ECALLP instructions.