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

Program example 2:

1.When the rising-edge of X20 is triggered, CALL P10 instruction will transfer execution to subroutine P10.

2.When X21 is ON, execute CALL P11, jump to and run subroutine P11.

3.When X22 is ON, execute CALL P12, jump to and run subroutine P12.

4.When X23 is ON, execute CALL P13, jump to and run subroutine P13.

5.When X24 is ON, execute CALL P14, jump to and run subroutine P14. When the SRET instruction is reached, jump back to the last P subroutine to finish the remaining instructions.

6.The execution of subroutines will go backwards to the subroutine of upper level until SRET instruction in P10 subroutine is executed. After this program execution will return to the main program.

P10

P11

X0

D0

INC

Y0

 

X20

 

CALL

P10

X0

 

INC

D1

Y1

 

FEND

 

X2

 

INC

D10

Y2

 

X21

 

CALL

P11

X2

 

INC

D11

Y3

 

SRET

 

X2

 

INC

D20

Y4

 

X22

P12

CALL

X2

 

INC

D21

Y5

 

SRET

 

P12

Main

Program

P13

Subroutine

P14

Subroutine

X2

 

INC

D30

Y20

 

X23

 

CALL

P13

X2

Subroutine

 

INC

D31

Y21

 

SRET

 

X2

D40

INC

Y22

 

X24

P14

CALL

X2

Subroutine

 

INC

D41

Y23

 

SRET

 

X2

 

INC

D50

Y24

 

 

Subroutine

SRET

 

END

 

3 - 48

Page 164
Image 164
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Inc