DVP - ES2/SA2/SS2/SA2/SX2/SE Operation Manual - Programming

API

01

Mnemonic

Operands

Function

Controllers

CALL

P

Call Subroutine

ES2/EX2

SS2

SA2

SX2

SE

OP

Valid Range

P0~P255

Program Steps

CALL, CALLP: 3 steps

 

PULSE

 

 

16-bit

 

 

 

32-bit

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

 

SA2

SX2

ES2/EX2

SS2

 

SA2

SX2

SE

 

SE

 

SE

 

 

 

 

 

 

 

 

 

 

 

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.)

3 - 46

Page 162
Image 162
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual CALL, Callp 3 steps