PLC subroutine call and return instructions


CALL subroutine call instruction‘s number is FNC01. P0~P127 the operands, this instruction takes 3program step.
SRET subroutine return directive number FNC02. No operands, occupies 1 program step.
As shown in Figure 1, if X0 connected, go to the label P10 to execute subroutines. When a SRET instruction is executed, it returns to the next step of the CALL instruction.

Subroutine call and return instructions should be used note:
1) divert label cannot be duplicated, nor duplication with the marking of the jump instructions;
2) subroutine calls can be nested up to 5 levels of nesting.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.