6 Application Instructions API 00-49 API 02 Explanations: 1. No operand. No contact to drive the instruction is required. 2. The subroutine will return to main program by SRET after the termination of subroutine and execute the sequence program located at the next step to the CALL instruction. Program Example 1: SRET instruction is executed, the program returns to address 24 and continues its execution. When X0 = On, CALL instruction is executed and the program jumps to the subroutine designated by P2. When 20 call subroutine P*** 24 P2 Program Example 2: 1.
When X10 goes from Off to On, its rising-edge trigger executes CALL P10 instruction and the program jumps to the subroutine designated by P10. 2. When X11 is On, CALL P11 is executed and the program jumps to the subroutine designated by P11. 3. When X12 is On, CALL P12 is executed and the program jumps to the subroutine designated by P12. 4. When X13 is On, CALL P13 is executed and the program jumps to the subroutine designated by P13. 5. When X14 is On, CALL P14 is executed and the program jumps to the subroutine designated by P14. When SRET is executed, the program returns to the previous P ※ subroutine and continues its execution. 6.
After SRET instruction is executed in P10 subroutine, returning to the main program. DVP-PLC Application Manual 6-6 Mnemonic Function SRET Subroutine Return OP Descriptions Program Steps N/A Automatically returns to the step immediately following the CALL instruction which activated the subroutine SRET: 1 steps PULSE 16-bit 32-bit SA SX SC EH SV EH3 SV2 EH3 ES EX SS SA SX SC EH SV EH3 SV2 ES EX SS ES EX SS SA SX SC EH SV SV2 0 P*** CALL X1 Y1 FEND Y0 Y0 SRET CALL P2