Skip to main content

Call Subroutine (Block)

Instruction Parameters

Supported PLC Series

XPnA/1RXPnBXPnEXPnFCP3A/B/P/U
CP4A~D/U
CPnECPnFBPPLC-S

Supported Data Registers

MXYKLFTCSZRQD@DConstant
n--------------

Supported Flags

FlagBitSupport
ErrorF11.0-
ZeroF11.1-
CarryF11.2-

Number of Steps

Steps
2

Operands

OperandDescription
nThe 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.

Examples