Call Subroutine (Block)
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
Instruction Behavior
The CALL and CALLP instructions behave as follows:
- The CALL or CALLP instructions in a scan program calls the subroutine program of SBRT n ~ RET block inside the same program.
- When the execution condition is ON (1), the CALL or CALLP instruction calls the subroutine program with the assigned subroutine ID number, n.
- When the subroutine program operates, the scan program does NOT operate until the process of the subroutine program ends.
- When the operation of a subroutine is completed, the program continues execution of the rung after the CALL or CALLP instruction.
- The CALL and CALLP instructions cannot have the same subroutine ID number, 0 ~ 127, as the JMPP or JMP instructions.
- The CALL and CALLP instructions can be used multiple times in the same program.
Block vs. Program
This section covers information about the CALL and CALLP instructions, 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.