Delta DVP-ES2 User Manual
Page 162
D V P - E S 2 / S A 2 / S S 2 / S A2 / S X 2 / S E O p e r a t i o n M a n u a l - P r o g r a m m i n g
3 - 4 6
API Mnemonic Operands
Function
01
CALL
P
Call Subroutine
Controllers
ES2/EX2 SS2
SA2
SE
SX2
OP
Valid Range
Program Steps
P0~P255
CALL, CALLP: 3 steps
PULSE 16-bit 32-bit
ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2
Operands:
S: The destination pointer P of the call subroutine.
Explanations:
1.
When the CALL instruction is active it forces the program to run the subroutine associated
with the called pointer.
2.
A CALL instruction must be used in conjunction with FEND (API 06) and SRET (API 02)
instructions.
3.
The program jumps to the subroutine pointer (located after an FEND instruction) and
processes the contents until an SRET instruction is encountered. This forces the program
flow back to the line of ladder immediately following the original CALL instruction.
Points to note:
1.
Subroutines must be placed after FEND instruction.
2.
Subroutines must end with SRET instruction.
3.
CALL pointers and CJ instruction pointers are not allowed to coincide.
4.
CALL instructions can call the same CALL subroutine any number of times.
5.
Subroutines can be nested 5 levels including the initial CALL instruction. (If entering the six
levels, the subroutine won’t be executed.)